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
r3008 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui java/org/chorem/lima/ui/financialtransaction java/org/chorem/lima/ui/financialtransactionsearch java/org/chorem/lima/ui/financialtransactionunbalanced java/org/chorem/lima/ui/importexport java/org/chorem/lima/ui/opening resources/i18n
by jpepin@users.chorem.org 19 Aug '10
by jpepin@users.chorem.org 19 Aug '10
19 Aug '10
Author: jpepin
Date: 2010-08-20 01:48:02 +0200 (Fri, 20 Aug 2010)
New Revision: 3008
Url: http://chorem.org/repositories/revision/lima/3008
Log:
Fen?\195?\170tre d'import/export est d?\195?\169sormais modal
Optimisation import/export : remont?\195?\169 des exception ?\195?\160 l'utilisateur
Remise en marche du jaxx configbuilder
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/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/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/resources/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/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-19 23:48:02 UTC (rev 3008)
@@ -159,16 +159,11 @@
actionIcon='entries-unbalanced'/>
<JMenuItem text="lima.entries.searchtransaction" onActionPerformed='getHandler().showTransactionSearchView(this)'
actionIcon='entries-search'/>
- <JMenuItem text="lima.entries.lettering" onActionPerformed='getHandler().showLetteringView(this)'
+ <!-- Menu prévu pour le lettrage automatique
+ <JMenuItem text="lima.entries.lettering" onActionPerformed='getHandler().showLetteringView(this)'
actionIcon='lettering'/>
+ -->
</JMenu>
- <!--
- <JMenu text="lima.view">
- <JCheckBoxMenuItem id="viewFlatten" text="lima.view.flatten"
- onItemStateChanged='getHandler().onChangeView(this)'
- selected="false" actionIcon='view'/>
- </JMenu>
- -->
<JMenu text="lima.reports" mnemonic="{'R'}">
<JMenuItem text="lima.reports.accounts" onActionPerformed='getHandler().showAccountReports(this)'
actionIcon='reports-account'/>
@@ -225,12 +220,7 @@
</JMenu>
</JMenuBar>
<JPanel layout='{new BorderLayout()}'>
-
<JTabbedPane id="contentTabbedPane" constraints="BorderLayout.CENTER"/>
-
- <!-- class not found <jaxx.runtime.swing.StatusMessagePanel id='statusBar'
- _help='"ui.main.statusBar"'
- constraints="BorderLayout.SOUTH"/> -->
</JPanel>
</JFrame>
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-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -24,9 +24,7 @@
import java.util.Locale;
import jaxx.runtime.JAXXContext;
import jaxx.runtime.swing.AboutPanel;
-import jaxx.runtime.swing.editor.config.ConfigUI;
-import jaxx.runtime.swing.editor.config.ConfigUIBuilder;
-import jaxx.runtime.swing.editor.config.model.ConfigUIModel;
+import jaxx.runtime.swing.editor.config.ConfigUIHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
@@ -151,27 +149,19 @@
public void showConfig(JAXXContext context) {
MainView ui = getUI(context);
LimaConfig config = context.getContextValue(LimaConfig.class);
- ConfigUIModel model = new ConfigUIModel(config);
- //TODO pepin 20100510 methode deprecate
- /*
- // categorie repertoires
- model.addCategory(
- n_("lima.config.category.directories"),
- n_("lima.config.category.directories.description"),
- LimaConfig.Option.CONFIG_FILE);
+ //TODO pepin 2010-08-20 add all options
- // others
- model.addCategory(
- n_("lima.config.category.other"),
- n_("lima.config.category.other.description"),
- LimaConfig.Option.FULL_SCREEN,
- LimaConfig.Option.LOCALE);
- */
-
- ConfigUI configUI = ConfigUIBuilder.newConfigUI(context, model, "lima.config.category.directories");
-
- ConfigUIBuilder.showConfigUI(configUI, ui, false);
+ ConfigUIHelper helper = new ConfigUIHelper(config);
+ helper.addCategory(_("lima.config.category.directories"), _("lima.config.category.directories.description"));
+ helper.addOption(LimaConfig.Option.CONFIG_FILE);
+
+ helper.addCategory(_("lima.config.category.other"), _("lima.config.category.other.description"));
+ helper.addOption(LimaConfig.Option.FULL_SCREEN);
+ helper.addOption(LimaConfig.Option.LOCALE);
+
+ helper.buildUI(context, _("lima.config.category.directories"));
+ helper.displayUI(ui, false);
}
public void showHelp(JAXXContext context, String helpId) {
@@ -410,31 +400,4 @@
ImportExport importExport = ImportExport.getInstance(mainView);
importExport.importExport(type, "", true);
}
-
- public void showExportView(String type) {
-
- /*if (!getExportView(type).isEnabled()) {
- getExportView(type).setEnabled(true);
- }*/
- }
-
- public void showLetteringView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- // LetteringView letteringView = new LetteringView(mainView);
- // mainView.showTab(_("lima.entries.lettering"), letteringView);
- }
-
- public void showSearchView(JAXXContext rootContext) {
- /*if (!getSearchView().isEnabled()) {
- getSearchView().setEnabled(true);
- }
- getSearchView().setVisible(true);*/
- }
-
- public void showResultView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- //ResultView resultView = new ResultView(mainView);
- // mainView.showTab(_("lima.tab.result"), resultView);
- }
-
}
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 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -29,6 +29,8 @@
import java.math.BigDecimal;
import java.util.Date;
+import javax.swing.table.TableColumn;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
@@ -68,7 +70,7 @@
public FinancialTransactionTable(FinancialTransactionViewHandler handler) {
this.handler = handler;
-
+
addKeyListener(this);
//Get new date editor
@@ -83,7 +85,7 @@
// highlight unbalanced financial transactions
addColorNonBalancedTransaction();
}
-
+
/**
* Cette méthode permet de colorer toutes les transactions dans le tableau
* afin de bien distinguer les transactions et entrées comptables.
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 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -159,7 +159,7 @@
result = String.class;
break;
case 5:
- result = String.class;
+ result = BigDecimal.class;
break;
case 6:
result = BigDecimal.class;
@@ -168,13 +168,15 @@
result = BigDecimal.class;
break;
case 8:
- result = BigDecimal.class;
+ result = String.class;
break;
}
return result;
}
+
+
@Override
public String getColumnName(int column) {
String result = "n/a";
@@ -196,16 +198,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.position");
+ result = _("lima.table.debit");
break;
case 6:
- result = _("lima.table.debit");
+ result = _("lima.table.credit");
break;
case 7:
- result = _("lima.table.credit");
+ result = _("lima.table.balance");
break;
case 8:
- result = _("lima.table.balance");
+ result = _("lima.table.letter");
break;
}
@@ -258,16 +260,16 @@
result = null; // description
break;
case 5 :
- result = null; // position
+ result = amountDebit;
break;
case 6:
- result = amountDebit;
+ result = amountCredit;
break;
case 7:
- result = amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
case 8:
- result = amountDebit.subtract(amountCredit);
+ result = null;
break;
}
}
@@ -295,16 +297,16 @@
result = currentEntry.getDescription();
break;
case 5 :
- result = currentEntry.getPosition();
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
break;
case 6:
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
break;
case 7:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = null;
break;
case 8:
- result = null; // balance
+ result = currentEntry.getLettering();
break;
}
@@ -327,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) || (columnIndex==8))) {
+ 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))){
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1) || (columnIndex==8))){
editableCell=true;
}
return editableCell;
@@ -492,16 +494,16 @@
currentEntry.setDescription((String)value);
break;
case 5 :
- currentEntry.setPosition((String)value);
- break;
- case 6:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
- case 7:
- currentEntry.setAmount((BigDecimal)value);
+ case 6:
+ 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/financialtransactionsearch/FinancialTransactionSearchTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -58,6 +58,7 @@
* By : $Author: jpepin $
*/
public class FinancialTransactionSearchTableModel extends AbstractTableModel {
+
/** serialVersionUID. */
private static final long serialVersionUID = 3914954536809622358L;
@@ -69,7 +70,6 @@
/** data cache */
protected List<Entry> cacheDataList;
-
public void refresh(List<Entry> objects){
cacheDataList = objects;
@@ -103,7 +103,7 @@
result = String.class;
break;
case 5:
- result = String.class;
+ result = BigDecimal.class;
break;
case 6:
result = BigDecimal.class;
@@ -112,7 +112,7 @@
result = BigDecimal.class;
break;
case 8:
- result = BigDecimal.class;
+ result = String.class;
break;
}
@@ -140,16 +140,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.position");
+ result = _("lima.table.debit");
break;
case 6:
- result = _("lima.table.debit");
+ result = _("lima.table.credit");
break;
case 7:
- result = _("lima.table.credit");
+ result = _("lima.table.balance");
break;
case 8:
- result = _("lima.table.balance");
+ result = _("lima.table.letter");
break;
}
@@ -206,16 +206,16 @@
result = currentRow.getDescription();
break;
case 5 :
- result = currentRow.getPosition();
+ result = currentRow.getDebit() ? currentRow.getAmount() : 0;
break;
case 6:
- result = currentRow.getDebit() ? currentRow.getAmount() : 0;
+ result = currentRow.getDebit() ? 0 : currentRow.getAmount();
break;
case 7:
- result = currentRow.getDebit() ? 0 : currentRow.getAmount();
+ result = null; // balance
break;
case 8:
- result = null; // balance
+ result = currentRow.getLettering();
break;
}
@@ -225,104 +225,12 @@
}
- /**
- * To set cells editable or not
- * different condition for entry or financial transaction
- */
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
- boolean editableCell=false;
- Object currentRow = cacheDataList.get(rowIndex);
- // cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
- editableCell=true;
- }
- // cells editable for the financialtransaction row, no cells exclude the date
- if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
- editableCell=true;
- }
- return editableCell;
+
+ return false;
}
-
- /* /**
- * to modifiy financialtransaction or entry
- *
- @Override
- public void setValueAt(Object value, int row, int column) {
- int financialTransactionRow=0;
- // just prevent too much result
- if (selectedFiscalPeriod != null) {
- Object currentRow = cacheDataList.get(row);
- if (currentRow instanceof FinancialTransaction) {
- FinancialTransaction currentFinancialTransaction =
- (FinancialTransaction)currentRow;
- switch (column) {
- case 0:
- //update
- currentFinancialTransaction.setTransactionDate((Date)value);
- break;
- case 1 :
- currentFinancialTransaction.setEntryBook((EntryBook)value);
- break;
- }
- // notify service for modification
- try {
- financialTransactionService.
- updateFinancialTransaction(currentFinancialTransaction);
- } catch (LimaException eee) {
- if (log.isDebugEnabled()){
- log.debug("Can't update financial transaction", eee);
- }
- DialogHelper.showMessageDialog(eee.getMessage());
- }
- //update the financial transaction in entire
- financialTransactionRow =
- cacheDataList.indexOf(((FinancialTransaction) currentRow));
- }
- else if (currentRow instanceof Entry) {
- Entry currentEntry = (Entry)currentRow;
- switch (column) {
- case 2 :
- currentEntry.setVoucher((String)value);
- break;
- case 3:
- currentEntry.setAccount((Account)value);
- break;
- case 4:
- currentEntry.setDescription((String)value);
- break;
- case 5 :
- currentEntry.setPosition((String)value);
- break;
- case 6:
- currentEntry.setAmount((BigDecimal)value);
- currentEntry.setDebit(true);
- break;
- case 7:
- currentEntry.setAmount((BigDecimal)value);
- currentEntry.setDebit(false);
- break;
- }
- try {
- financialTransactionService.updateEntry(currentEntry);
- } catch (LimaException eee) {
- if (log.isDebugEnabled()){
- log.debug("Can't update entry", eee);
- }
- DialogHelper.showMessageDialog(eee.getMessage());
- }
- //update the financial transaction in entire
- financialTransactionRow =
- cacheDataList.indexOf(((Entry) currentRow).
- getFinancialTransaction());
- }
- //on recharge la liste
- //TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
- fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
- }
- }*/
-
public Object getElementAt(int row){
Object currentRow = cacheDataList.get(row);
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-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -153,7 +153,7 @@
result = String.class;
break;
case 5:
- result = String.class;
+ result = BigDecimal.class;
break;
case 6:
result = BigDecimal.class;
@@ -162,7 +162,7 @@
result = BigDecimal.class;
break;
case 8:
- result = BigDecimal.class;
+ result = String.class;
break;
}
@@ -190,16 +190,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.position");
+ result = _("lima.table.debit");
break;
case 6:
- result = _("lima.table.debit");
+ result = _("lima.table.credit");
break;
case 7:
- result = _("lima.table.credit");
+ result = _("lima.table.balance");
break;
case 8:
- result = _("lima.table.balance");
+ result = _("lima.table.letter");
break;
}
@@ -253,16 +253,16 @@
result = null; // description
break;
case 5 :
- result = null; // position
+ result = amountDebit;
break;
case 6:
- result = amountDebit;
+ result = amountCredit;
break;
case 7:
- result = amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
case 8:
- result = amountDebit.subtract(amountCredit);
+ result = null;
break;
}
}
@@ -290,16 +290,16 @@
result = currentEntry.getDescription();
break;
case 5 :
- result = currentEntry.getPosition();
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
break;
case 6:
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
break;
case 7:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = null;
break;
case 8:
- result = null; // balance
+ result = currentEntry.getLettering();
break;
}
@@ -405,16 +405,16 @@
currentEntry.setDescription((String)value);
break;
case 5 :
- currentEntry.setPosition((String)value);
- break;
- case 6:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
- case 7:
- currentEntry.setAmount((BigDecimal)value);
+ case 6:
+ 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/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -181,9 +181,7 @@
log.debug("Can't get result message", eeeIE);
}
} catch (ExecutionException eeeEE) {
- if (log.isDebugEnabled()){
- log.debug("Can't get result message", eeeEE);
- }
+ DialogHelper.showMessageDialog(eeeEE.getMessage());
}
}
}.execute();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx 2010-08-19 23:48:02 UTC (rev 3008)
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##% -->
-<JDialog id="waitDialog">
+<JDialog modal="true" id="waitDialog">
<script>
<![CDATA[
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2010-08-19 23:48:02 UTC (rev 3008)
@@ -41,6 +41,7 @@
<cell weightx="0.9" rows="4" fill="both">
<JPanel id='panel'>
<JLabel text='lima.opening.welcome' />
+ <JButton text='lima.opening.import' onActionPerformed="handler.importSave()"/>
</JPanel>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -63,6 +63,13 @@
step = 0;
}
+
+ public void importSave(){
+ ImportExport importExport = new ImportExport(view);
+ importExport.importExport(ImportExportEnum.CSV_ALL_IMPORT, "", true);
+ view.dispose();
+ }
+
public void next(){
ImportExport importExport = ImportExport.getInstance(view);
JPanel panel = view.getPanel();
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-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-19 23:48:02 UTC (rev 3008)
@@ -195,6 +195,7 @@
lima.openejb.remotemode.description=
lima.opening.accounts=
lima.opening.entrybook=
+lima.opening.import=
lima.opening.welcome=
lima.pdf=
lima.period.begindate=
@@ -240,6 +241,7 @@
lima.table.grossamount=
lima.table.label=
lima.table.letter=
+lima.table.lettering=
lima.table.move.credit=
lima.table.move.debit=
lima.table.netamount=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-19 23:48:02 UTC (rev 3008)
@@ -181,7 +181,8 @@
lima.openejb.remotemode.description=
lima.opening.accounts=<html><center>Aucun plan comptable charg\u00E9<br/>Veuillez s\u00E9lectionner un plan par d\u00E9fault, <br/>importer un plan personnalis\u00E9<br/> ou annuler pour cr\u00E9er votre propre plan.</center></html>
lima.opening.entrybook=<html>Cochez la case pour importer les journaux par d\u00E9faut \:<br/> Achats, Ventes, Tr\u00E9sorerie, Op\u00E9ration diverses</html>
-lima.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour d\u00E9marrer votre comptabilit\u00E9 en quelques instants\u0085</center></html>
+lima.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
@@ -226,6 +227,7 @@
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
1
0
Author: jpepin
Date: 2010-08-19 23:13:17 +0200 (Thu, 19 Aug 2010)
New Revision: 3007
Url: http://chorem.org/repositories/revision/lima/3007
Log:
Impl?\195?\169mentation recherche ?\195?\169critures.
D?\195?\169placement de la m?\195?\169thode accountsToStrings du service account vers le DAO account.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.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/EntryBookSearchPanel.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/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/ReportServiceImpl.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/FinancialTransactionService.java
trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java
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/enums/ComboBoxAccountsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -344,13 +344,15 @@
Account accountToDelete = accountDAO.findByTopiaId(account.getTopiaId());
//get all subaccounts
- List<Account> accounts = getAllChildrenAccounts(accountToDelete, new ArrayList<Account>());
+ List<Account> accounts =
+ getAllChildrenAccounts(accountToDelete, new ArrayList<Account>());
//if account have sub accounts
if (accounts.size() > 0){
for (Account subAccount : accounts) {
// Check rules for subaccount if have entries
accountingRules.removeAccountRules(subAccount, transaction);
- Account subAccountToDelete = accountDAO.findByTopiaId(subAccount.getTopiaId());
+ Account subAccountToDelete =
+ accountDAO.findByTopiaId(subAccount.getTopiaId());
accountDAO.delete(subAccountToDelete);
}
}
@@ -435,11 +437,11 @@
}
- /**
+ /*
* 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>();
@@ -536,7 +538,7 @@
}
return accounts;
- }
+ }*/
protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -40,7 +40,6 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
@@ -67,9 +66,6 @@
protected AccountingRules accountingRules;
@EJB
- AccountServiceLocal accountServiceLocal;
-
- @EJB
ReportServiceLocal reportServiceLocal;
public FinancialStatementServiceImpl() {
@@ -463,12 +459,12 @@
try {
if (accountsNumberList != null){
//Remove Spaces
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
accountsNumberList = StringUtils.deleteWhitespace(accountsNumberList);
StringTokenizer stQuote = new StringTokenizer(accountsNumberList, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
- List<Account> accountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(s, false, topiaContext);
+ List<Account> accountsList = accountDAO.stringToListAccounts(s, false);
BigDecimal resAmount = new BigDecimal(0);
for (Account account : accountsList) {
@@ -521,7 +517,9 @@
}
}catch (LimaException ex) {
doCatch(topiaContext, ex, log);
- }
+ } catch (TopiaException e) {
+ doCatch(topiaContext, e, log);
+ }
return amount;
}
@@ -546,20 +544,20 @@
for (FinancialStatement financialStatement : financialStatementsList) {
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getAccounts(), true));
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getCreditAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getCreditAccounts(), true));
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getDebitAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getDebitAccounts(), true));
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getProvisionDeprecationAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getProvisionDeprecationAccounts(), true));
}
for (Account account : accountsList) {
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -20,21 +20,23 @@
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;
import java.util.Set;
-
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.business.AccountingRules;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryDAO;
@@ -605,7 +607,97 @@
- protected TopiaContext beginTransaction() throws TopiaException {
+
+ @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;
+ 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);
+
+ //Load for lazy
+ query.addLoad(dateProperty)
+ .addLoad(entryBookLabelProperty)
+ .addLoad(accountProperty);
+
+ if (beginDate != null && endDate != null){
+ query.addBetween(dateProperty, beginDate, endDate);
+ }
+ else if (beginDate != null){
+ query.addEquals(dateProperty, beginDate);
+ }
+ if (voucher != null){
+ query.addWhere(Entry.VOUCHER, Op.LIKE, "%"+voucher+"%");
+ }
+ if (description != null){
+ query.addWhere(Entry.DESCRIPTION, Op.LIKE, "%"+description+"%");
+ }
+ if (letter != null){
+ query.addWhere(Entry.LETTERING, Op.LIKE, "%"+letter+"%");
+ }
+ if (account != null){
+ query.addEquals(Entry.ACCOUNT, account);
+ }
+ else if (accountsList != null){
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
+ List<Account> accounts = accountDAO.stringToListAccounts(accountsList, false);
+ String accountNumbers = "0,";
+ int max = accounts.size();
+ for (int i = 1; i <= max; i++) {
+ accountNumbers += accounts.get(i-1).getAccountNumber();
+ if (i != max){
+ accountNumbers += ",";
+ }
+ }
+ if (accounts.size() > 0){
+ query.addWhere(accountProperty + " in (" + accountNumbers + ")");
+ }
+
+ }
+ if (entryBook != null){
+ query.addEquals(entryBookProperty, entryBook);
+ }
+ else if (amount != null){
+ if (amount2 != null){
+ BigDecimal value1 = new BigDecimal(amount);
+ BigDecimal value2 = new BigDecimal(amount2);
+ query.addBetween(Entry.AMOUNT, value1, value2);
+ }
+ else if (operator != null) {
+ query.addWhere(Entry.AMOUNT+" "+operator+" "+amount);
+ }
+ switch (fStWayEnum) {
+ case CREDIT:
+ query.addEquals(Entry.DEBIT, false);
+ break;
+ case DEBIT:
+ query.addEquals(Entry.DEBIT, true);
+ break;
+ }
+ }
+ log.debug(query);
+ entries = entryDAO.findAllByQuery(query);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ finally {
+ doFinally(topiaContext, log);
+ }
+ return entries;
+ }
+
+ protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
// TODO move it into JTA
TopiaContext topiaTransaction;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import javax.ejb.EJB;
import javax.ejb.Stateless;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
@@ -34,7 +33,6 @@
import org.chorem.lima.beans.ReportsDatasImpl;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportService;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
import org.chorem.lima.entity.Account;
@@ -57,9 +55,6 @@
private TopiaContext rootContext;
- @EJB
- AccountServiceLocal accountServiceLocal;
-
public ReportServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
try {
@@ -480,8 +475,8 @@
}
//build list account from selectedAccounts
else{
- accounts = accountServiceLocal.stringToListAccountsWithTransaction(
- selectedAccounts, false, topiaTransaction);
+ accounts = accountDAO.stringToListAccounts(
+ selectedAccounts, false);
}
for (Account account : accounts) {
ReportsDatas reportsDatas =
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -40,7 +40,6 @@
@Local
public interface AccountServiceLocal extends AccountService{
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException;
void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -19,12 +19,16 @@
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.business.LimaBusinessException;
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;
@@ -80,5 +84,6 @@
void updateEntry(Entry entry) throws LimaException;
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;
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -1,7 +1,43 @@
package org.chorem.lima;
+import static org.nuiton.i18n.I18n._;
+
public enum FinancialStatementWayEnum {
- BOTH, DEBIT, CREDIT;
+ BOTH(_("lima.enum.comboboxamount.both")),
+ DEBIT(_("lima.enum.comboboxamount.debit")),
+ CREDIT(_("lima.enum.comboboxamount.credit"));
+ private final String description;
+
+ private FinancialStatementWayEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = FinancialStatementWayEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ FinancialStatementWayEnum[] enums = FinancialStatementWayEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static FinancialStatementWayEnum valueOfDescription(String description){
+ FinancialStatementWayEnum value = null;
+
+ for (FinancialStatementWayEnum enums : FinancialStatementWayEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+
}
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -18,9 +18,14 @@
package org.chorem.lima.entity;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.StringTokenizer;
+import org.apache.commons.lang.StringUtils;
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> {
@@ -34,11 +39,113 @@
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
.addOrder(Account.ACCOUNT_NUMBER);
-
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 List<Account> stringToListAccounts(String selectedAccounts,
+ Boolean subAccountsMode) throws TopiaException {
+ List<Account> accounts = new ArrayList<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>();
+ 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("..") && !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));
+ }
+ }
+ }
+ }
+ 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 = 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;
+ }
+
+
+
+ @Override
public Account findSubAccountByNumber(String number) throws TopiaException {
TopiaQuery query = createQuery();
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,6 +23,7 @@
public enum ComboBoxAccountsEnum {
+ ALL(_("lima.enum.comboboxaccount.allaccount")),
ACCOUNT(_("lima.enum.comboboxaccount.account")),
ACCOUNT_LIST(_("lima.enum.comboboxaccount.accountlist"));
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -1,61 +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.enums;
-
-import static org.nuiton.i18n.I18n._;
-
-
-public enum ComboBoxAmountEnum {
-
- BOTH(_("lima.enum.comboboxamount.both")),
- DEBIT(_("lima.enum.comboboxamount.debit")),
- CREDIT(_("lima.enum.comboboxamount.credit"));
-
- private final String description;
-
- private ComboBoxAmountEnum(String description) {
- this.description = description;
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public static String[] descriptions(){
- int nbElts = ComboBoxAmountEnum.values().length;
- String[] descriptions = new String[nbElts];
- ComboBoxAmountEnum[] enums = ComboBoxAmountEnum.values();
- for (int i = 0; i < nbElts; i++) {
- descriptions[i] = enums[i].getDescription();
- }
- return descriptions;
- }
-
- public static ComboBoxAmountEnum valueOfDescription(String description){
- ComboBoxAmountEnum value = null;
-
- for (ComboBoxAmountEnum enums : ComboBoxAmountEnum.values()) {
- if (description.equals(enums.description)){
- value = enums;
- break;
- }
- }
- return value;
- }
-}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxEntryBooksEnum {
+
+ ALL(_("lima.enum.comboboxentrybook.all")),
+ SELECT_ONE(_("lima.enum.comboboxentrybook.select_one"));
+
+ private final String description;
+
+ private ComboBoxEntryBooksEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxEntryBooksEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxEntryBooksEnum[] enums = ComboBoxEntryBooksEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxEntryBooksEnum valueOfDescription(String description){
+ ComboBoxEntryBooksEnum value = null;
+
+ for (ComboBoxEntryBooksEnum enums : ComboBoxEntryBooksEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,20 +23,30 @@
public enum ComboBoxOperatorsEnum {
- EQUAL(_("lima.enum.comboboxoperator.equal")),
- SUPERIOR(_("lima.enum.comboboxoperator.superior")),
- INFERIOR(_("lima.enum.comboboxoperator.inferior"));;
+ EQUAL(_("lima.enum.comboboxoperator.equal"), "="),
+ SUPERIOR_OR_EQUAL(_("lima.enum.comboboxoperator.superiororequal"), ">="),
+ INFERIOR_OR_EQUAL(_("lima.enum.comboboxoperator.inferiororequal"), "<="),
+ SUPERIOR(_("lima.enum.comboboxoperator.superior"), ">"),
+ INFERIOR(_("lima.enum.comboboxoperator.inferior"), "<"),
+ INTERVAL(_("lima.enum.comboboxoperator.interval"), ""),
+ NOT_EQUAL(_("lima.enum.comboboxoperator.notequal"),"!=");
private final String description;
+ private final String symbol;
- private ComboBoxOperatorsEnum(String description) {
+ private ComboBoxOperatorsEnum(String description, String symbol) {
this.description = description;
+ this.symbol = symbol;
}
public String getDescription() {
- return this.description;
+ return this.description;
}
+ public String getSymbol(){
+ return this.symbol;
+ }
+
public static String[] descriptions(){
int nbElts = ComboBoxOperatorsEnum.values().length;
String[] descriptions = new String[nbElts];
@@ -46,6 +56,7 @@
}
return descriptions;
}
+
public static ComboBoxOperatorsEnum valueOfDescription(String description){
ComboBoxOperatorsEnum value = null;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,8 +23,8 @@
public enum ComboBoxPeriodEnum {
+ PERIOD(_("lima.enum.comboboxperiod.period")),
DATE(_("lima.enum.comboboxperiod.date")),
- PERIOD(_("lima.enum.comboboxperiod.period")),
FISCAL_PERIOD(_("lima.enum.comboboxperiod.fiscalperiod")),
FINANCIAL_PERIOD(_("lima.enum.comboboxperiod.financialperiod"));
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -100,6 +100,7 @@
return result;
}
+
public void refresh(){
cacheDatas = getDataList();
fireContentsChanged(this, 0, cacheDatas.size());
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -58,7 +58,8 @@
public void actionPerformed(ActionEvent e) {
Object object = this.getSelectedItem();
if (object instanceof Account){
- //handler.setAccount((Account) this.getSelectedItem());
+ handler.setAccount((Account) this.getSelectedItem());
+ handler.refresh();
}
}
@@ -72,7 +73,13 @@
public void keyReleased(KeyEvent e) {
Object object = this.getSelectedItem();
if (object instanceof Account){
- //handler.setAccount((Account) this.getSelectedItem());
+ Account account = (Account) this.getSelectedItem();
+ //to prevent useless call to service
+ if (!account.equals(handler.getAccount())){
+ handler.setAccount(account);
+ handler.refresh();
+ }
+
}
// delegate popup list menu
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -18,8 +18,11 @@
package org.chorem.lima.ui.financialtransactionsearch;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
import javax.swing.JPanel;
import javax.swing.JTextField;
+import org.chorem.lima.entity.Account;
import org.chorem.lima.enums.ComboBoxAccountsEnum;
public class AccountSearchPanel extends JPanel {
@@ -28,7 +31,6 @@
public AccountSearchPanel(FinancialTransactionSearchViewHandler handler) {
this.handler = handler;
- refresh(ComboBoxAccountsEnum.ACCOUNT);
}
static final long serialVersionUID = 1L;
@@ -36,14 +38,46 @@
public void refresh(ComboBoxAccountsEnum comboBoxAccountsEnum){
switch (comboBoxAccountsEnum) {
+ case ALL:
+ handler.setAccount(null);
+ handler.refresh();
+ this.removeAll();
+ break;
+
case ACCOUNT:
- AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler);
+ final AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler);
+ handler.setAccount((Account) accountComboBox.getSelectedItem());
+ handler.refresh();
this.removeAll();
this.add(accountComboBox);
break;
case ACCOUNT_LIST:
- JTextField accountsList = new JTextField(16);
+ final JTextField accountsList = new JTextField(16);
+ KeyListener accountsListKeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ String accounts = accountsList.getText();
+ //to prevent useless call to service
+ if (!accounts.equals(handler.getAccountsList())){
+ handler.setAccountsList(accounts);
+ handler.refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ accountsList.addKeyListener(accountsListKeyListener);
+ handler.setAccountsList(accountsList.getText());
+ handler.setAccount(null);
+ handler.refresh();
this.removeAll();
this.add(accountsList);
break;
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -0,0 +1,101 @@
+/* *##% 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.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import org.chorem.lima.enums.ComboBoxOperatorsEnum;
+
+public class AmountSearchPanel extends JPanel {
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AmountSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxOperatorsEnum.EQUAL);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxOperatorsEnum enums){
+
+ final JTextField amountTextField = new JTextField(16);
+ KeyListener amountKeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ String amount = amountTextField.getText();
+ //to prevent useless call to service
+ if (!amount.equals(handler.getAmount())){
+ handler.setAmount(amount);
+ handler.refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ amountTextField.addKeyListener(amountKeyListener);
+ handler.setAmount2("");
+ handler.setOperator(enums.getSymbol());
+ this.removeAll();
+ this.add(amountTextField);
+
+ switch (enums) {
+ case INTERVAL:
+ final JTextField amount2TextField = new JTextField(16);
+ KeyListener amount2KeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+
+ String amount2 = amount2TextField.getText();
+ //to prevent useless call to service
+ if (!amount2.equals(handler.getAmount2())){
+ handler.setAmount2(amount2);
+ handler.refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ amount2TextField.addKeyListener(amount2KeyListener);
+ handler.setAmount("");
+ this.add(amount2TextField);
+ break;
+ }
+ amountTextField.setText(handler.getAmount());
+ handler.refresh();
+
+ }
+
+}
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -58,7 +58,8 @@
public void actionPerformed(ActionEvent e) {
Object object = this.getSelectedItem();
if (object instanceof EntryBook){
- //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.refresh();
}
}
@@ -72,7 +73,8 @@
public void keyReleased(KeyEvent e) {
Object object = this.getSelectedItem();
if (object instanceof EntryBook){
- //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.refresh();
}
// delegate popup list menu
if ( e.getKeyChar() == KeyEvent.VK_ENTER )
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -0,0 +1,54 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import javax.swing.JPanel;
+import org.chorem.lima.enums.ComboBoxEntryBooksEnum;
+
+public class EntryBookSearchPanel extends JPanel {
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public EntryBookSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxEntryBooksEnum enums){
+
+ switch (enums) {
+ 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/FinancialTransactionSearchTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -42,7 +42,7 @@
* @author ore
* @author Rémi Chapelet
*/
-public class FinancialTransactionSearchTable extends JXTable implements KeyListener {
+public class FinancialTransactionSearchTable extends JXTable {
/** serialVersionUID. */
private static final long serialVersionUID = 3133690382049594727L;
@@ -58,8 +58,6 @@
public FinancialTransactionSearchTable(FinancialTransactionSearchViewHandler handler) {
this.handler = handler;
-
- addKeyListener(this);
//Get new date editor
setDefaultEditor(Date.class, new DateTableCellEditor());
@@ -126,29 +124,4 @@
new ColorHighlighter(predicate, new Color(255, 198, 209), null);
addHighlighter(colorTransaction);
}
-
- /**
- * for each action combination key are think
- * for extend keyboard and laptop keyboard
- */
- @Override
- public void keyPressed(KeyEvent e) {
-
- }
-
- /*
- * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
- */
- @Override
- public void keyTyped(KeyEvent e) {
-
- }
-
- /*
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- */
- @Override
- public void keyReleased(KeyEvent e) {
-
- }
}
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -66,63 +66,13 @@
private static final Log log = LogFactory
.getLog(FinancialTransactionSearchTableModel.class);
- /** Transaction service. */
- protected final FinancialTransactionService financialTransactionService;
- /** selected financial period */
- protected FiscalPeriod selectedFiscalPeriod;
-
/** data cache */
- protected List<Object> cacheDataList;
-
- /** collection
+ protected List<Entry> cacheDataList;
- /**
- * Model constructor.
- *
- * Just init service proxies.
- */
- public FinancialTransactionSearchTableModel() {
- /* Services */
- financialTransactionService =
- LimaServiceFactory.getInstance().getService(
- FinancialTransactionServiceMonitorable.class);
- }
-
- /**
- * Le model est une combinaison de Transaction/Entries.
- *
- *
- * @return
- */
- protected List<Object> getDataList() {
- List<Object> results = new ArrayList<Object>();
- if(selectedFiscalPeriod != null){
- try {
- Set<FinancialTransaction> financialtransactions =
- financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
- for (FinancialTransaction financialtransaction : financialtransactions) {
- results.add(financialtransaction);
- List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
- Collections.sort(entries, new EntryComparator());
- results.addAll(entries);
- }
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
- }
-
- ErrorHelper.showErrorDialog("Can't get transaction list", eee);
- }
- }
-
- return results;
- }
-
- public void refresh(){
- cacheDataList = getDataList();
+ public void refresh(List<Entry> objects){
+ cacheDataList = objects;
fireTableDataChanged();
}
@@ -224,79 +174,45 @@
// just prevent too much result
if (cacheDataList != null) {
- result = cacheDataList.get(row);
-
- if (result instanceof FinancialTransaction) {
- FinancialTransaction currentRow = (FinancialTransaction)result;
- BigDecimal amountDebit = currentRow.getAmountDebit();
- BigDecimal amountCredit = currentRow.getAmountCredit();
-
+ Entry currentRow = cacheDataList.get(row);
+
switch (column) {
case 0:
- result = currentRow.getTransactionDate();
+ result = currentRow.getFinancialTransaction().getTransactionDate();
break;
case 1:
- if (currentRow.getEntryBook() != null){
- result = currentRow.getEntryBook().getCode();
+ EntryBook entryBook =
+ currentRow.getFinancialTransaction().getEntryBook();
+ if (entryBook != null){
+ result = entryBook.getCode();
}
else {
result = null;
}
break;
case 2:
- result = null; //entrybook
+ result = currentRow.getVoucher();
break;
- case 3:
- result = null; // account
- break;
- case 4:
- result = null; // description
- break;
- case 5 :
- result = null; // position
- break;
- case 6:
- result = amountDebit;
- break;
- case 7:
- result = amountCredit;
- break;
- case 8:
- result = amountDebit.subtract(amountCredit);
- break;
- }
- }
- else if (result instanceof Entry) {
- Entry currentEntry = (Entry)result;
- switch (column) {
- case 0:
- result = null; // date
- break;
- case 1 : // entry book
- result = null;
- break;
- case 2:
- result = currentEntry.getVoucher();
- break;
case 3: // account
- if (currentEntry.getAccount() != null){
- result = currentEntry.getAccount().getAccountNumber();
+ Account account = currentRow.getAccount();
+ if (account != null){
+ result = account.getAccountNumber();
}
else {
result = null;
}
break;
case 4:
- result = currentEntry.getDescription();
+ result = currentRow.getDescription();
break;
case 5 :
- result = currentEntry.getPosition();
+ result = currentRow.getPosition();
break;
case 6:
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentRow.getDebit() ? currentRow.getAmount() : 0;
break;
case 7:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = currentRow.getDebit() ? 0 : currentRow.getAmount();
break;
case 8:
result = null; // balance
@@ -304,14 +220,10 @@
}
}
- }
return result;
}
- public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
- selectedFiscalPeriod = fiscalPeriod;
- }
/**
* To set cells editable or not
@@ -333,33 +245,9 @@
}
- /**
- * @throws LimaException
- */
- public void addEmptyEntry(Object value, int row) throws LimaException {
- FinancialTransaction currentTransaction = null;
- Object currentRow = cacheDataList.get(row);
- Entry entry = new EntryImpl();
- entry.setAmount(new BigDecimal(0));
- //check if current row is a transaction or an entry
- if (currentRow instanceof FinancialTransaction) {
- currentTransaction = (FinancialTransaction)currentRow;
- }
- else if (currentRow instanceof Entry) {
- Entry currentEntry = (Entry)currentRow;
- //get back the parent transaction of the entry
- currentTransaction = currentEntry.getFinancialTransaction();
- }
- //create it
- entry.setFinancialTransaction(currentTransaction);
- financialTransactionService.createEntry(entry);
- //on recharge la liste
- refresh();
- }
-
- /**
+ /* /**
* to modifiy financialtransaction or entry
- */
+ *
@Override
public void setValueAt(Object value, int row, int column) {
int financialTransactionRow=0;
@@ -433,35 +321,12 @@
//TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
}
- }
+ }*/
public Object getElementAt(int row){
Object currentRow = cacheDataList.get(row);
return currentRow;
}
-
-
- /**
- * Delete selected row in table (could be transaction or entry).
- *
- * Called by model.
- * @param Object, int
- * @throws LimaException
- */
- public void removeObject(Object object, int row) throws LimaException {
- Object currentRow = cacheDataList.get(row);
- if (currentRow instanceof FinancialTransaction) {
- FinancialTransaction currentTransaction =
- (FinancialTransaction)currentRow;
- financialTransactionService.removeFinancialTransaction(currentTransaction);
- }
- else if (currentRow instanceof Entry) {
- Entry currentEntry = (Entry)currentRow;
- financialTransactionService.removeEntry(currentEntry);
- }
- //on recharge la liste
- refresh();
- }
}
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
@@ -22,13 +22,21 @@
<![CDATA[
import org.chorem.lima.enums.ComboBoxPeriodEnum;
import org.chorem.lima.enums.ComboBoxAccountsEnum;
- import org.chorem.lima.enums.ComboBoxAmountEnum;
+ import org.chorem.lima.enums.ComboBoxEntryBooksEnum;
+ import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.enums.ComboBoxOperatorsEnum;
AccountSearchPanel accountSearchPanel = new AccountSearchPanel(handler);
+ AmountSearchPanel amountSearchPanel = new AmountSearchPanel(handler);
+ EntryBookSearchPanel entryBookSearchPanel = new EntryBookSearchPanel(handler);
PeriodSearchPanel periodSearchPanel = new PeriodSearchPanel(handler);
void $afterCompleteSetup() {
+ handler.init();
+ handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription(
+ (String) getAmountComboBox().getSelectedItem()));
+ handler.setOperator(ComboBoxOperatorsEnum.valueOfDescription(
+ (String) getOperatorComboBox().getSelectedItem()).getSymbol());
}
]]>
@@ -58,16 +66,22 @@
onActionPerformed="accountSearchPanel.refresh(ComboBoxAccountsEnum.valueOfDescription((String) accountComboBox.getSelectedItem()));
validate(); repaint()"/></cell>
<cell><AccountSearchPanel javaBean="accountSearchPanel"/></cell>
- <cell anchor='east'><JLabel text="lima.table.entrybook"/></cell>
- <cell anchor='west'><EntryBookSearchComboBox javaBean="new EntryBookSearchComboBox(handler)"/></cell>
+ <cell><JComboBox id="entryBookComboBox" javaBean="new JComboBox(ComboBoxEntryBooksEnum.descriptions())"
+ onActionPerformed="entryBookSearchPanel.refresh(ComboBoxEntryBooksEnum.valueOfDescription((String) entryBookComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><EntryBookSearchPanel javaBean="entryBookSearchPanel"/></cell>
</row></Table></cell>
</row>
<row>
<cell><Table><row>
<cell><JLabel text="lima.amount"/></cell>
- <cell><JComboBox id="amountComboBox" javaBean="new JComboBox(ComboBoxAmountEnum.descriptions())"/></cell>
- <cell><JComboBox id="operatorComboBox" javaBean="new JComboBox(ComboBoxOperatorsEnum.descriptions())"/></cell>
- <cell><JTextField id='amount'/></cell>
+ <cell><JComboBox id="amountComboBox" javaBean="new JComboBox(FinancialStatementWayEnum.descriptions())"
+ onActionPerformed="handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription((String)amountComboBox.getSelectedItem()));
+ handler.refresh()"/></cell>
+ <cell><JComboBox id="operatorComboBox" javaBean="new JComboBox(ComboBoxOperatorsEnum.descriptions())"
+ onActionPerformed="amountSearchPanel.refresh(ComboBoxOperatorsEnum.valueOfDescription((String) operatorComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><AmountSearchPanel javaBean="amountSearchPanel"/></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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -19,10 +19,23 @@
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;
+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.
@@ -47,14 +60,225 @@
protected FiscalPeriodComboBoxModel comboBoxModel;
+ /** 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;
+
protected FinancialTransactionSearchViewHandler(FinancialTransactionSearchView view) {
this.view = view;
+
+ /* Services */
+ financialTransactionService =
+ LimaServiceFactory.getInstance().getService(
+ 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;
+ }
+ this.voucher=result;
+ }
+
+ public void setDescription(String description){
+ String result = null;
+ if (!description.equals("")){
+ result = description;
+ }
+ this.description=result;
+ }
+
+ public void setLetter(String letter){
+ String result = null;
+ if (!letter.equals("")){
+ result = letter;
+ }
+ this.letter=result;
+ }
+
+ public String getAccountsList(){
+ return this.accountsList;
+ }
+
+ public void setAccountsList(String accountsList){
+ String result = null;
+ if (!accountsList.equals("")){
+ result = accountsList;
+ }
+ this.accountsList=result;
+ }
+ public Account getAccount(){
+ return this.account;
}
+ public void setAccount(Account account){
+ this.account=account;
+ }
+
+ public void setEntryBook(EntryBook entryBook){
+ this.entryBook=entryBook;
+ }
+
+
+ public String getAmount(){
+ return this.amount;
+ }
+
+ public void setAmount(String amount){
+ String result = null;
+ if (!amount.equals("")){
+ result = amount;
+ }
+ this.amount=result;
+ }
+
+ public String getAmount2(){
+ return this.amount2;
+ }
+
+ public void setAmount2(String amount2){
+ String result = null;
+ if (!amount2.equals("")){
+ result = amount2;
+ }
+ this.amount2=result;
+ }
+
+ public void setAmountWayEnum(FinancialStatementWayEnum amountWayEnum){
+ this.amountWayEnum=amountWayEnum;
+ }
+
+ public void setOperator(String operator){
+ String result = null;
+ if (!operator.equals("")){
+ result = operator;
+ }
+ this.operator=result;
+ }
+
public void refresh(){
tableModel = view.getFinancialTransactionSearchTableModel();
- tableModel.refresh();
+ if (tableModel != null){
+ log.debug(voucher+" "
+ +description+" "+letter+" "+accountsList+" "
+ +account+" "+entryBook+" "+amount);
+ //prevent to much result
+ tableModel.refresh(getDataList());
+ }
}
+
+ protected List<Entry> getDataList() {
+ List<Entry> results = null;
+ 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/financialtransactionsearch/PeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -18,6 +18,8 @@
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._;
@@ -28,6 +30,8 @@
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;
@@ -44,7 +48,9 @@
public PeriodSearchPanel(FinancialTransactionSearchViewHandler handler) {
this.handler = handler;
- refresh(ComboBoxPeriodEnum.DATE);
+
+ //init date
+ refresh(ComboBoxPeriodEnum.PERIOD);
}
static final long serialVersionUID = 1L;
@@ -56,7 +62,18 @@
Calendar calendar = Calendar.getInstance();
Date date = calendar.getTime();
date = DateUtils.truncate(date, Calendar.DATE);
- JXDatePicker datePicker = new JXDatePicker(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;
@@ -74,9 +91,30 @@
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
- JXDatePicker beginDatePicker = new JXDatePicker(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"));
- JXDatePicker endDatePicker = new JXDatePicker(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);
@@ -87,10 +125,20 @@
case FISCAL_PERIOD:
FiscalPeriodComboBoxModel fiscalModel = new FiscalPeriodComboBoxModel();
FiscalPeriodComboBoxRenderer fiscalRenderer = new FiscalPeriodComboBoxRenderer();
- JComboBox fiscalPeriod = new JComboBox(fiscalModel);
+ final JComboBox fiscalPeriod = new JComboBox(fiscalModel);
fiscalPeriod.setRenderer(fiscalRenderer);
fiscalPeriod.setEditable(false);
- //fiscalPeriod.actionPerformed(handler.);
+ 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;
@@ -98,9 +146,19 @@
case FINANCIAL_PERIOD:
FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
FinancialPeriodComboBoxRenderer financialRenderer = new FinancialPeriodComboBoxRenderer();
- JComboBox financialPeriod = new JComboBox(financialModel);
+ 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/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -157,6 +157,9 @@
* Ajoute une entrée comptable si tab est sur
* la dernière cellule.
*/
+
+ //TODO 2010-08-19 verifier si la transaction est équilibré
+ // cf. FinancialTransactionTable.java comme modèle
if (e.getKeyChar() == KeyEvent.VK_TAB) {
// Vérifie si la cellule sélectionnée est la dernière
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-19 21:13:17 UTC (rev 3007)
@@ -93,12 +93,20 @@
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=
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-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-19 21:13:17 UTC (rev 3007)
@@ -87,13 +87,20 @@
lima.entrybook.type4=G\u00E9n\u00E9ral
lima.entrybook.type5=Situation
lima.enum.comboboxaccount.account=Compte
-lima.enum.comboboxaccount.accountlist=Liste de 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
lima.enum.comboboxoperator.inferior=Inf\u00E9rieur
+lima.enum.comboboxoperator.inferiororequal=Inf\u00E9rieur ou \u00E9gal
+lima.enum.comboboxoperator.interval=Intervalle
+lima.enum.comboboxoperator.notequal=Diff\u00E9rent
lima.enum.comboboxoperator.superior=Sup\u00E9rieur
+lima.enum.comboboxoperator.superiororequal=Sup\u00E9rieur ou \u00E9gal
lima.enum.comboboxperiod.date=Date
lima.enum.comboboxperiod.financialperiod=P\u00E9riode Financi\u00E8re
lima.enum.comboboxperiod.fiscalperiod=Exercice
1
0
r3006 - in trunk/lima-swing/src/main: java/org/chorem/lima/enums java/org/chorem/lima/ui java/org/chorem/lima/ui/financialtransactionsearch java/org/chorem/lima/ui/opening resources/i18n
by jpepin@users.chorem.org 18 Aug '10
by jpepin@users.chorem.org 18 Aug '10
18 Aug '10
Author: jpepin
Date: 2010-08-18 16:47:44 +0200 (Wed, 18 Aug 2010)
New Revision: 3006
Url: http://chorem.org/repositories/revision/lima/3006
Log:
Ajout vue recherches d'?\195?\169critures.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxAccountsEnum {
+
+ ACCOUNT(_("lima.enum.comboboxaccount.account")),
+ ACCOUNT_LIST(_("lima.enum.comboboxaccount.accountlist"));
+
+ private final String description;
+
+ private ComboBoxAccountsEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxAccountsEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxAccountsEnum[] enums = ComboBoxAccountsEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxAccountsEnum valueOfDescription(String description){
+ ComboBoxAccountsEnum value = null;
+
+ for (ComboBoxAccountsEnum enums : ComboBoxAccountsEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,61 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxAmountEnum {
+
+ BOTH(_("lima.enum.comboboxamount.both")),
+ DEBIT(_("lima.enum.comboboxamount.debit")),
+ CREDIT(_("lima.enum.comboboxamount.credit"));
+
+ private final String description;
+
+ private ComboBoxAmountEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxAmountEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxAmountEnum[] enums = ComboBoxAmountEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxAmountEnum valueOfDescription(String description){
+ ComboBoxAmountEnum value = null;
+
+ for (ComboBoxAmountEnum enums : ComboBoxAmountEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,61 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxOperatorsEnum {
+
+ EQUAL(_("lima.enum.comboboxoperator.equal")),
+ SUPERIOR(_("lima.enum.comboboxoperator.superior")),
+ INFERIOR(_("lima.enum.comboboxoperator.inferior"));;
+
+ private final String description;
+
+ private ComboBoxOperatorsEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxOperatorsEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxOperatorsEnum[] enums = ComboBoxOperatorsEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxOperatorsEnum valueOfDescription(String description){
+ ComboBoxOperatorsEnum value = null;
+
+ for (ComboBoxOperatorsEnum enums : ComboBoxOperatorsEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,62 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxPeriodEnum {
+
+ DATE(_("lima.enum.comboboxperiod.date")),
+ PERIOD(_("lima.enum.comboboxperiod.period")),
+ FISCAL_PERIOD(_("lima.enum.comboboxperiod.fiscalperiod")),
+ FINANCIAL_PERIOD(_("lima.enum.comboboxperiod.financialperiod"));
+
+ private final String description;
+
+ private ComboBoxPeriodEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxPeriodEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxPeriodEnum[] enums = ComboBoxPeriodEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxPeriodEnum valueOfDescription(String description){
+ ComboBoxPeriodEnum value = null;
+
+ for (ComboBoxPeriodEnum enums : ComboBoxPeriodEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-18 14:47:44 UTC (rev 3006)
@@ -157,6 +157,8 @@
actionIcon='entries-balanced'/>
<JMenuItem text="lima.entries.searchunbalancedtransaction" onActionPerformed='getHandler().showTransactionUnbalancedView(this)'
actionIcon='entries-unbalanced'/>
+ <JMenuItem text="lima.entries.searchtransaction" onActionPerformed='getHandler().showTransactionSearchView(this)'
+ actionIcon='entries-search'/>
<JMenuItem text="lima.entries.lettering" onActionPerformed='getHandler().showLetteringView(this)'
actionIcon='lettering'/>
</JMenu>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -42,6 +42,7 @@
import org.chorem.lima.ui.financialstatementchart.FinancialStatementChartView;
import org.chorem.lima.ui.financialstatementreport.FinancialStatementReportView;
import org.chorem.lima.ui.financialtransaction.FinancialTransactionView;
+import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchView;
import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView;
import org.chorem.lima.ui.home.HomeView;
import org.chorem.lima.ui.identity.IdentityForm;
@@ -380,6 +381,12 @@
mainView.showTab(_("lima.entries.searchunbalancedtransaction"), searchResultView);
}
+ public void showTransactionSearchView(JAXXContext rootContext) {
+ MainView mainView = getUI(rootContext);
+ FinancialTransactionSearchView searchView = new FinancialTransactionSearchView(mainView);
+ mainView.showTab(_("lima.entries.searchtransaction"), searchView);
+ }
+
public void showBalanceView(JAXXContext rootContext) {
MainView mainView = getUI(rootContext);
BalanceView balanceView = new BalanceView(mainView);
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,90 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.ui.accountsreports.AccountRenderer;
+import org.chorem.lima.ui.combobox.AccountComboBoxModel;
+import org.chorem.lima.util.AccountToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class AccountSearchComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(AccountSearchComboBox.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AccountSearchComboBox(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ AccountComboBoxModel accountComboBoxModel = new AccountComboBoxModel();
+ AccountRenderer accountRenderer = new AccountRenderer();
+ setModel(accountComboBoxModel);
+ setRenderer(accountRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, AccountToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ //handler.setAccount((Account) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ //handler.setAccount((Account) this.getSelectedItem());
+ }
+
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,54 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import org.chorem.lima.enums.ComboBoxAccountsEnum;
+
+public class AccountSearchPanel extends JPanel {
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AccountSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxAccountsEnum.ACCOUNT);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxAccountsEnum comboBoxAccountsEnum){
+
+ switch (comboBoxAccountsEnum) {
+ case ACCOUNT:
+ AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler);
+ this.removeAll();
+ this.add(accountComboBox);
+ break;
+
+ case ACCOUNT_LIST:
+ JTextField accountsList = new JTextField(16);
+ this.removeAll();
+ this.add(accountsList);
+ break;
+ }
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,89 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.ui.combobox.EntryBookComboBoxModel;
+import org.chorem.lima.ui.combobox.EntryBookRenderer;
+import org.chorem.lima.util.EntryBookToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class EntryBookSearchComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(EntryBookSearchComboBox.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public EntryBookSearchComboBox(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ EntryBookComboBoxModel entryBookComboBoxModel = new EntryBookComboBoxModel();
+ EntryBookRenderer entryBookRenderer = new EntryBookRenderer();
+ setModel(entryBookComboBoxModel);
+ setRenderer(entryBookRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, EntryBookToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,154 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.math.BigDecimal;
+import java.util.Date;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
+import org.chorem.lima.ui.celleditor.DateTableCellEditor;
+import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.ColorHighlighter;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
+
+
+/**
+ * Table des transaction qui ajoute des comportement (keys).
+ *
+ * @author ore
+ * @author Rémi Chapelet
+ */
+public class FinancialTransactionSearchTable extends JXTable implements KeyListener {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3133690382049594727L;
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ private Highlighter colorTransaction;
+
+ private ColorHighlighter colorBalance;
+
+ /**
+ */
+ public FinancialTransactionSearchTable(FinancialTransactionSearchViewHandler handler) {
+
+ this.handler = handler;
+
+ addKeyListener(this);
+
+ //Get new date editor
+ setDefaultEditor(Date.class, new DateTableCellEditor());
+ //Get new entry book editor
+ setDefaultEditor(EntryBook.class, new EntryBookTableCellEditor());
+ //Get new account editor
+ setDefaultEditor(Account.class, new AccountTableCellEditor());
+
+ //highlight financial financial transactions
+ addColorTransaction();
+ // highlight unbalanced financial transactions
+ addColorNonBalancedTransaction();
+ }
+
+ /**
+ * Cette méthode permet de colorer toutes les transactions dans le tableau
+ * afin de bien distinguer les transactions et entrées comptables.
+ * On récupère la première cellule, on vérifie que c'est une date
+ */
+ protected void addColorTransaction() {
+ if (colorTransaction != null) {
+ removeHighlighter(colorTransaction);
+ }
+ HighlightPredicate predicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer,
+ ComponentAdapter adapter) {
+ return adapter.getValueAt(adapter.row, 0) instanceof Date;
+ }
+ };
+ colorTransaction =
+ new ColorHighlighter(predicate, new Color(222,222,222), null);
+ addHighlighter(colorTransaction);
+ }
+
+
+
+ /**
+ * Permet de surligner une transaction dans le tableau lorsque
+ * cette dernière n'est pas équilibrée.
+ * On récupère la dernière cellule de la ligne
+ * et on vérifie si la valeur est différente de 0
+ */
+ protected void addColorNonBalancedTransaction() {
+ if (colorBalance != null) {
+ removeHighlighter(colorBalance);
+ }
+ HighlightPredicate predicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer,
+ ComponentAdapter adapter) {
+ boolean isHighlighted = false;
+ Object value = adapter.getValueAt(adapter.row, 8);
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
+ isHighlighted = true;
+ }
+ }
+ return isHighlighted;
+ }
+ };
+ colorTransaction =
+ new ColorHighlighter(predicate, new Color(255, 198, 209), null);
+ addHighlighter(colorTransaction);
+ }
+
+ /**
+ * for each action combination key are think
+ * for extend keyboard and laptop keyboard
+ */
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ /*
+ * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
+ */
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+ /*
+ * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+ */
+ @Override
+ public void keyReleased(KeyEvent e) {
+
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,467 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.table.AbstractTableModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.utils.EntryComparator;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryImpl;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.util.DialogHelper;
+import org.chorem.lima.util.ErrorHelper;
+
+/**
+ * Basic transaction table model.
+ *
+ * Le modele est filtré sur {@link #selectedEntryBook} et
+ * {@link #selectedFinancialPeriod} (montée en charge !).
+ *
+ * @author ore
+ * @author chatellier
+ * @version $Revision: 2897 $
+ *
+ * Last update : $Date: 2010-05-14 13:22:26 +0200 (ven. 14 mai 2010) $
+ * By : $Author: jpepin $
+ */
+public class FinancialTransactionSearchTableModel extends AbstractTableModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3914954536809622358L;
+
+ /** log. */
+ private static final Log log = LogFactory
+ .getLog(FinancialTransactionSearchTableModel.class);
+
+ /** Transaction service. */
+ protected final FinancialTransactionService financialTransactionService;
+
+ /** selected financial period */
+ protected FiscalPeriod selectedFiscalPeriod;
+
+ /** data cache */
+ protected List<Object> cacheDataList;
+
+ /** collection
+
+
+ /**
+ * Model constructor.
+ *
+ * Just init service proxies.
+ */
+ public FinancialTransactionSearchTableModel() {
+ /* Services */
+ financialTransactionService =
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class);
+ }
+
+ /**
+ * Le model est une combinaison de Transaction/Entries.
+ *
+ *
+ * @return
+ */
+ protected List<Object> getDataList() {
+ List<Object> results = new ArrayList<Object>();
+ if(selectedFiscalPeriod != null){
+ try {
+ Set<FinancialTransaction> financialtransactions =
+ financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
+ for (FinancialTransaction financialtransaction : financialtransactions) {
+ results.add(financialtransaction);
+ List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
+ Collections.sort(entries, new EntryComparator());
+ results.addAll(entries);
+ }
+ }
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+
+ ErrorHelper.showErrorDialog("Can't get transaction list", eee);
+ }
+ }
+
+ return results;
+ }
+
+ public void refresh(){
+ cacheDataList = getDataList();
+ fireTableDataChanged();
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 9;
+ }
+
+ @Override
+ public Class<?> getColumnClass(int column) {
+
+ Class<?> result = null;
+
+ switch (column) {
+ case 0:
+ result = Date.class;
+ break;
+ case 1:
+ result = EntryBook.class;
+ break;
+ case 2:
+ result = String.class;
+ break;
+ case 3:
+ result = Account.class;
+ break;
+ case 4:
+ result = String.class;
+ break;
+ case 5:
+ result = String.class;
+ break;
+ case 6:
+ result = BigDecimal.class;
+ break;
+ case 7:
+ result = BigDecimal.class;
+ break;
+ case 8:
+ result = BigDecimal.class;
+ break;
+ }
+
+ return result;
+ }
+
+ @Override
+ public String getColumnName(int column) {
+ String result = "n/a";
+
+ switch (column) {
+ case 0:
+ result = _("lima.table.date");
+ break;
+ case 1:
+ result = _("lima.table.entrybook");
+ break;
+ case 2:
+ result = _("lima.table.voucher");
+ break;
+ case 3:
+ result = _("lima.table.account");
+ break;
+ case 4:
+ result = _("lima.table.description");
+ break;
+ case 5:
+ result = _("lima.table.position");
+ break;
+ case 6:
+ result = _("lima.table.debit");
+ break;
+ case 7:
+ result = _("lima.table.credit");
+ break;
+ case 8:
+ result = _("lima.table.balance");
+ break;
+ }
+
+ return result;
+ }
+
+ @Override
+ public int getRowCount() {
+ int result = 0;
+
+ // just prevent too much result
+ if (cacheDataList != null) {
+ result = cacheDataList.size();
+ }
+
+ return result;
+ }
+
+ @Override
+ public Object getValueAt(int row, int column) {
+ Object result = null;
+
+ // just prevent too much result
+ if (cacheDataList != null) {
+ result = cacheDataList.get(row);
+
+ if (result instanceof FinancialTransaction) {
+ FinancialTransaction currentRow = (FinancialTransaction)result;
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
+
+ switch (column) {
+ case 0:
+ result = currentRow.getTransactionDate();
+ break;
+ case 1:
+ if (currentRow.getEntryBook() != null){
+ result = currentRow.getEntryBook().getCode();
+ }
+ else {
+ result = null;
+ }
+ break;
+ case 2:
+ result = null; //entrybook
+ break;
+ case 3:
+ result = null; // account
+ break;
+ case 4:
+ result = null; // description
+ break;
+ case 5 :
+ result = null; // position
+ break;
+ case 6:
+ result = amountDebit;
+ break;
+ case 7:
+ result = amountCredit;
+ break;
+ case 8:
+ result = amountDebit.subtract(amountCredit);
+ break;
+ }
+ }
+ else if (result instanceof Entry) {
+ Entry currentEntry = (Entry)result;
+ switch (column) {
+ case 0:
+ result = null; // date
+ break;
+ case 1 : // entry book
+ result = null;
+ break;
+ case 2:
+ result = currentEntry.getVoucher();
+ break;
+ case 3: // account
+ if (currentEntry.getAccount() != null){
+ result = currentEntry.getAccount().getAccountNumber();
+ }
+ else {
+ result = null;
+ }
+ break;
+ case 4:
+ result = currentEntry.getDescription();
+ break;
+ case 5 :
+ result = currentEntry.getPosition();
+ break;
+ case 6:
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ break;
+ case 7:
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ break;
+ case 8:
+ result = null; // balance
+ break;
+ }
+
+ }
+ }
+
+ return result;
+ }
+
+ public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
+ selectedFiscalPeriod = fiscalPeriod;
+ }
+
+ /**
+ * To set cells editable or not
+ * different condition for entry or financial transaction
+ */
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ boolean editableCell=false;
+ Object currentRow = cacheDataList.get(rowIndex);
+ // cells editable for the entry row, all cells exclude the date
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ editableCell=true;
+ }
+ // cells editable for the financialtransaction row, no cells exclude the date
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
+ editableCell=true;
+ }
+ return editableCell;
+ }
+
+
+ /**
+ * @throws LimaException
+ */
+ public void addEmptyEntry(Object value, int row) throws LimaException {
+ FinancialTransaction currentTransaction = null;
+ Object currentRow = cacheDataList.get(row);
+ Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
+ //check if current row is a transaction or an entry
+ if (currentRow instanceof FinancialTransaction) {
+ currentTransaction = (FinancialTransaction)currentRow;
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ //get back the parent transaction of the entry
+ currentTransaction = currentEntry.getFinancialTransaction();
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ financialTransactionService.createEntry(entry);
+ //on recharge la liste
+ refresh();
+ }
+
+ /**
+ * to modifiy financialtransaction or entry
+ */
+ @Override
+ public void setValueAt(Object value, int row, int column) {
+ int financialTransactionRow=0;
+ // just prevent too much result
+ if (selectedFiscalPeriod != null) {
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentFinancialTransaction =
+ (FinancialTransaction)currentRow;
+ switch (column) {
+ case 0:
+ //update
+ currentFinancialTransaction.setTransactionDate((Date)value);
+ break;
+ case 1 :
+ currentFinancialTransaction.setEntryBook((EntryBook)value);
+ break;
+ }
+ // notify service for modification
+ try {
+ financialTransactionService.
+ updateFinancialTransaction(currentFinancialTransaction);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update financial transaction", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((FinancialTransaction) currentRow));
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ switch (column) {
+ case 2 :
+ currentEntry.setVoucher((String)value);
+ break;
+ case 3:
+ currentEntry.setAccount((Account)value);
+ break;
+ case 4:
+ currentEntry.setDescription((String)value);
+ break;
+ case 5 :
+ currentEntry.setPosition((String)value);
+ break;
+ case 6:
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(true);
+ break;
+ case 7:
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(false);
+ break;
+ }
+ try {
+ financialTransactionService.updateEntry(currentEntry);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update entry", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //on recharge la liste
+ //TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
+ fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
+ }
+ }
+
+ public Object getElementAt(int row){
+
+ Object currentRow = cacheDataList.get(row);
+ return currentRow;
+ }
+
+
+ /**
+ * Delete selected row in table (could be transaction or entry).
+ *
+ * Called by model.
+ * @param Object, int
+ * @throws LimaException
+ */
+ public void removeObject(Object object, int row) throws LimaException {
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentTransaction =
+ (FinancialTransaction)currentRow;
+ financialTransactionService.removeFinancialTransaction(currentTransaction);
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ financialTransactionService.removeEntry(currentEntry);
+ }
+ //on recharge la liste
+ refresh();
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,87 @@
+<!-- ##% Lima Swing
+ Copyright (C) 2008 - 2010 CodeLutin
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ##% -->
+
+<Table>
+ <FinancialTransactionSearchViewHandler id="handler" javaBean="new FinancialTransactionSearchViewHandler(this)" />
+ <Boolean id="selectedRow" javaBean="false" />
+ <script>
+ <![CDATA[
+ import org.chorem.lima.enums.ComboBoxPeriodEnum;
+ import org.chorem.lima.enums.ComboBoxAccountsEnum;
+ import org.chorem.lima.enums.ComboBoxAmountEnum;
+ import org.chorem.lima.enums.ComboBoxOperatorsEnum;
+
+ AccountSearchPanel accountSearchPanel = new AccountSearchPanel(handler);
+ PeriodSearchPanel periodSearchPanel = new PeriodSearchPanel(handler);
+
+ void $afterCompleteSetup() {
+ }
+
+ ]]>
+ </script>
+
+ <row>
+ <cell><Table><row>
+ <cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxPeriodEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxPeriodEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><PeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JLabel text="lima.table.voucher"/></cell>
+ <cell><JTextField id='voucher'/></cell>
+ <cell><JLabel text="lima.table.description"/></cell>
+ <cell><JTextField id='description'/></cell>
+ <cell><JLabel text="lima.table.letter"/></cell>
+ <cell><JTextField id='letter'/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JComboBox id="accountComboBox" javaBean="new JComboBox(ComboBoxAccountsEnum.descriptions())"
+ onActionPerformed="accountSearchPanel.refresh(ComboBoxAccountsEnum.valueOfDescription((String) accountComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><AccountSearchPanel javaBean="accountSearchPanel"/></cell>
+ <cell anchor='east'><JLabel text="lima.table.entrybook"/></cell>
+ <cell anchor='west'><EntryBookSearchComboBox javaBean="new EntryBookSearchComboBox(handler)"/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JLabel text="lima.amount"/></cell>
+ <cell><JComboBox id="amountComboBox" javaBean="new JComboBox(ComboBoxAmountEnum.descriptions())"/></cell>
+ <cell><JComboBox id="operatorComboBox" javaBean="new JComboBox(ComboBoxOperatorsEnum.descriptions())"/></cell>
+ <cell><JTextField id='amount'/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1" weighty="1">
+ <JScrollPane>
+ <org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchTableModel
+ id="financialTransactionSearchTableModel" />
+ <org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchTable
+ id="financialTransactionSearchTable" sortable="false" rowHeight="22"
+ constructorParams="getHandler()" model="{getFinancialTransactionSearchTableModel()}"
+ selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
+ <javax.swing.ListSelectionModel javaBean="getFinancialTransactionSearchTable().getSelectionModel()"
+ onValueChanged="setSelectedRow(financialTransactionSearchTable.getSelectedRow() != -1)"/>
+ </JScrollPane>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import static org.nuiton.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+
+/**
+ * Handler associated with financial transaction view.
+ *
+ * @author chatellier
+ * @version $Revision: 2901 $
+ *
+ * Last update : $Date: 2010-05-19 12:52:43 +0200 (mer. 19 mai 2010) $
+ * By : $Author: jpepin $
+ */
+public class FinancialTransactionSearchViewHandler {
+
+ /** log. */
+ private static final Log log =
+ LogFactory.getLog(FinancialTransactionSearchViewHandler.class);
+
+ protected FinancialTransactionSearchView view;
+
+ protected FinancialTransactionSearchTable table;
+
+ protected FinancialTransactionSearchTableModel tableModel;
+
+ protected FiscalPeriodComboBoxModel comboBoxModel;
+
+
+ protected FinancialTransactionSearchViewHandler(FinancialTransactionSearchView view) {
+ this.view = view;
+
+ }
+
+ public void refresh(){
+ tableModel = view.getFinancialTransactionSearchTableModel();
+ tableModel.refresh();
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,111 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.enums.ComboBoxPeriodEnum;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer;
+import org.jdesktop.swingx.JXDatePicker;
+
+public class PeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(PeriodSearchPanel.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public PeriodSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxPeriodEnum.DATE);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxPeriodEnum comboBoxPeriodEnum){
+
+ switch (comboBoxPeriodEnum) {
+ case DATE:
+ Calendar calendar = Calendar.getInstance();
+ Date date = calendar.getTime();
+ date = DateUtils.truncate(date, Calendar.DATE);
+ JXDatePicker datePicker = new JXDatePicker(date);
+ this.removeAll();
+ this.add(datePicker);
+ break;
+
+ case PERIOD:
+ // get begin date
+ Calendar calendarBegin = Calendar.getInstance();
+ // set begindate to JAN 1 - 0:00.000 of this years
+ Date beginDate = calendarBegin.getTime();
+ beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
+ //handler().setBeginDate(beginDate);
+
+ // get end date
+ Calendar calendarEnd = Calendar.getInstance();
+ Date endDate = calendarEnd.getTime();
+ //handler().setEndDate(endDate);
+ JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ this.removeAll();
+ this.add(beginDateLabel);
+ this.add(beginDatePicker);
+ this.add(endDateLabel);
+ this.add(endDatePicker);
+ break;
+
+ case FISCAL_PERIOD:
+ FiscalPeriodComboBoxModel fiscalModel = new FiscalPeriodComboBoxModel();
+ FiscalPeriodComboBoxRenderer fiscalRenderer = new FiscalPeriodComboBoxRenderer();
+ JComboBox fiscalPeriod = new JComboBox(fiscalModel);
+ fiscalPeriod.setRenderer(fiscalRenderer);
+ fiscalPeriod.setEditable(false);
+ //fiscalPeriod.actionPerformed(handler.);
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ FinancialPeriodComboBoxRenderer financialRenderer = new FinancialPeriodComboBoxRenderer();
+ JComboBox financialPeriod = new JComboBox(financialModel);
+ financialPeriod.setRenderer(financialRenderer);
+ financialPeriod.setEditable(false);
+ this.removeAll();
+ this.add(financialPeriod);
+ break;
+ }
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -20,12 +20,10 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
-
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.FiscalPeriodServiceMonitorable;
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-18 14:47:44 UTC (rev 3006)
@@ -79,6 +79,7 @@
lima.entries=Entries
lima.entries.addtransaction=
lima.entries.lettering=
+lima.entries.searchtransaction=
lima.entries.searchunbalancedtransaction=
lima.entrybook=Entry Book
lima.entrybook.add=Add Entry Book
@@ -90,6 +91,18 @@
lima.entrybook.type3=
lima.entrybook.type4=
lima.entrybook.type5=
+lima.enum.comboboxaccount.account=
+lima.enum.comboboxaccount.accountlist=
+lima.enum.comboboxamount.both=
+lima.enum.comboboxamount.credit=
+lima.enum.comboboxamount.debit=
+lima.enum.comboboxoperator.equal=
+lima.enum.comboboxoperator.inferior=
+lima.enum.comboboxoperator.superior=
+lima.enum.comboboxperiod.date=
+lima.enum.comboboxperiod.financialperiod=
+lima.enum.comboboxperiod.fiscalperiod=
+lima.enum.comboboxperiod.period=
lima.error=Error
lima.error.errorpane.htmlmessage=<html><body><b>An application error happened</b>\:<br/>%s</body></html>
lima.error.errorpane.title=Lima error
@@ -218,6 +231,7 @@
lima.table.fiscalperiod=
lima.table.grossamount=
lima.table.label=
+lima.table.letter=
lima.table.move.credit=
lima.table.move.debit=
lima.table.netamount=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-18 14:47:44 UTC (rev 3006)
@@ -74,6 +74,7 @@
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
+lima.entries.searchtransaction=Rechercher des \u00E9critures
lima.entries.searchunbalancedtransaction=Entr\u00E9es incorrect
lima.entrybook=Journal
lima.entrybook.add=Ajouter un journal
@@ -85,6 +86,18 @@
lima.entrybook.type3=Tr\u00E9sorerie
lima.entrybook.type4=G\u00E9n\u00E9ral
lima.entrybook.type5=Situation
+lima.enum.comboboxaccount.account=Compte
+lima.enum.comboboxaccount.accountlist=Liste de compte
+lima.enum.comboboxamount.both=Les deux
+lima.enum.comboboxamount.credit=Cr\u00E9dit
+lima.enum.comboboxamount.debit=D\u00E9bit
+lima.enum.comboboxoperator.equal=\u00C9gal
+lima.enum.comboboxoperator.inferior=Inf\u00E9rieur
+lima.enum.comboboxoperator.superior=Sup\u00E9rieur
+lima.enum.comboboxperiod.date=Date
+lima.enum.comboboxperiod.financialperiod=P\u00E9riode Financi\u00E8re
+lima.enum.comboboxperiod.fiscalperiod=Exercice
+lima.enum.comboboxperiod.period=P\u00E9riode
lima.error=Erreur
lima.error.errorpane.htmlmessage=<html><body><b>Une erreur s'est produite</b>\:<br/>%s</body></html>
lima.error.errorpane.title=Lima erreur
@@ -205,6 +218,7 @@
lima.table.fiscalperiod=Exercice
lima.table.grossamount=Brut
lima.table.label=Libell\u00E9
+lima.table.letter=Lettre
lima.table.move.credit=Mouvement au cr\u00E9dit
lima.table.move.debit=Mouvement au d\u00E9bit
lima.table.netamount=Net
1
0
Author: jpepin
Date: 2010-08-17 17:34:26 +0200 (Tue, 17 Aug 2010)
New Revision: 3005
Url: http://chorem.org/repositories/revision/lima/3005
Log:
D?\195?\169bogue g?\195?\169n?\195?\169ration bilan - CR.
Plans comptable et BCR d?\195?\169finitifs.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
trunk/lima-swing/src/main/resources/import/bcr_base.csv
trunk/lima-swing/src/main/resources/import/bcr_developed.csv
trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
trunk/lima-swing/src/main/resources/import/pcg_base.csv
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -506,44 +506,16 @@
else {
TopiaQuery query = accountDAO.createQuery();
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ //String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
//.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
List<Account> accountsResult = accountDAO.findAllByQuery(query);
if (accountsResult != null){
accounts.addAll(accountsResult);
}
}
}
- /*for (String accountNumber : accountNumbers) {
- if (subAccountsMode){
- Account account = accountDAO.findSubAccountByNumber(accountNumber);
- if (account == null){
- TopiaQuery query = accountDAO.createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- //.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
- List<Account> accountsResult = accountDAO.findAllByQuery(query);
- if (accountsResult != null){
- accounts.addAll(accountsResult);
- }
- }
- //add account if exist
- else {
- accounts.add(account);
- }
- }
- else {
- Account account = accountDAO.findByAccountNumber(accountNumber);
- if (account != null){
- accounts.add(account);
- }
- }
-
- }*/
//remove all accounts
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -20,10 +20,8 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
-
import java.math.BigDecimal;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.StringTokenizer;
@@ -46,7 +44,6 @@
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
-import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.FinancialStatement;
@@ -476,13 +473,12 @@
for (Account account : accountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
+ generateAccountReportsWithTransaction(account, true,
selectedBeginDate, selectedEndDate, topiaContext);
BigDecimal tempAmount = new BigDecimal(0);
-
//check the way of financialstatement amount
//exemple compte de résultat : charge -> débit, produit -> crédit
- switch (financialStatementWayEnum) {
+ switch (financialStatementWayEnum) {
case BOTH:
tempAmount = tempAmount.add(reportsDatas.getAmountSolde());
break;
@@ -495,8 +491,8 @@
tempAmount = tempAmount.subtract(reportsDatas.getAmountDebit());
break;
}
-
- //add the calcul in function of list type: allaccounts, debit or credit
+
+ //add the calcul in function of list type: allaccounts, debit or credit
switch (debitCredit) {
case BOTH:
resAmount = resAmount.add(tempAmount);
@@ -512,6 +508,7 @@
}
break;
}
+
}
if (amount.doubleValue() == 0){
amount = resAmount;
@@ -531,7 +528,7 @@
@Override
public String checkFinancialStatementChart() throws LimaException {
- String result ="";
+ String result =_("lima-business.financialstatement.check.warn");
TopiaContext transaction = null;
try {
transaction = beginTransaction();
@@ -567,7 +564,8 @@
for (Account account : accountsList) {
- result += "NOT FOUND : "+account.getAccountNumber()+"\n";
+ result += _("lima-business.financialstatement.check.nothing")
+ + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n";
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -417,11 +417,17 @@
FinancialTransaction financialTransaction =
entry.getFinancialTransaction();
- BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ if (amountDebit == null){
+ amountDebit = new BigDecimal(0);
+ }
amountDebit = amountDebit.add(entryDebit);
financialTransaction.setAmountDebit(amountDebit);
BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ if (amountCredit == null){
+ amountCredit = new BigDecimal(0);
+ }
amountCredit = amountCredit.add(entryCredit);
financialTransaction.setAmountCredit(amountCredit);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -193,7 +193,6 @@
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
List<EntryEBPImpl> list = csv.parse(strat, csvReader);
Collections.sort(list, new EntryEBPComparator());
- log.debug(list.size()+" list /n"+list);
// DAOs
AccountDAO accountDAO = LimaCallaoDAOHelper
@@ -240,9 +239,7 @@
else {
entry.setAccount(account);
BigDecimal debit = new BigDecimal(entryEBP.getDebit());
- log.debug(debit);
BigDecimal credit = new BigDecimal(entryEBP.getCredit());
- log.debug(credit);
if (debit.doubleValue() == 0) {
entry.setDebit(false);
entry.setAmount(credit);
@@ -870,7 +867,6 @@
for (Iterator<FinancialStatementImport> itr2 = financialStatementImports.iterator(); itr2.hasNext();) {
FinancialStatementImport financialStatementImport =
itr2.next();
- log.debug(financialStatementImport.getLabel());
String masterFinancialStatementLabel = financialStatementImport
.getMasterFinancialStatement();
FinancialStatement masterFinancialStatement = financialStatementDAO
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -72,7 +72,7 @@
}
@Override
- public ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException {
+ public ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate) throws LimaException {
ReportsDatas reportsDatas = null;
TopiaContext topiaTransaction = null;
@@ -80,7 +80,7 @@
topiaTransaction = beginTransaction();
reportsDatas =
- generateAccountReportsWithTransaction(account, beginDate,
+ generateAccountReportsWithTransaction(account, thirdPartAccountsMode, beginDate,
endDate, topiaTransaction);
}
catch (TopiaException ex) {
@@ -103,7 +103,7 @@
* - for a foldthirdparts accounts
*/
@Override
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
+ public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
ReportsDatas reportsDatas = new ReportsDatasImpl();
BigDecimal credit = new BigDecimal(0);
BigDecimal debit = new BigDecimal(0);
@@ -113,25 +113,29 @@
//Get allsubaccounts and thirdParts accounts
List<Account> accounts = (List<Account>) account.getSubAccounts();
- List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
- if (thirdPartAccount != null){
- ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
- beginDate, endDate, topiaContext);
- entries.addAll(subReportsDatas.getListEntry());
- debit = debit.add(subReportsDatas.getAmountDebit());
- credit = credit.add(subReportsDatas.getAmountCredit());
- accounts.addAll(thirdPartAccount);
+ if (thirdPartAccountsMode){
+ List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
+ if (thirdPartAccount != null){
+ ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
+ beginDate, endDate, topiaContext);
+
+ entries.addAll(subReportsDatas.getListEntry());
+ debit = debit.add(subReportsDatas.getAmountDebit());
+ credit = credit.add(subReportsDatas.getAmountCredit());
+ accounts.addAll(thirdPartAccount);
+ }
}
+
// is already subaccount
if (accounts.size() == 0){
reportsDatas = generateSubAccountReportsWithTransaction(account,
beginDate, endDate, topiaContext);
}
- // else is folder accounts contains many subs and thirds accoutns
+ // else is folder accounts contains many subs and thirds accounts
else {
for (Account subAccount : accounts) {
ReportsDatas subReportsDatas =
- generateAccountReportsWithTransaction(subAccount,
+ generateAccountReportsWithTransaction(subAccount, true,
beginDate,endDate, topiaContext);
debit = debit.add(subReportsDatas.getAmountDebit());
credit = credit.add(subReportsDatas.getAmountCredit());
@@ -266,7 +270,6 @@
List<Object[]> results = new ArrayList<Object[]>();
String queryAlias = "E";
if (beginDate != null && endDate != null){
- log.debug("solde 0 : "+solde);
try {
EntryDAO entryDAO= LimaCallaoDAOHelper.getEntryDAO(topiaContext);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -74,7 +74,7 @@
/**
* Generation du rapports des comptes
*/
- ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException;
+ ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate) throws LimaException;
/**
* Generation du rapports des journaux
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -46,6 +46,6 @@
@Local
public interface ReportServiceLocal extends ReportService {
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
+ public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -40,6 +40,8 @@
lima-business.document.soldedebit=
lima-business.document.vatnumber=
lima-business.document.voucher=Voucher
+lima-business.financialstatement.check.nothing=
+lima-business.financialstatement.check.warn=
lima.business.document.date=Date
lima.config.configFileName.description=
lima.config.http-port=
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -37,6 +37,8 @@
lima-business.document.soldedebit=Solde D\u00E9biteur
lima-business.document.vatnumber=N\u00B0 TVA
lima-business.document.voucher=Pi\u00E8ce comptable
+lima-business.financialstatement.check.nothing=Introuvable
+lima-business.financialstatement.check.warn=Attention cette fonctionnalit\u00E9 n'est qu'une aide utilisateur.\n Certains comptes ne doivent pas \u00EAtre pr\u00E9sent au bilan et compte de r\u00E9sultat.\n Il est donc normal que des comptes sont marqu\u00E9s comme introuvable.\n\n
lima.config.configFileName.description=
lima.config.http-port=
lima.config.httpport=
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -96,7 +96,7 @@
//avoid unnecessary call to service
if (selectedAccount != null){
try {
- results = reportService.generateAccountsReports(selectedAccount,
+ results = reportService.generateAccountsReports(selectedAccount, true,
selectedBeginDate, selectedEndDate);
}
catch (LimaException eee) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-17 15:34:26 UTC (rev 3005)
@@ -72,7 +72,7 @@
</row>
<row>
<cell fill="horizontal">
- <JButton id="checkButton" text="lima.financialstament.check"
+ <JButton id="checkButton" text="lima.financialstatement.check"
onActionPerformed="getHandler().financialStatementChartCheck()"/>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -20,8 +20,12 @@
import java.awt.Color;
import java.awt.Component;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
import java.math.BigDecimal;
import java.util.Date;
@@ -44,8 +48,7 @@
/**
* Table des transaction qui ajoute des comportement (keys).
*
- * @author ore
- * @author Rémi Chapelet
+ * @author jpepin
*/
public class FinancialTransactionTable extends JXTable implements KeyListener {
@@ -242,4 +245,5 @@
public void keyReleased(KeyEvent e) {
}
+
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -93,9 +93,8 @@
lima.export.all=Exporter toutes les donn\u00E9es (XML)
lima.export.all.csv=Exporter toutes les donn\u00E9es (CSV)
lima.financialperiod.block=Cloturer une p\u00E9riode
-lima.financialstament.check=
lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit
-lima.financialstatement.check=
+lima.financialstatement.check=V\u00E9rification des comptes aux postes
lima.financialstatement.credit=Sens du poste \: d\u00E9bit
lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit
lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit
Modified: trunk/lima-swing/src/main/resources/import/bcr_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_base.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_base.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,134 +1,134 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
-"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
-"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
-"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
-"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
-"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
-"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
-"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
-"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
-"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
-"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
-"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
-"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
-"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
-"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
-"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
-"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
-"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
-"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Créances Clients et Comptes rattachés";"false";"411, 413, 416, 418";;;"491";"false";"false";"Créances"
-"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 441, 4452, 4456, 44581, 44582, 44583, 44586, 4487, 462, 465, 467, 4687";"443, 444, 451, 455, 456, 458 -4562";"";"";"false";"false";"Créances"
-"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
-"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
-"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
-"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
-"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Dettes Fournisseurs et Comptes rattachés";"false";"401, 403, 4081, 4088";;;;"false";"false";"DETTES"
-"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 43, 442, 4455, 4457, 44584, 44587, 446, 447, 4482, 4486, 457 -4387";"";"443, 444";;"false";"false";"DETTES"
-"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084, 4088";;;;"false";"false";"DETTES"
-"FNST";"Autres dettes";"false";"4196, 4197, 4198, 464, 4686, 509";"";"467, 478";;"false";"false";"DETTES"
-"FNST";"Instruments de trésorerie";"false";;"";"52";;"false";"false";"DETTES"
-"FNST";"Produits constatés d'avance";"false";"487";;;;"false";"false";"DETTES"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF";""
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital (dont versé?)";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607, 6097";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles";""
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles";""
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières";""
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières";""
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières";""
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières";""
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières";""
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours";""
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours";""
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Disponibilités";"false";"53, 54";"51 -5181 -519";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES";""
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 608, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Variation des stock d'approv.";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Production vendue (B&S)";"false";"70 -707 -708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires";""
+"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires";""
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Créances Clients et Comptes rattachés";"false";"410, 411, 413, 416, 418";"";"";"491";"false";"false";"Créances";""
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances";""
+"FNST";"Dettes Fournisseurs et Comptes rattachés";"false";"400, 401, 403, 4081, 4088";"";"";"";"false";"false";"DETTES";""
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 43, 442, 4455, 4457, 44584, 44587, 446, 447, 4482, 4486, 457 -4387";"";"443, 444";"";"false";"false";"DETTES";""
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084, 4088";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres dettes";"false";"4196, 4197, 4198, 464, 4686, 509";"";"467, 478";"";"false";"false";"DETTES";""
+"FNST";"Instruments de trésorerie";"false";"";"";"52";"";"false";"false";"DETTES";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 441, 4452, 4456, 44581, 44582, 44583, 44586, 4487, 462, 465, 467, 4687";"443, 444, 451, 455, 456, 458 -4562";"";"495, 496";"false";"false";"Créances";""
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières";""
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles";""
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles";""
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels";""
Modified: trunk/lima-swing/src/main/resources/import/bcr_developed.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_developed.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_developed.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,138 +1,159 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
-"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
-"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
-"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
-"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
-"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
-"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
-"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
-"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
-"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
-"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
-"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
-"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
-"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
-"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
-"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
-"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
-"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
-"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Créance d'exploitation";"true";"";"";"";"";"false";"false";"Créances"
-"FNST";"Créances clients et Comptes rattachés";"false";"411, 413, 416, 418";"";"";"491";"false";"false";"Créance d'exploitation"
-"FNST";"Créances diverses";"false";"4411, 4418, 4487, 4456, 462, 465, 4687";"443, 444, 451, 456, 458, 467 -4562";"";"";"false";"false";"Créances"
-"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
-"FNST";"Dettes d'exploitation";"true";"";"";"";"";"false";"false";"DETTES"
-"FNST";"Dettes fournisseurs et comptes rattachés";"false";"401, 403, 4081";"";"";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 431, 437, 4386, 4455, 446, 447, 4486";"";"4458";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Dettes diverses";"true";"";"";"";"";"false";"false";"DETTES"
-"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084";"";"";"";"false";"false";"Dettes diverses"
-"FNST";"Dettes fiscales (impôts sur les bénéfices)";"false";"";"";"444";"";"false";"false";"Dettes diverses"
-"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
-"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
-"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 4417, 4456, 4487";"4458";"";"495, 496";"false";"false";"Créance d'exploitation"
-"FNST";"Autres";"false";"4196, 4197, 4198, 4419";"";"";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Autres";"false";"424, 426, 4284, 4419, 442, 4486, 457, 464, 467, 4686, 509";"";"443, 451, 455, 456, 458";"";"false";"false";"Dettes diverses"
-"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
-"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF";""
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital (dont versé?)";"false";"101, 108, 1013";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607, 6087, 6097";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles";""
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles";""
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières";""
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières";""
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières";""
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières";""
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières";""
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours";""
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours";""
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES";""
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 6081, 6091";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Variation des stock";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Production vendue";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Ventes";"false";"701, 702, 703, 707, 708, 7091, 7092, 7097, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Travaux";"false";"704, 708, 7094, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Créance d'exploitation";"true";"";"";"";"";"false";"false";"Créances";"BOTH"
+"FNST";"Créances clients et Comptes rattachés";"false";"410, 411, 413, 416, 418";"";"";"491";"false";"false";"Créance d'exploitation";""
+"FNST";"Créances diverses";"false";"4411, 4418, 462, 465, 4687";"443, 444, 451, 456, 458, 467 -4562";"";"";"false";"false";"Créances";""
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances";""
+"FNST";"Dettes d'exploitation";"true";"";"";"";"";"false";"false";"DETTES";"BOTH"
+"FNST";"Dettes fournisseurs et comptes rattachés";"false";"400, 401, 403, 4081, 4088";"";"";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 431, 437, 4386, 4455, 4457, 446, 447, 4486";"";"4458";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Dettes diverses";"true";"";"";"";"";"false";"false";"DETTES";"BOTH"
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084";"";"";"";"false";"false";"Dettes diverses";""
+"FNST";"Dettes fiscales (impôts sur les bénéfices)";"false";"";"";"444";"";"false";"false";"Dettes diverses";""
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Prestation de services";"false";"705, 706, 708, 7095, 7096, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Production stockée";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"En-cours de production de biens";"false";"7133";"";"";"";"false";"false";"Production stockée";""
+"FNST";"En-cours de production de services";"false";"7134";"";"";"";"false";"false";"Production stockée";""
+"FNST";"Produits";"false";"7135";"";"";"";"false";"false";"Production stockée";""
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"Reprises sur provisions (et amortissements)";"false";"781";"";"";"";"false";"false";"Reprises sur provisions (et amortissements), transferts de charges";""
+"FNST";"Transferts de charges";"false";"791";"";"";"";"false";"false";"Reprises sur provisions (et amortissements), transferts de charges";""
+"FNST";"Production exceptionnels sur opérations en capital";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"Produits des cessions d'éléments d'actif";"false";"775";"";"";"";"false";"false";"Production exceptionnels sur opérations en capital";""
+"FNST";"Subvention d'investissement virées au résultat de l'exercice";"false";"778";"";"";"";"false";"false";"Production exceptionnels sur opérations en capital";""
+"FNST";"Autres approvisionnements";"false";"602, 6082, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Autres charges et charges externes";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de sous-traitance";"false";"604, 6084, 6094, 6095";"";"";"";"false";"false";"Autres charges et charges externes";""
+"FNST";"Achats non stockés de matières et fournitures";"false";"605, 606, 6085, 6086, 6096";"";"";"";"false";"false";"Autres charges et charges externes";""
+"FNST";"Services extérieurs";"true";"";"";"";"";"false";"true";"Autres charges et charges externes";"DEBIT"
+"FNST";"Personnel extérieur";"false";"621";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Loyers en crédit-bail mobilier";"false";"6122";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Loyers en crédit-bail immobilier";"false";"";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Impôts, taxes et versements assimilés";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"sur rémunérations";"false";"631, 633";"";"";"";"false";"false";"Impôts, taxes et versements assimilés";""
+"FNST";"autres";"false";"635, 637";"";"";"";"false";"false";"Impôts, taxes et versements assimilés";""
+"FNST";"sur opération en capital";"true";"";"";"";"";"false";"true";"Charges exceptionnelles";"DEBIT"
+"FNST";"valeurs comptables des éléments immobiliers et financiers cédés";"false";"675";"";"";"";"false";"false";"sur opération en capital";""
+"FNST";"Dotations aux amortissements et aux provisions";"true";"";"";"";"";"false";"true";"Charges exceptionnelles";"DEBIT"
+"FNST";"Dotations aux provisions réglementées";"false";"6872, 6873, 6874";"";"";"";"false";"false";"Dotations aux amortissements et aux provisions";""
+"FNST";"dotations aux amortissements et aux provisions";"false";"6871, 6875, 6876";"";"";"";"false";"false";"Dotations aux amortissements et aux provisions";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières";""
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles";""
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 4417, 4452, 4456, 4487";"4458";"";"495, 496";"false";"false";"Créance d'exploitation";""
+"FNST";"Autres";"false";"4196, 4197, 4198, 4419";"";"";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Autres";"false";"424, 426, 4284, 4419, 442, 4486, 457, 464, 467, 4686, 509";"";"443, 451, 455, 456, 458";"";"false";"false";"Dettes diverses";""
+"FNST";"Autres";"false";"61, 62 -6122 -6125 -621";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles";""
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"autres";"false";"678";"";"";"";"false";"false";"sur opération en capital";""
Modified: trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_shortened.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_shortened.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,68 +1,68 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"CHARGES D'EXPLOITATION ET FINANCIERES";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"201, 208";"";"";"280, 290";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"31, 32, 33, 34, 35";"";"";"391, 393, 394, 395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"409";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"110";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"145, 146, 147, 148";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions pour risques et charges";"false";"15";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts et dettes assimilées";"false";"16";"";"";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"419";"";"";"";"false";"false";"DETTES"
-"FNST";"Immobilisations corporelles";"false";"21, 23";"";"";"281, 291";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Immobilisations financières";"false";"27";"";"";"297";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Clients et comptes rattachés";"false";"410";"";"";"491";"false";"false";"Créances"
-"FNST";"Valeurs mobilières de placement";"false";"50";"";"";"590";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Disponibilités (autres que caisse)";"false";"54, 58";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Caisse";"false";"53";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Fournisseurs et comptes rattachés";"false";"400";"";"";"";"false";"false";"DETTES"
-"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Charges exceptionnelles";"false";"67, 687, 691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697";"";"";"";"false";"false";"CHARGES"
-"FNST";"PRODUITS D'EXPLOITATION ET FINANCIERS";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
-"FNST";"Produits financiers";"false";"76, 786, 79";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
-"FNST";"Ventes de marchandises";"false";"707, 709";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production vendue (bien et services)";"false";"701, 706, 708, 709";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Autres produits";"false";"75, 781, 79";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Produits exceptionnels";"false";"77, 787, 79";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Charges d'exploitation";"true";"";"";"";"";"true";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"Charges d'exploitation"
-"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Coût d'achats des approvisionnements";"true";"";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Achats d'approvisionnements";"false";"60 -607";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
-"FNST";"Variation des stock (approvisionnements)";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
-"FNST";"Autres charges externes";"false";"61, 62";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Rémunération du personnel";"false";"641, 644";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Charges sociales";"false";"645, 646";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Dotations aux amortissements";"false";"6811";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Dotations aux provisions";"false";"6815, 6816, 6817";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Autres charges";"false";"65";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Charges financières";"false";"66, 686";"";"";"";"false";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
-"FNST";"Autres";"false";"1063, 1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"409, 428, 46";"43, 444, 445, 455";"";"496";"false";"false";"Créances"
-"FNST";"Autres";"false";"419, 421, 428, 447, 46";"";"43, 444, 445, 455";"";"false";"false";"DETTES"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"CHARGES D'EXPLOITATION ET FINANCIERES";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"201, 208";"";"";"280, 290";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"31, 32, 33, 34, 35";"";"";"391, 393, 394, 395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"409";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"145, 146, 147, 148";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions pour risques et charges";"false";"15";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts et dettes assimilées";"false";"16";"";"";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"419";"";"";"";"false";"false";"DETTES";""
+"FNST";"Immobilisations corporelles";"false";"21, 23";"";"";"281, 291";"false";"false";"ACTIF IMMOBILISÉ";""
+"FNST";"Immobilisations financières";"false";"27";"";"";"297";"false";"false";"ACTIF IMMOBILISÉ";""
+"FNST";"Clients et comptes rattachés";"false";"41 - 419";"";"";"491";"false";"false";"Créances";""
+"FNST";"Valeurs mobilières de placement";"false";"50";"";"";"590";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Disponibilités (autres que caisse)";"false";"54, 58";"51";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Caisse";"false";"53";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Fournisseurs et comptes rattachés";"false";"40";"";"";"";"false";"false";"DETTES";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Charges exceptionnelles";"false";"67, 687, 691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697";"";"";"";"false";"false";"CHARGES";""
+"FNST";"PRODUITS D'EXPLOITATION ET FINANCIERS";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS";"CREDIT"
+"FNST";"Produits financiers";"false";"76, 786, 79";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS";""
+"FNST";"Ventes de marchandises";"false";"707, 709";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production vendue (bien et services)";"false";"701, 706, 708, 709";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production immobilisée";"false";"72";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Autres produits";"false";"75, 781, 79";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Produits exceptionnels";"false";"77, 787, 79";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Charges d'exploitation";"true";"";"";"";"";"true";"false";"CHARGES D'EXPLOITATION ET FINANCIERES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"Charges d'exploitation";"DEBIT"
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Coût d'achats des approvisionnements";"true";"";"";"";"";"false";"false";"Charges d'exploitation";"DEBIT"
+"FNST";"Achats d'approvisionnements";"false";"60 -603 -607";"";"";"";"false";"false";"Coût d'achats des approvisionnements";""
+"FNST";"Variation des stock (approvisionnements)";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats des approvisionnements";""
+"FNST";"Autres charges externes";"false";"61, 62";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Rémunération du personnel";"false";"641, 644";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Charges sociales";"false";"645, 646";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Dotations aux amortissements";"false";"6811";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Dotations aux provisions";"false";"6815, 6816, 6817";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Autres charges";"false";"65";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Charges financières";"false";"66, 686";"";"";"";"false";"false";"CHARGES D'EXPLOITATION ET FINANCIERES";""
+"FNST";"Autres";"false";"1063, 1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"409, 428, 46";"43, 444, 445, 455";"";"496";"false";"false";"Créances";""
+"FNST";"Autres";"false";"419, 421, 428, 447, 46";"";"43, 444, 445";"";"false";"false";"DETTES";""
Modified: trunk/lima-swing/src/main/resources/import/pcg_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/pcg_base.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/pcg_base.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -44,8 +44,6 @@
"ACCN";"164";"Emprunts auprès des établissements de crédit";"";"16";""
"ACCN";"165";"Dépôts et cautionnements reçus";"";"16";""
"ACCN";"166";"Participation des salariés aux résultats";"";"16";""
-"ACCN";"167";"Emprunts et dettes assortis de conditions particulières";"";"16";""
-"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
"ACCN";"16";"EMPRUNTS ET DETTES ASSIMILEES";"";"1";""
"ACCN";"169";"Primes de remboursement des obligations";"";"16";""
"ACCN";"171";"Dettes rattachées à des participations (groupe)";"";"17";""
@@ -53,11 +51,6 @@
"ACCN";"17";"DETTES RATTACHÉES À DES PARTICIPATIONS";"";"1";""
"ACCN";"178";"Dettes rattachées à des sociétés en participation";"";"17";""
"ACCN";"1";"COMPTES DE CAPITAUX";"";"";""
-"ACCN";"181";"Compte de liaison des établissements";"";"18";""
-"ACCN";"186";"Bien et prestations de services échangés entre établissements (charges)";"";"18";""
-"ACCN";"187";"Bien et prestations de services échangés entre établissements (produits)";"";"18";""
-"ACCN";"18";"COMPTES DE LIAISON DES ÉTABLISSEMENTS ET DES SOCIÉTÉS EN PARTICIPATION";"";"1";""
-"ACCN";"188";"Comptes de liaison des sociétés en participation";"";"18";""
"ACCN";"201";"Frais détablissement";"";"20";""
"ACCN";"203";"Frais de recherche et de développement";"";"20";""
"ACCN";"205";"Concessions et droits similaires";"";"20";""
@@ -72,13 +65,11 @@
"ACCN";"215";"Installations techniques; matériel et outillage industriels";"";"21";""
"ACCN";"21";"IMMOBlLlSATIONS CORPORELLES";"";"2";""
"ACCN";"218";"Autres immobilisations corporelles";"";"21";""
-"ACCN";"22";"IMMOBILISATIONS MISES EN CONCESSION";"";"2";""
"ACCN";"231";"Immobilisations corporelles en cours";"";"23";""
"ACCN";"232";"Immobilisations incorporelles en cours";"";"23";""
"ACCN";"237";"Avances et acomptes versés sur immobilisations incorporelles";"";"23";""
"ACCN";"23";"IMMOBILlSATlONS EN COURS";"";"2";""
"ACCN";"238";"Avances et acomptes versés sur immobilisations corporelles";"";"23";""
-"ACCN";"25";"ENTREPRISES LIÉES - PARTS ET CRÉANCES";"";"2";""
"ACCN";"261";"Titres de participation";"";"26";""
"ACCN";"266";"Autres formes de participation";"";"26";""
"ACCN";"267";"Créances rattachées à des participations";"";"26";""
@@ -90,20 +81,11 @@
"ACCN";"273";"Titres immobilisés de l'activité portefeuille";"";"27";""
"ACCN";"274";"Prêts";"";"27";""
"ACCN";"275";"Dépôts et cautionnements versés";"";"27";""
-"ACCN";"276";"Autres créances immobilisées";"";"27";""
-"ACCN";"277";"Actions propres ou parts propres";"";"27";""
"ACCN";"27";"AUTRES IMMOBILISATIONS FINANCIERES";"";"2";""
"ACCN";"279";"Versements restant à effectuer sur titres immobilisés non libérés";"";"27";""
-"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
"ACCN";"28";"AMORTISSEMENTS DES IMMOBILISATIONS";"";"2";""
-"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
"ACCN";"2";"COMPTES D'IMMOBILISATIONS";"";"";""
-"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
-"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
-"ACCN";"293";"Dépréciations des immobilisations en cours";"";"29";""
-"ACCN";"296";" Dépréciations des participations et créances rattachées à des participations";"";"29";""
"ACCN";"29";"PROVISIONS POUR DEPRECIATION DES IMMOBILISATIONS";"";"2";""
-"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
"ACCN";"311";"Matière (ou groupe) A";"";"31";""
"ACCN";"312";"Matières (ou groupe) B";"";"31";""
"ACCN";"31";"MATIERES PREMIERES (et fournitures)";"";"3";""
@@ -125,7 +107,6 @@
"ACCN";"371";"Marchandise (ou groupe) A";"";"37";""
"ACCN";"37";"STOCKS DE MARCHANDISES";"";"3";""
"ACCN";"372";"Marchandise (ou groupe) B";"";"37";""
-"ACCN";"38";"STOCKS EN VOIE D'ACHEMINEMENT, MIS EN DÉPOT OU DONNÉS EN CONSIGNATION";"";"3";""
"ACCN";"3";"COMPTES DE STOCKS ET D'EN-COURS";"";"";""
"ACCN";"391";"Provisions pour dépréciation des stocks dapprovisionnement";"";"39";""
"ACCN";"392";"Provisions pour dépréciation des autres approvisionnements";"";"39";""
@@ -139,9 +120,7 @@
"ACCN";"403";"Fournisseurs - Effets à payer";"";"40";""
"ACCN";"404";"Fournisseurs d'immobilisations";"";"40";""
"ACCN";"405";"Fournisseurs d'immobilisations - Effets à payer";"";"40";""
-"ACCN";"408";"Fournisseurs - Factures non parvenues";"";"40";""
"ACCN";"40";"FOURNISSEURS ET COMPTES RATTACHES";"";"4";""
-"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
"ACCN";"410";"Clients et comptes rattachés";"";"41";""
"ACCN";"411";"Clients";"";"41";""
"ACCN";"413";"Clients - Effets a recevoir";"";"41";""
@@ -149,7 +128,6 @@
"ACCN";"417";"Créances sur travaux non encore facturables";"";"41";""
"ACCN";"418";"Clients - Produits non encore facturés";"";"41";""
"ACCN";"41";"CLIENTS ET COMPTES RATTACHES";"";"4";""
-"ACCN";"419";"Clients créditeurs";"";"41";""
"ACCN";"421";"Personnel - Rémunérations dues";"";"42";""
"ACCN";"422";"Comités d'entreprise, d'établissement...";"";"42";""
"ACCN";"424";"Participations des salariés aux résultats";"";"42";""
@@ -157,7 +135,6 @@
"ACCN";"426";"Personnel - Dépôts";"";"42";""
"ACCN";"427";"Personnel - Oppositions";"";"42";""
"ACCN";"42";"PERSONNEL ET COMPTES RATTACHES";"";"4";""
-"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
"ACCN";"431";"Sécurité sociale";"";"43";""
"ACCN";"437";"Autres organismes sociaux";"";"43";""
"ACCN";"43";"SECURITE SOCIALE - AUTRES ORGANISMES SOCIAUX";"";"4";""
@@ -181,6 +158,8 @@
"ACCN";"445711";"TVA collectée 19;6 % débits";"";"44571";""
"ACCN";"445712";"TVA collectée 5;5 % débits";"";"44571";""
"ACCN";"445714";"TVA collectée 19;6 % encaissements";"";"44571";""
+"ACCN";"44571";"TVA collectée";"";"4457";""
+"ACCN";"445715";"TVA collectée 5;5 % encaissements";"";"44571";""
"ACCN";"445";"Etat - Taxes sur le chiffre d'affaires";"";"44";""
"ACCN";"44583";"Remboursement de taxes sur le chiffre d'affaires demandé";"";"4458";""
"ACCN";"44584";"TVA récupérée d'avance";"";"4458";""
@@ -255,17 +234,12 @@
"ACCN";"59";"PROVISION POUR DÉPRÉCIATION DES COMPTES FINANCIERS";"";"5";""
"ACCN";"590";"Provisions pour dépréciation valeurs mobilières de placement";"";"59";""
"ACCN";"601";"Achats stockés - Matières premières (et fournitures)";"";"60";""
-"ACCN";"602";"Achats stockés - Autres approvisionnements";"";"60";""
-"ACCN";"6022";"Fournitures consommables";"";"60";""
-"ACCN";"6026";"Emballages";"";"60";""
-"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";"";"60";""
"ACCN";"604";"Achats d'études et prestations de services";"";"60";""
"ACCN";"605";"Achats de matériel, équipements et travaux";"";"60";""
"ACCN";"606";"Achats non stockés de matières et fournitures";"";"60";""
"ACCN";"607";"Achats de marchandises";"";"60";""
"ACCN";"608";"Frais accessoires d'achat";"";"60";""
"ACCN";"60";"ACHATS (sauf 603)";"";"6";""
-"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
"ACCN";"611";"Sous-traitance générale";"";"61";""
"ACCN";"612";"Redevances de crédit-bail";"";"61";""
"ACCN";"613";"Locations";"";"61";""
@@ -405,5 +379,83 @@
"ACCN";"890";"Bilan d'ouverture";"";"89";""
"ACCN";"89";"BILAN";"";"8";""
"ACCN";"891";"Bilan de clôture";"";"89";""
-"ACCN";"44571";"TVA collectée";"";"4457";""
-"ACCN";"445715";"TVA collectée 5;5 % encaissements";"";"44571";""
+"ACCN";"6031";"Variation des stocks de matières premières (et fournitures)";;"603";""
+"ACCN";"6032";"Variation des stocks des autres approvisionnements";;"603";""
+"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";"";"60";""
+"ACCN";"2761";"Créances diverses";;"276";""
+"ACCN";"276";"Autres créances immobilisées";"";"27";""
+"ACCN";"27682";"Sur titres immobilisés (droits de créance)";;"2768";""
+"ACCN";"27684";"Sur prêts";;"2768";""
+"ACCN";"27685";"Sur dépôts et cautionnements";;"2768";""
+"ACCN";"27688";"Sur créances diverses";;"2768";""
+"ACCN";"2768";"Intérêts courus";;"276";""
+"ACCN";"2801";"Frais d'établissement (même ventilation que celle du compte 201)";;"280";""
+"ACCN";"2803";"Frais de recherche et développement";;"280";""
+"ACCN";"2805";"Concessions et droits similaires, brevets, licences, logiciels, droits et valeurs similaires";;"280";""
+"ACCN";"2807";"Fonds commercial";;"280";""
+"ACCN";"2808";"Autres immobilisations incorporelles";;"280";""
+"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
+"ACCN";"2811";"Terrains de gisement";;"281";""
+"ACCN";"2812";"Agencements, aménagements de terrains (même ventilation que celle du compte 212)";;"281";""
+"ACCN";"2813";"Constructions (même ventilation que celle du compte 213)";;"281";""
+"ACCN";"2814";"Constructions sur sol d'autrui (même ventilation que celle du compte 214)";;"281";""
+"ACCN";"2815";"Installations techniques, matériel et outillage industriels (même ventilation que celle du compte 215)";;"281";""
+"ACCN";"2818";"Autres immobilisations corporelles (même ventilation que celle du compte 218)";;"281";""
+"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
+"ACCN";"2905";"Marques, procédés, droits, et valeurs similaires";;"290";""
+"ACCN";"2906";"Droit au bail";;"290";""
+"ACCN";"2907";"Fonds commercial";;"290";""
+"ACCN";"2908";"Autres immobilisations incorporelles";;"290";""
+"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
+"ACCN";"2911";"Terrains (autres que terrains de gisement)";;"291";""
+"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
+"ACCN";"2931";"Immobilisations corporelles en cours";;"293";""
+"ACCN";"2932";"Immobilisations incorporelles en cours";;"293";""
+"ACCN";"293";"Dépréciations des immobilisations en cours";"";"29";""
+"ACCN";"2961";"Titres de participation";;"296";""
+"ACCN";"2966";"Autres formes de participation";;"296";""
+"ACCN";"2967";"Créances rattachées à des participations (même ventilation que celle du compte 267)";;"296";""
+"ACCN";"2968";"Créances rattachées à des sociétés en participation (même ventilation que celle du compte 268)";;"296";""
+"ACCN";"296";" Dépréciations des participations et créances rattachées à des participations";"";"29";""
+"ACCN";"2971";"Titres immobilisés autres que les titres immobilisés de l'activité portefeuille - droit de propriété (même ventilation que celle du compte 271)";;"297";""
+"ACCN";"2972";"Titres immobilisés - droit de créance (même ventilation que celle du compte 272)";;"297";""
+"ACCN";"2973";"Titres immobilisés de l'activité portefeuille";;"297";""
+"ACCN";"2974";"Prêts (même ventilation que celle du compte 274)";;"297";""
+"ACCN";"2975";"Dépôts et cautionnements versés (même ventilation que celle du compte 275)";;"297";""
+"ACCN";"2976";"Autres créances immobilisées (même ventilation que celle du compte 276)";;"297";""
+"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
+"ACCN";"1671";"Émissions de titres participatifs";;"167";""
+"ACCN";"1674";"Avances conditionnées de l'État";;"167";""
+"ACCN";"1675";"Emprunts participatifs";;"167";""
+"ACCN";"167";"Emprunts et dettes assortis de conditions particulières";"";"16";""
+"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
+"ACCN";"4081";"Fournisseurs";;"408";""
+"ACCN";"4084";"Fournisseurs d'immobilisations";;"408";""
+"ACCN";"4088";"Fournisseurs - Intérêts courus";;"408";""
+"ACCN";"408";"Fournisseurs - Factures non parvenues";"";"40";""
+"ACCN";"4091";"Fournisseurs - Avances et acomptes versés sur commandes";;"409";""
+"ACCN";"4096";"Fournisseurs - Créances pour emballages et matériel à rendre";;"409";""
+"ACCN";"4097";"Fournisseurs - Autres Avoirs";;"409";""
+"ACCN";"4098";"Rabais, remises, ristournes à obtenir et autres avoirs non encore reçus";;"409";""
+"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
+"ACCN";"4191";"Clients - Avances et acomptes reçus sur commandes";;"419";""
+"ACCN";"4196";"Clients - Dettes pour emballages et matériels consignés";;"419";""
+"ACCN";"4197";"Clients - Autres avoirs";;"419";""
+"ACCN";"4198";"Rabais, remises, ristournes à accorder et autres avoirs à établir";;"419";""
+"ACCN";"419";"Clients créditeurs";"";"41";""
+"ACCN";"4282";"Dettes provisionnées pour congés à payer";;"428";""
+"ACCN";"4284";"Dettes provisionnées pour participation des salariés aux résultats";;"428";""
+"ACCN";"4286";"Autres charges à payer";;"428";""
+"ACCN";"4287";"Produits à recevoir";;"428";""
+"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
+"ACCN";"6022";"Fournitures consommables";;"602";""
+"ACCN";"602";"Achats stockés - Autres approvisionnements";"";"60";""
+"ACCN";"6026";"Emballages";;"602";""
+"ACCN";"6091";"de matières premières (et fournitures)";;"609";""
+"ACCN";"6092";"d'autres approvisionnements stockés";;"609";""
+"ACCN";"6094";"d'études et de prestations de services";;"609";""
+"ACCN";"6095";"de matériel, équipements et travaux";;"609";""
+"ACCN";"6096";"d'approvisionnements non stockés";;"609";""
+"ACCN";"6097";"de marchandises";;"609";""
+"ACCN";"6098";"Rabais, remises et ristournes non affectés";;"609";""
+"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
1
0
r3004 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction
by jpepin@users.chorem.org 16 Aug '10
by jpepin@users.chorem.org 16 Aug '10
16 Aug '10
Author: jpepin
Date: 2010-08-16 15:11:52 +0200 (Mon, 16 Aug 2010)
New Revision: 3004
Url: http://chorem.org/repositories/revision/lima/3004
Log:
KeyListerner sur la touche tab :
Saut automatique des cellules non ?\195?\169ditables.
Ajout d'une entr?\195?\169e en fin de ligne si la transaction est non ?\195?\169quilibr?\195?\169.
Ajout d'une nouvelle transaction en fin de ligne via tab si la derni?\195?\168re est ?\195?\169quilibr?\195?\169.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-16 13:11:52 UTC (rev 3004)
@@ -28,7 +28,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
import org.chorem.lima.ui.celleditor.DateTableCellEditor;
import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
@@ -164,37 +166,78 @@
/**
* Touche tab
+ * Incrémente le curseur de case tant que la case n'est pas editable
* Ajoute une entrée comptable si tab est sur
- * la dernière cellule.
+ * la dernière cellule et si la transaction est non équilibré
+ * sinon rajoute une transaction
*/
if (e.getKeyChar() == KeyEvent.VK_TAB) {
- // Vérifie si la cellule sélectionnée est la dernière
+ int max_x = this.getColumnCount();
+ int max_y = this.getRowCount();
+ int x_tab = this.getSelectedColumn();
+ int y_tab = this.getSelectedRow();
+
+ if (x_tab < max_x - 1){
+ x_tab++;
+ }
+ else {
+ y_tab++;
+ }
+ //skip all cell while not editable
+ while (!isCellEditable(y_tab, x_tab)){
- int x = this.getSelectedColumn();
- int y = this.getSelectedRow();
- int max_x = this.getColumnCount() - 1;
- int max_y = this.getRowCount() - 1;
- if (x == max_x && y == max_y) {
- handler.addEmptyEntry();
- // positionne la sélection sur la nouvelle ligne créée
- this.setColumnSelectionInterval(0, 0);
- this.setRowSelectionInterval(max_y + 1, max_y + 1);
- }
+ //if end of row
+ if (x_tab == max_x-1) {
+ Object object = this.handler.tableModel.getElementAt(y_tab);
+
+ //if transaction, add entry
+ if (object instanceof FinancialTransaction){
+ FinancialTransaction financialTransaction = (FinancialTransaction) object;
+ if (financialTransaction.getEntry().size() == 0){
+ handler.addEmptyEntry();
+ this.setColumnSelectionInterval(1, 1);
+ }
+ }
+ //if entry
+ else {
+ Entry entry = (Entry) object;
+ FinancialTransaction financialTransaction = entry.getFinancialTransaction();
+ Boolean balanced =
+ financialTransaction.getAmountCredit() ==
+ financialTransaction.getAmountDebit();
+ if (balanced){
+ if (y_tab == max_y-1){
+ handler.addFinancialTransaction();
+ this.setColumnSelectionInterval(0, 0);
+ }
+ }
+ else {
+ handler.addEmptyEntry();
+ this.setColumnSelectionInterval(1, 1);
+ }
+ }
+ y_tab++;
+ // positionne la sélection sur la nouvelle ligne créée
+ this.setRowSelectionInterval(y_tab, y_tab);
+ x_tab=0;
+ }
+ else {
+ if (x_tab < max_x){
+ this.setColumnSelectionInterval(x_tab, x_tab);
+ x_tab++;
+ }
+ }
+ }
}
-
}
- /*
- * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
- */
+
@Override
public void keyTyped(KeyEvent e) {
}
- /*
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- */
+
@Override
public void keyReleased(KeyEvent e) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-16 13:11:52 UTC (rev 3004)
@@ -327,7 +327,7 @@
boolean editableCell=false;
Object currentRow = cacheDataList.get(rowIndex);
// cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1) || (columnIndex==8))) {
editableCell=true;
}
// cells editable for the financialtransaction row, no cells exclude the date
@@ -336,7 +336,9 @@
}
return editableCell;
}
+
+
/**
* @throws LimaException
*/
@@ -550,7 +552,7 @@
}
//on recharge la liste
cacheDataList = getDataList();
- fireTableRowsDeleted(row, getRowCount());
+ fireTableDataChanged();
}
@Override
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
@@ -1,104 +0,0 @@
-<!-- ##% Lima Swing
- Copyright (C) 2008 - 2010 CodeLutin
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##% -->
-
-<Table>
- <FinancialTransactionViewHandler id="handler" javaBean="new FinancialTransactionViewHandler(this)" />
- <Boolean id="selectedRow" javaBean="false" />
- <org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel id="modelFinancialPeriod"/>
- <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
- <script>
- <![CDATA[
- import org.chorem.lima.entity.FiscalPeriod;
- import org.chorem.lima.entity.FinancialPeriod;
-
- void $afterCompleteSetup() {
- getHandler().refresh();
- }
-
- ]]>
- </script>
-
- <!-- <JPopupMenu id="MenuRightPanel">
- <JMenuItem text="lima.add.transaction" onActionPerformed='addEmptyTransaction()'/>
- <JMenuItem text="lima.print"/>
- </JPopupMenu>
- <JPopupMenu id="MenuRightTransaction">
- <JMenuItem text="lima.add" onActionPerformed='addEmptyTransaction()'/>
- <JMenuItem text="lima.print"/>
- </JPopupMenu> -->
-
- <row weightx="1" weighty="0" anchor="center">
- <cell anchor="east">
- <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/>
- </cell>
- <cell anchor="west">
- <JComboBox id="fiscalPeriodComboBox"
- model="{getModelFiscalPeriod()}"
- renderer="{new org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer()}"
- onActionPerformed="getModelFinancialPeriod().setFiscalPeriod( (FiscalPeriod) fiscalPeriodComboBox.getSelectedItem());
- getHandler().refresh()"
- editable="false"/>
- </cell>
- <cell anchor="east">
- <JLabel id="financialPeriodLabel" text="lima.transaction.period"
- />
- </cell>
- <cell anchor="west">
- <JComboBox id="financialPeriodComboBox"
- model="{getModelFinancialPeriod()}"
- renderer="{new org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer()}"
- onActionPerformed="getFinancialTransactionTableModel().setFinancialPeriod( (FinancialPeriod) financialPeriodComboBox.getSelectedItem());
- getHandler().refresh()"
- editable="false"
- />
- </cell>
- <cell>
- <JButton text="lima.common.copy"
- onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.common.paste"
- onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.add.transaction"
- onActionPerformed="getHandler().addFinancialTransaction()"/>
- </cell>
- <cell>
- <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.common.remove"
- onActionPerformed="getHandler().deleteSelectedRow()"
- enabled="{isSelectedRow()}"/>
- </cell>
- </row>
- <row>
- <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
- <JScrollPane>
- <org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
- id="financialTransactionTableModel"/>
- <org.chorem.lima.ui.financialtransaction.FinancialTransactionTable
- id="financialTransactionTable" sortable="false" rowHeight="22"
- constructorParams="getHandler()" model="{getFinancialTransactionTableModel()}"
- selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
- <javax.swing.ListSelectionModel javaBean="getFinancialTransactionTable().getSelectionModel()"
- onValueChanged="setSelectedRow(financialTransactionTable.getSelectedRow() != -1)"/>
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx (from rev 3003, trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
@@ -0,0 +1,104 @@
+<!-- ##% Lima Swing
+ Copyright (C) 2008 - 2010 CodeLutin
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ##% -->
+
+<Table>
+ <FinancialTransactionViewHandler id="handler" javaBean="new FinancialTransactionViewHandler(this)" />
+ <Boolean id="selectedRow" javaBean="false" />
+ <org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel id="modelFinancialPeriod"/>
+ <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
+ <script>
+ <![CDATA[
+ import org.chorem.lima.entity.FiscalPeriod;
+ import org.chorem.lima.entity.FinancialPeriod;
+
+ void $afterCompleteSetup() {
+ getHandler().refresh();
+ }
+
+ ]]>
+ </script>
+
+ <!-- <JPopupMenu id="MenuRightPanel">
+ <JMenuItem text="lima.add.transaction" onActionPerformed='addEmptyTransaction()'/>
+ <JMenuItem text="lima.print"/>
+ </JPopupMenu>
+ <JPopupMenu id="MenuRightTransaction">
+ <JMenuItem text="lima.add" onActionPerformed='addEmptyTransaction()'/>
+ <JMenuItem text="lima.print"/>
+ </JPopupMenu> -->
+
+ <row weightx="1" weighty="0" anchor="center">
+ <cell anchor="east">
+ <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/>
+ </cell>
+ <cell anchor="west">
+ <JComboBox id="fiscalPeriodComboBox"
+ model="{getModelFiscalPeriod()}"
+ renderer="{new org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer()}"
+ onActionPerformed="getModelFinancialPeriod().setFiscalPeriod( (FiscalPeriod) fiscalPeriodComboBox.getSelectedItem());
+ getHandler().refresh()"
+ editable="false"/>
+ </cell>
+ <cell anchor="east">
+ <JLabel id="financialPeriodLabel" text="lima.transaction.period"
+ />
+ </cell>
+ <cell anchor="west">
+ <JComboBox id="financialPeriodComboBox"
+ model="{getModelFinancialPeriod()}"
+ renderer="{new org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer()}"
+ onActionPerformed="getFinancialTransactionTableModel().setFinancialPeriod( (FinancialPeriod) financialPeriodComboBox.getSelectedItem());
+ getHandler().refresh()"
+ editable="false"
+ />
+ </cell>
+ <cell>
+ <JButton text="lima.common.copy"
+ onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.paste"
+ onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.add.transaction"
+ onActionPerformed="getHandler().addFinancialTransaction()"/>
+ </cell>
+ <cell>
+ <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.remove"
+ onActionPerformed="getHandler().deleteSelectedRow()"
+ enabled="{isSelectedRow()}"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
+ <JScrollPane>
+ <org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
+ id="financialTransactionTableModel"/>
+ <org.chorem.lima.ui.financialtransaction.FinancialTransactionTable
+ id="financialTransactionTable" sortable="false" rowHeight="22"
+ constructorParams="getHandler()" model="{getFinancialTransactionTableModel()}"
+ selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
+ <javax.swing.ListSelectionModel javaBean="getFinancialTransactionTable().getSelectionModel()"
+ onValueChanged="setSelectedRow(financialTransactionTable.getSelectedRow() != -1)"/>
+ </JScrollPane>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
1
0
13 Aug '10
Author: jpepin
Date: 2010-08-13 17:27:33 +0200 (Fri, 13 Aug 2010)
New Revision: 3003
Url: http://chorem.org/repositories/revision/lima/3003
Log:
Modification de la fonction d'entr?\195?\169es non ?\195?\169quilibr?\195?\169s en entr?\195?\169es incorrectes : v?\195?\169rification suppl?\195?\169mentaire sur le journal et les comptes.
D?\195?\169bogue surlignage entr?\195?\169e non ?\195?\169quilibr?\195?\169.
Ajout fonction copie-colle d'entr?\195?\169es.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
trunk/pom.xml
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -408,7 +408,6 @@
.addParam("account", account);
Account master = accountDAO.findByQuery(query);
- log.debug(master);
accountingRules.updateAccountRules(master, account);
subAccount.setMasterAccount(account.getMasterAccount());
subAccount.setSubAccounts(account.getSubAccounts());
@@ -563,9 +562,6 @@
doCatch(topiaContext, ex, log);
}
}
- for (Account account : accounts) {
- log.debug("accounts " + account.getAccountNumber());
- }
return accounts;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -23,7 +23,10 @@
import java.math.BigDecimal;
import java.util.Date;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -46,6 +49,7 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
/**
* Cette classe permet la création d'une transaction comptable dans l'application.
@@ -182,21 +186,27 @@
* Get unbalanced financialtransaction from selected fiscalperiod
*/
@Override
- public List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException {
+ public Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException {
TopiaContext topiaContext = null;
- List<FinancialTransaction> result = null;
+ Set<FinancialTransaction> result = new HashSet<FinancialTransaction>();
try {
topiaContext = beginTransaction();
FinancialTransactionDAO financialTransactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
-
TopiaQuery query = financialTransactionDAO.createQuery("E");
query.addFrom(FiscalPeriod.class, "F")
- .addWhere("E.amountCredit != E.amountDebit")
+ .addWhere("E.amountCredit != E.amountDebit OR E.entryBook = null")
.addInElements("E.financialPeriod", "F.financialPeriod")
.addEquals("F", fiscalPeriod);
- result = financialTransactionDAO.findAllByQuery(query);
+ result.addAll(financialTransactionDAO.findAllByQuery(query));
+
+ TopiaQuery query2 = financialTransactionDAO.createQuery("T");
+ query2.addFrom(Entry.class, "E")
+ .addWhere("E.account = null")
+ .addInElements("E", "T.entry");
+ result.addAll(financialTransactionDAO.findAllByQuery(query2));
+
/* Just for fun : IN HQL
result = topiaContext.find(
"FROM org.chorem.lima.entity.FinancialTransaction "+
@@ -391,6 +401,34 @@
EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
entryDAO.create(entry);
+
+ //get new entry amounts
+ BigDecimal entryAmount = entry.getAmount();
+ Boolean entryAmountIsDebit = entry.getDebit();
+ BigDecimal entryDebit = new BigDecimal(0), entryCredit = new BigDecimal(0);
+ if (entryAmountIsDebit){
+ entryDebit = entryAmount;
+ }
+ else {
+ entryCredit = entryAmount;
+ }
+
+ //calculate financial transaction amounts
+ FinancialTransaction financialTransaction =
+ entry.getFinancialTransaction();
+
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ amountDebit = amountDebit.add(entryDebit);
+ financialTransaction.setAmountDebit(amountDebit);
+
+ BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ amountCredit = amountCredit.add(entryCredit);
+ financialTransaction.setAmountCredit(amountCredit);
+
+ //update financial transaction
+ updateFinancialTransactionWithTransaction(
+ financialTransaction, topiaContext);
+
commitTransaction(topiaContext);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -20,6 +20,8 @@
package org.chorem.lima.business.ejbinterface;
import java.util.List;
+import java.util.Set;
+
import javax.ejb.Remote;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
@@ -57,7 +59,7 @@
List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
EntryBook entryBook, FinancialPeriod period) throws LimaException;
- List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException;
+ Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -25,8 +25,6 @@
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaBusinessException;
-import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
public class ServiceMonitorableHandler implements InvocationHandler {
@@ -67,6 +65,7 @@
if (!method.getName().startsWith("get")){
for (ServiceListener serviceListener : listeners) {
serviceListener.notifyMethod(service.toString(), method.getName());
+ log.debug("proxy : " + service.toString() + " " + method.getName());
}
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -22,7 +22,11 @@
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.math.BigDecimal;
import java.util.Date;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
@@ -45,6 +49,10 @@
/** serialVersionUID. */
private static final long serialVersionUID = 3133690382049594727L;
+
+ /** log. */
+ private static final Log log = LogFactory
+ .getLog(FinancialTransactionTable.class);
protected FinancialTransactionViewHandler handler;
@@ -110,9 +118,9 @@
ComponentAdapter adapter) {
boolean isHighlighted = false;
Object value = adapter.getValueAt(adapter.row, 8);
- if (value instanceof Double) {
- Double currentBalance = (Double) value;
- if (currentBalance != 0) {
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
isHighlighted = true;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -413,12 +413,42 @@
fireTableDataChanged();
}
+ public void addEntry(Object value, Entry entry, int row) throws LimaException {
+ FinancialTransaction currentTransaction = null;
+ int financialTransactionRow = 0;
+ Object currentRow = cacheDataList.get(row);
+ //check if current row is a transaction or an entry
+ if (currentRow instanceof FinancialTransaction) {
+ currentTransaction = (FinancialTransaction)currentRow;
+ //update the financial transaction in entire
+ financialTransactionRow =
+ getDataList().indexOf(((FinancialTransaction) currentRow));
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ //get back the parent transaction of the entry
+ currentTransaction = currentEntry.getFinancialTransaction();
+ //update the financial transaction in entire
+ financialTransactionRow =
+ getDataList().indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ financialTransactionService.createEntry(entry);
+ fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
+
+ //on recharge la liste
+ cacheDataList = getDataList();
+ fireTableDataChanged();
+ }
+
/**
* to modifiy financialtransaction or entry
*/
@Override
public void setValueAt(Object value, int row, int column) {
- int financialTransactionRow=0;
+ int financialTransactionRow = 0;
if (cacheDataList != null) {
Object currentRow = cacheDataList.get(row);
if (currentRow instanceof FinancialTransaction) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-13 15:27:33 UTC (rev 3003)
@@ -67,11 +67,19 @@
/>
</cell>
<cell>
+ <JButton text="lima.common.copy"
+ onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.paste"
+ onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
<JButton text="lima.add.transaction"
onActionPerformed="getHandler().addFinancialTransaction()"/>
</cell>
<cell>
- <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()"/>
+ <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
</cell>
<cell>
<JButton text="lima.common.remove"
@@ -80,7 +88,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" rows="3" columns="8">
+ <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
<JScrollPane>
<org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
id="financialTransactionTableModel"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -27,6 +27,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
@@ -57,11 +58,51 @@
protected FiscalPeriodComboBoxModel fiscalPeriodComboBoxModel;
protected FinancialPeriodComboBoxModel financialPeriodComboBoxModel;
+
+ protected Object clipBoard;
protected FinancialTransactionViewHandler(FinancialTransactionView view) {
this.view = view;
}
+ //copy entry
+ public void copyRow(){
+ int indexSelectedRow = table.getSelectedRow();
+
+ if (indexSelectedRow != -1) {
+ clipBoard = tableModel.getElementAt(indexSelectedRow);
+ }
+ }
+
+ //paste entry
+ public void pasteRow(){
+ int indexSelectedRow = table.getSelectedRow();
+
+ if (indexSelectedRow != -1) {
+ Object selectedValue = tableModel.getElementAt(indexSelectedRow);
+ if (clipBoard instanceof Entry) {
+ try {
+ tableModel.addEntry(selectedValue, (Entry) clipBoard, indexSelectedRow);
+ //select the new line
+ ListSelectionModel selectionModel =
+ table.getSelectionModel();
+ selectionModel.setSelectionInterval(
+ indexSelectedRow+1, indexSelectedRow+1);
+ //focus on second column
+ table.changeSelection(indexSelectedRow+1, 1, false, false);
+ table.requestFocusInWindow();
+ } catch (LimaException eee){
+ if (log.isErrorEnabled()) {
+ log.error("Can't past entry", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ }
+
+ }
+
+ }
+
//add a new transaction
public void addFinancialTransaction() {
table = view.getFinancialTransactionTable();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -22,6 +22,7 @@
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.math.BigDecimal;
import java.util.Date;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
@@ -113,9 +114,9 @@
ComponentAdapter adapter) {
boolean isHighlighted = false;
Object value = adapter.getValueAt(adapter.row, 8);
- if (value instanceof Double) {
- Double currentBalance = (Double) value;
- if (currentBalance != 0) {
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
isHighlighted = true;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -25,6 +25,8 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
+import java.util.Set;
+
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -98,8 +100,8 @@
List<Object> results = new ArrayList<Object>();
if(selectedFiscalPeriod != null){
try {
- List<FinancialTransaction> financialtransactions =
- financialTransactionService.getAllFinancialTransactionsUnbalanced(selectedFiscalPeriod);
+ Set<FinancialTransaction> financialtransactions =
+ financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
for (FinancialTransaction financialtransaction : financialtransactions) {
results.add(financialtransaction);
List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
@@ -338,6 +340,7 @@
FinancialTransaction currentTransaction = null;
Object currentRow = cacheDataList.get(row);
Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
//check if current row is a transaction or an entry
if (currentRow instanceof FinancialTransaction) {
currentTransaction = (FinancialTransaction)currentRow;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -21,6 +21,8 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
import java.util.List;
+import java.util.Set;
+
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
@@ -99,9 +101,9 @@
List<FiscalPeriod> unblockedFiscalPeriods =
fiscalPeriodService.getAllUnblockedFiscalPeriods();
if (unblockedFiscalPeriods.size() != 0){
- List<FinancialTransaction> financialTransactionsUnbal =
+ Set<FinancialTransaction> financialTransactionsUnbal =
financialTransactionService.
- getAllFinancialTransactionsUnbalanced(unblockedFiscalPeriods.get(0));
+ getAllInexactFinancialTransactions(unblockedFiscalPeriods.get(0));
if (financialTransactionsUnbal.size()>0){
setBackground(redBackground);
String transactionsString = financialTransactionsUnbal.size()
@@ -146,7 +148,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
+ if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("Entry") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-13 15:27:33 UTC (rev 3003)
@@ -46,11 +46,13 @@
lima.common.addSubLedger=
lima.common.cancel=
lima.common.close=
+lima.common.copy=
lima.common.fin=
lima.common.import=
lima.common.importexport=Import/Export
lima.common.next=
lima.common.ok=
+lima.common.paste=
lima.common.print=
lima.common.quit=
lima.common.remove=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-13 15:27:33 UTC (rev 3003)
@@ -43,10 +43,12 @@
lima.common.addSubLedger=Ajouter Compte Tiers
lima.common.cancel=Annuler
lima.common.close=Fermer
+lima.common.copy=Copier
lima.common.fin=Termin\u00E9
lima.common.importexport=Importer/Exporter
lima.common.next=Suivant
lima.common.ok=OK
+lima.common.paste=Coller
lima.common.print=
lima.common.quit=Quitter
lima.common.remove=Supprimer
@@ -72,7 +74,7 @@
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
-lima.entries.searchunbalancedtransaction=Entr\u00E9es non \u00E9quilibr\u00E9es
+lima.entries.searchunbalancedtransaction=Entr\u00E9es incorrect
lima.entrybook=Journal
lima.entrybook.add=Ajouter un journal
lima.entrybook.code=
@@ -241,7 +243,7 @@
limahome.transaction.balanced=transactions, toutes sont \u00E9quilibr\u00E9es
limahome.transaction.create=Ajouter des \u00E9critures
limahome.transaction.modifiy.balanced=Modifier les \u00E9critures
-limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures non \u00E9quilibr\u00E9es
+limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures incorrect
limahome.transaction.nothing=Aucune \u00E9criture
limahome.transaction.unbalanced=\u00E9critures ne sont pas \u00E9quilibr\u00E9es \!
update=
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/pom.xml 2010-08-13 15:27:33 UTC (rev 3003)
@@ -275,9 +275,9 @@
<projectId>lima</projectId>
<!-- customized libs version -->
- <nuiton-utils.version>1.3.2-SNAPSHOT</nuiton-utils.version>
+ <nuiton-utils.version>1.4</nuiton-utils.version>
<eugene.version>2.1.1</eugene.version>
- <topia.version>2.4.1-SNAPSHOT</topia.version>
+ <topia.version>2.4.2</topia.version>
<jaxx.version>2.1</jaxx.version>
<i18n.version>1.2.2</i18n.version>
1
0
r3002 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by jpepin@users.chorem.org 13 Aug '10
by jpepin@users.chorem.org 13 Aug '10
13 Aug '10
Author: jpepin
Date: 2010-08-13 15:01:51 +0200 (Fri, 13 Aug 2010)
New Revision: 3002
Url: http://chorem.org/repositories/revision/lima/3002
Log:
Mise ?\195?\160 jour algo de calcul du bilan / compte de r?\195?\169sultat : probl?\195?\168me si regroupement de compte inexistant r?\195?\169solu.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
@@ -491,7 +491,34 @@
}
//add all accounts
for (String accountNumber : accountNumbers) {
+ Account account = null;
if (subAccountsMode){
+ account = accountDAO.findSubAccountByNumber(accountNumber);
+ }
+ else {
+ account = accountDAO.findByAccountNumber(accountNumber);
+
+ }
+ //add account if exist
+ if (account != null){
+ accounts.add(account);
+ }
+ //search all account start with accountnumber
+ else {
+ TopiaQuery query = accountDAO.createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ //.addWhere("not exists elements ("+subLedgersProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ List<Account> accountsResult = accountDAO.findAllByQuery(query);
+ if (accountsResult != null){
+ accounts.addAll(accountsResult);
+ }
+ }
+ }
+ /*for (String accountNumber : accountNumbers) {
+ if (subAccountsMode){
Account account = accountDAO.findSubAccountByNumber(accountNumber);
if (account == null){
TopiaQuery query = accountDAO.createQuery();
@@ -517,7 +544,7 @@
}
}
- }
+ }*/
//remove all accounts
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
1
0
Author: jpepin
Date: 2010-08-13 12:43:53 +0200 (Fri, 13 Aug 2010)
New Revision: 3001
Url: http://chorem.org/repositories/revision/lima/3001
Log:
Ajout import compte tiers depuis EBP.
Mise ?\195?\160 jour algo de calcul du bilan / compte de r?\195?\169sultat : probl?\195?\168me avec les comptes tiers.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -490,7 +490,6 @@
first=false;
}
//add all accounts
- log.debug("accountNumbers "+accountNumbers);
for (String accountNumber : accountNumbers) {
if (subAccountsMode){
Account account = accountDAO.findSubAccountByNumber(accountNumber);
@@ -499,7 +498,7 @@
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
- .addWhere("not exists elements ("+subLedgersProperty+")")
+ //.addWhere("not exists elements ("+subLedgersProperty+")")
.addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
List<Account> accountsResult = accountDAO.findAllByQuery(query);
if (accountsResult != null){
@@ -520,7 +519,6 @@
}
//remove all accounts
- log.debug("accountNumbersToRemove "+accountNumbersToRemove);
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
if (subAccountsMode){
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.StringWriter;
-import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.ejb.Stateless;
@@ -435,7 +434,7 @@
/**
* Local methode, export accounts from database
- * Structure : TYPE | AccountNumber | Label | ThirdParty | MasteAccount | GeneralLedger
+ * Structure : TYPE | AccountNumber | Label | ThirdParty | MasterAccount | GeneralLedger
*/
public void exportAccountsChartAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException {
try {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -304,7 +304,9 @@
return result;
}
-
+ /**
+ * Créé la liste de postes contenant les calculs de comptes
+ */
public FinancialStatementDatas financialStatementReport(FinancialStatement financialStatement, Date selectedBeginDate, Date selectedEndDate,FinancialStatementDatas result, TopiaContext topiaContext) throws LimaException{
List<FinancialStatement> financialStatements =
@@ -405,20 +407,67 @@
}
/**
- * Permet de calculer tous les comptes contenu dans un mouvement
+ * Permet de calculer le montant de tous les comptes contenu dans un mouvement
*/
public FinancialStatementAmounts financialStatementAmounts(FinancialStatement financialStatement, Date selectedBeginDate, Date selectedEndDate, TopiaContext topiaContext) throws LimaException{
FinancialStatementAmounts financialStatementAmounts =
new FinancialStatementAmountsImpl();
+
+ FinancialStatement masterFinancialStatement = financialStatement.getMasterFinancialStatement();
+ FinancialStatementWayEnum financialStatementWayEnum = FinancialStatementWayEnum.BOTH;
+ if (masterFinancialStatement != null){
+ financialStatementWayEnum = masterFinancialStatement.getWay();
+ }
+
+ // DEBIT & CREDIT ACCOUNTS LIST
+ String accountsString = financialStatement.getAccounts();
+ BigDecimal amount = accountsNumberListToAmount(accountsString,
+ financialStatementWayEnum, FinancialStatementWayEnum.BOTH,
+ selectedBeginDate,selectedEndDate, topiaContext);
+ // DEBIT ACCOUNTS LIST
+ String debitAccountsString = financialStatement.getDebitAccounts();
+ BigDecimal debitAmount = accountsNumberListToAmount(debitAccountsString,
+ financialStatementWayEnum, FinancialStatementWayEnum.DEBIT,
+ selectedBeginDate, selectedEndDate, topiaContext);
+ //CREDIT ACCOUNTS LIST
+ String creditAccountsString = financialStatement.getCreditAccounts();
+ BigDecimal creditAmount = accountsNumberListToAmount(creditAccountsString,
+ financialStatementWayEnum, FinancialStatementWayEnum.CREDIT,
+ selectedBeginDate, selectedEndDate, topiaContext);
+ // PROVISION & DEPRECATION
+ String provisionDeprecationAccountsString =
+ financialStatement.getProvisionDeprecationAccounts();
+ BigDecimal provisionDeprecationAmount = accountsNumberListToAmount(
+ provisionDeprecationAccountsString, financialStatementWayEnum,
+ FinancialStatementWayEnum.BOTH, selectedBeginDate,
+ selectedEndDate, topiaContext);
+
+ // set result
+ amount = amount.add(creditAmount);
+ amount = amount.add(debitAmount);
+ financialStatementAmounts.setGrossAmount(amount);
+ financialStatementAmounts.setLabel(financialStatement.getLabel());
+ financialStatementAmounts.setProvisionDeprecationAmount(
+ provisionDeprecationAmount);
+ financialStatementAmounts.setLevel(
+ financialStatement.getLevel());
+ return financialStatementAmounts;
+ }
+
+ /**
+ * Calulate the amount of string contains a list of account
+ * account number seperate by ',' use methode stringToList from account service
+ * the list support '-' minus operation
+ * @return
+ */
+ public BigDecimal accountsNumberListToAmount (String accountsNumberList, FinancialStatementWayEnum financialStatementWayEnum, FinancialStatementWayEnum debitCredit, Date selectedBeginDate, Date selectedEndDate, TopiaContext topiaContext) throws LimaException{
+ BigDecimal amount = new BigDecimal(0);
try {
- // DEBIT & CREDIT
- String accountsString = financialStatement.getAccounts();
- BigDecimal amount = new BigDecimal(0);
- if (accountsString != null){
+ if (accountsNumberList != null){
//Remove Spaces
- accountsString = StringUtils.deleteWhitespace(accountsString);
- StringTokenizer stQuote = new StringTokenizer(accountsString, "-");
+ accountsNumberList = StringUtils.deleteWhitespace(accountsNumberList);
+ StringTokenizer stQuote = new StringTokenizer(accountsNumberList, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
List<Account> accountsList = accountServiceLocal.
@@ -426,102 +475,59 @@
BigDecimal resAmount = new BigDecimal(0);
for (Account account : accountsList) {
- log.debug(account.getAccountNumber());
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
+ BigDecimal tempAmount = new BigDecimal(0);
//check the way of financialstatement amount
- FinancialStatementWayEnum financialStatementWayEnum =
- financialStatement.getMasterFinancialStatement().getWay();
+ //exemple compte de résultat : charge -> débit, produit -> crédit
switch (financialStatementWayEnum) {
case BOTH:
- resAmount = resAmount.add(reportsDatas.getAmountSolde());
+ tempAmount = tempAmount.add(reportsDatas.getAmountSolde());
break;
case DEBIT:
- resAmount = resAmount.add(reportsDatas.getAmountDebit());
- resAmount = resAmount.subtract(reportsDatas.getAmountCredit());
+ tempAmount = tempAmount.add(reportsDatas.getAmountDebit());
+ tempAmount = tempAmount.subtract(reportsDatas.getAmountCredit());
break;
case CREDIT:
- resAmount = resAmount.add(reportsDatas.getAmountCredit());
- resAmount = resAmount.subtract(reportsDatas.getAmountDebit());
+ tempAmount = tempAmount.add(reportsDatas.getAmountCredit());
+ tempAmount = tempAmount.subtract(reportsDatas.getAmountDebit());
break;
}
+
+ //add the calcul in function of list type: allaccounts, debit or credit
+ switch (debitCredit) {
+ case BOTH:
+ resAmount = resAmount.add(tempAmount);
+ break;
+ case DEBIT:
+ if (reportsDatas.getSoldeDebit()){
+ resAmount = resAmount.add(tempAmount);
+ }
+ break;
+ case CREDIT:
+ if (!reportsDatas.getSoldeDebit()){
+ resAmount = resAmount.add(tempAmount);
+ }
+ break;
+ }
}
if (amount.doubleValue() == 0){
amount = resAmount;
}
+ //compte(s) précédé du signe -
else {
amount = amount.subtract(resAmount);
}
}
- }
-
- // CREDIT
- String creditAccountsString = financialStatement.getCreditAccounts();
- BigDecimal creditAmount = new BigDecimal(0);
- if (creditAccountsString != null){
- List<Account> creditAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(creditAccountsString, false, topiaContext);
- for (Account account : creditAccountsList) {
- ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
- selectedBeginDate, selectedEndDate, topiaContext);
- creditAmount = creditAmount.add(reportsDatas.getAmountCredit());
- }
- }
-
-
- // DEBIT
- String debitAccountsString = financialStatement.getDebitAccounts();
- BigDecimal debitAmount = new BigDecimal(0);
- if (debitAccountsString != null){
- List<Account> debitAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(debitAccountsString, false, topiaContext);
- for (Account account : debitAccountsList) {
- ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
- selectedBeginDate, selectedEndDate, topiaContext);
- debitAmount = debitAmount.add(reportsDatas.getAmountDebit());
- }
- }
-
-
- // PROVISION & DEPRECATION
- String provisionDeprecationAccountsString =
- financialStatement.getProvisionDeprecationAccounts();
- BigDecimal provisionDeprecationAmount = new BigDecimal(0);
- if (provisionDeprecationAccountsString != null){
- List<Account> provisionDeprecationAccountsList =
- accountServiceLocal.stringToListAccountsWithTransaction(
- provisionDeprecationAccountsString, false, topiaContext);
- for (Account account : provisionDeprecationAccountsList) {
- ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
- selectedBeginDate, selectedEndDate, topiaContext);
- provisionDeprecationAmount = provisionDeprecationAmount.add(reportsDatas.getAmountSolde());
- }
- }
-
- // set result
- amount = amount.add(creditAmount);
- amount = amount.add(debitAmount);
- financialStatementAmounts.setGrossAmount(amount);
- financialStatementAmounts.setLabel(financialStatement.getLabel());
- financialStatementAmounts.setProvisionDeprecationAmount(
- provisionDeprecationAmount);
- financialStatementAmounts.setLevel(
- financialStatement.getLevel());
-
- }
- catch (LimaException ex) {
- doCatch(topiaContext, ex, log);
- }
-
- return financialStatementAmounts;
+ }
+ }catch (LimaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ return amount;
}
-
@Override
public String checkFinancialStatementChart() throws LimaException {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -26,7 +26,6 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -37,6 +36,8 @@
import java.util.TreeMap;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.FinancialStatementWayEnum;
@@ -192,6 +193,7 @@
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
List<EntryEBPImpl> list = csv.parse(strat, csvReader);
Collections.sort(list, new EntryEBPComparator());
+ log.debug(list.size()+" list /n"+list);
// DAOs
AccountDAO accountDAO = LimaCallaoDAOHelper
@@ -364,14 +366,8 @@
account.setAccountNumber(accountNumber);
account.setLabel(label);
- // if account is class account : 1, 2, 3, 4, 5, 6, 7,…
- int nbCharAccountNumber = accountNumber.length();
- if (nbCharAccountNumber == 1) {
- accountService.createAccountWithTransaction(null,
- account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
- } else {
+ // if is thirdPart account
+ if (!StringUtils.isNumeric(accountNumber)){
Account masterAccount = null;
int i = 1;
while (masterAccount == null) {
@@ -381,11 +377,37 @@
.findByAccountNumber(masterAccountNumber);
i++;
}
- accountService.createAccountWithTransaction(
+ accountService.createSubLedgerWithTransaction(
masterAccount, account, topiaContext);
result += "SUCCES : Account" + accountNumber + " "
+ label + " added\n";
}
+ // else is account
+ else {
+ // if account is class account : 1, 2, 3, 4, 5, 6, 7,…
+ int nbCharAccountNumber = accountNumber.length();
+ if (nbCharAccountNumber == 1) {
+ accountService.createAccountWithTransaction(null,
+ account, topiaContext);
+ result += "SUCCES : Account" + accountNumber + " "
+ + label + " added\n";
+ }
+ else {
+ Account masterAccount = null;
+ int i = 1;
+ while (masterAccount == null) {
+ String masterAccountNumber = accountNumber
+ .substring(0, accountNumber.length() - i);
+ masterAccount = accountDAO
+ .findByAccountNumber(masterAccountNumber);
+ i++;
+ }
+ accountService.createAccountWithTransaction(
+ masterAccount, account, topiaContext);
+ result += "SUCCES : Account" + accountNumber + " "
+ + label + " added\n";
+ }
+ }
}
}
} catch (TopiaException eeeTE) {
@@ -512,46 +534,27 @@
}
/**
- * Remote methode to call entrybooks import from UI
+ * Remote methode to call entity import from UI
+ * This methode let import just on type of entity
*/
@Override
- public String importEntryBooksChartAsCSV(String datas) throws LimaException {
+ public String importAsCSV(String datas, ImportExportEntityEnum importExportEntityEnum) throws LimaException {
String result = "";
- TopiaContext topiaContext = null;
- try {
- topiaContext = beginTransaction();
-
- String[] nextLine = new String[1];
- CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
-
- while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == ImportExportEntityEnum.ENTRYBOOK) {
- result += importEntryBooksChartCSV(nextLine, topiaContext);
- }
- }
- } catch (TopiaException eeeTE) {
- doCatch(topiaContext, eeeTE, log);
- } catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader", eeeIO);
- } finally {
- doFinally(topiaContext, log);
- }
- return result;
- }
-
- /**
- * Remote methode to call financialStatements import from UI
- */
- @Override
- public String importFinancialStatementsChartAsCSV(String datas)
- throws LimaException {
- String result = "";
-
// FinancialStatements
- LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements =
- new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
-
+ LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements = null;
+ // Accounts
+ Map<String, AccountImport> accounts = null;
+
+ switch (importExportEntityEnum) {
+ case ACCOUNT:
+ accounts = new TreeMap<String, AccountImport>();
+ break;
+ case FINANCIALSTATEMENT:
+ financialStatements = new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
+ break;
+ }
+
TopiaContext topiaContext = null;
try {
topiaContext = beginTransaction();
@@ -560,51 +563,36 @@
CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == ImportExportEntityEnum.FINANCIALSTATEMENT) {
- result += importFinancialsStatementChartCSV(nextLine,
- financialStatements, topiaContext);
- }
- }
+ if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum) {
+ switch (importExportEntityEnum) {
+ case ENTRYBOOK:
+ result += importEntryBooksChartCSV(nextLine, topiaContext);
+ break;
- // create financialStatements
- result += createFinancialStatements(financialStatements,
- topiaContext);
- } catch (TopiaException eeeTE) {
- doCatch(topiaContext, eeeTE, log);
- } catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader", eeeIO);
- } finally {
- doFinally(topiaContext, log);
- }
- return result;
- }
+ case ACCOUNT:
+ result += importAccountsChartsCSV(nextLine, accounts,
+ topiaContext);
+ break;
+ case FINANCIALSTATEMENT:
- /**
- * Remote methode to call accounts import from UI
- */
- @Override
- public String importAccountsChartAsCSV(String datas) throws LimaException {
- String result = "";
-
- // Accounts
- Map<String, AccountImport> accounts = new TreeMap<String, AccountImport>();
-
- TopiaContext topiaContext = null;
- try {
- topiaContext = beginTransaction();
-
- String[] nextLine = new String[1];
- CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
-
- while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == ImportExportEntityEnum.ACCOUNT) {
- result += importAccountsChartsCSV(nextLine, accounts,
- topiaContext);
+ result += importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext);
+ break;
+ }
}
}
- // create accounts
- result += createAccounts(accounts, topiaContext);
+ //create entity
+ switch (importExportEntityEnum) {
+ case ACCOUNT:
+ result += createAccounts(accounts, topiaContext);
+ break;
+ case FINANCIALSTATEMENT:
+ result += createFinancialStatements(financialStatements,
+ topiaContext);
+ break;
+ }
+
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (IOException eeeIO) {
@@ -614,6 +602,7 @@
}
return result;
}
+
// ################ Import entities an put to lists ################
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -97,9 +97,10 @@
* Recursiv
* List entries for a period and an account
* Calculate the amounts
- * Two case:
+ * 3 cases:
* - for subaccount
* - for a foldaccounts, contains many accounts
+ * - for a foldthirdparts accounts
*/
@Override
public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
@@ -107,18 +108,28 @@
BigDecimal credit = new BigDecimal(0);
BigDecimal debit = new BigDecimal(0);
BigDecimal solde = new BigDecimal(0);
+ List<Entry> entries = new ArrayList<Entry>();
if (account != null){
- // First subaccount
+
+ //Get allsubaccounts and thirdParts accounts
List<Account> accounts = (List<Account>) account.getSubAccounts();
- accounts.addAll(account.getSubLedgers());
+ List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
+ if (thirdPartAccount != null){
+ ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
+ beginDate, endDate, topiaContext);
+ entries.addAll(subReportsDatas.getListEntry());
+ debit = debit.add(subReportsDatas.getAmountDebit());
+ credit = credit.add(subReportsDatas.getAmountCredit());
+ accounts.addAll(thirdPartAccount);
+ }
+ // is already subaccount
if (accounts.size() == 0){
reportsDatas = generateSubAccountReportsWithTransaction(account,
beginDate, endDate, topiaContext);
}
- //Second many account
+ // else is folder accounts contains many subs and thirds accoutns
else {
- List<Entry> entries = new ArrayList<Entry>();
- for (Account subAccount : accounts) {
+ for (Account subAccount : accounts) {
ReportsDatas subReportsDatas =
generateAccountReportsWithTransaction(subAccount,
beginDate,endDate, topiaContext);
@@ -462,7 +473,7 @@
selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
//if no filter account
if (selectedAccounts == null || selectedAccounts.equals("")){
- accounts = accountDAO.findAllSubAccounts();
+ accounts = accountDAO.findAll();
}
//build list account from selectedAccounts
else{
@@ -479,7 +490,7 @@
amount = new BigDecimal(0);
}
if (movementedFilter){
- if (amount.doubleValue() != 0){
+ if (reportsDatas.getAmountCredit().doubleValue() != 0 || reportsDatas.getAmountDebit().doubleValue() != 0){
// add balance sheet to balance trial
balanceTrial.addReportsDatas(reportsDatas);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -21,6 +21,7 @@
import javax.ejb.Remote;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.utils.ImportExportEntityEnum;
/**
* Import export service.
@@ -68,9 +69,5 @@
*/
public String importAllAsCSV(String path) throws LimaException;
- public String importAccountsChartAsCSV(String path) throws LimaException;
-
- public String importFinancialStatementsChartAsCSV(String path) throws LimaException;
-
- public String importEntryBooksChartAsCSV(String path) throws LimaException;
+ public String importAsCSV(String path, ImportExportEntityEnum importExportEntityEnum) throws LimaException;
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -1,4 +1,4 @@
-/* *##% Lima Swing
+/* *##% Lima Callao
* Copyright (C) 2008 - 2010 CodeLutin
*
* This program is free software; you can redistribute it and/or
@@ -25,25 +25,16 @@
public class AccountDAOImpl <E extends Account> extends AccountDAOAbstract<E> {
/**
- * List all subaccounts (no folderaccounts)
+ * List all subaccounts (no folderaccounts, exclude accounts contains thirdpart accounts)
* Sort by accout number in lexicographical order
*/
@Override
public List<Account> findAllSubAccounts() throws TopiaException {
TopiaQuery query = createQuery();
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
- .addWhere("not exists elements ("+subLedgersProperty+")")
.addOrder(Account.ACCOUNT_NUMBER);
- /* alternative query
- * wich are the best ? exist or count ?
- *
- * query.addWhere("size ("+subAccountsProperty+") = 0")
- * .addWhere("size ("+subLedgersProperty+") = 0");
- *
- */
return (List<Account>) findAllByQuery(query);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -269,23 +269,33 @@
//
form.setLocationRelativeTo(view);
form.setVisible(true);
+
+ ImportExport importExport = ImportExport.getInstance(view);
Object value = form.getRadioButtons().getSelectedValue();
// if action confirmed
if (value != null){
-
AccountsChartEnum defaultAccountsChartEnum =
(AccountsChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
- defaultAccountsChartEnum.getFilePath(), true);
+ //Import accounts chart
+ switch (defaultAccountsChartEnum) {
+ case IMPORTEBP:
+ importExport.importExport(ImportExportEnum.EBP_ACCOUNTCHARTS_IMPORT,
+ defaultAccountsChartEnum.getFilePath(), false);
+ break;
+
+ default:
+ importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
+ defaultAccountsChartEnum.getFilePath(), false);
+ break;
+ }
}
}
@Override
- public void notifyMethod(String serviceName, String methodName) {
+ public void notifyMethod(String serviceName, String methodeName) {
- if (methodName.contains("importAccounts") || methodName.contains("importAll")){
+ if (methodeName.contains("importAccounts") || methodeName.contains("importAll") || methodeName.contains("importAsCSV")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -173,10 +173,10 @@
}
@Override
- public void notifyMethod(String serviceName, String methodName) {
+ public void notifyMethod(String serviceName, String methodeName) {
//refresh on import datas
- if (methodName.contains("importEntryBooks") || methodName.contains("importAll")){
+ if (methodeName.contains("importEntryBooks") || methodeName.contains("importAll") || methodeName.contains("importAs")){
fireTableDataChanged();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -317,7 +317,7 @@
@Override
public void notifyMethod(String serviceName, String methodName) {
- if (methodName.contains("importFinancialStatements") || methodName.contains("importAll")){
+ if (methodName.contains("importFinancialStatements") || methodName.contains("importAll") || methodName.contains("importAs")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -343,6 +343,8 @@
public void addFinancialTransaction() throws LimaException{
/* Calling transaction service */
FinancialTransaction financialTransaction = new FinancialTransactionImpl();
+ financialTransaction.setAmountDebit(new BigDecimal(0));
+ financialTransaction.setAmountCredit(new BigDecimal(0));
//if a period is selected
if (selectedFinancialPeriod != null){
financialTransaction.setFinancialPeriod(selectedFinancialPeriod);
@@ -392,6 +394,7 @@
FinancialTransaction currentTransaction = null;
Object currentRow = cacheDataList.get(row);
Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
//check if current row is a transaction or an entry
if (currentRow instanceof FinancialTransaction) {
currentTransaction = (FinancialTransaction)currentRow;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -114,7 +114,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("Account") || methodeName.contains("importAll")){
+ if (methodeName.contains("Account") || methodeName.contains("importAll") || methodeName.contains("importAsCSV")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -131,7 +131,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("EntryBook") || methodeName.contains("importAll")){
+ if (methodeName.contains("EntryBook") || methodeName.contains("importAll") || methodeName.contains("importAs")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -43,6 +43,7 @@
import org.chorem.lima.business.ExportServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.enums.EncodingEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
@@ -138,15 +139,15 @@
break;
case CSV_ACCOUNTCHARTS_IMPORT:
datas = extractFile(filePath, charset.getEncoding());
- result = importService.importAccountsChartAsCSV(datas);
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.ACCOUNT);
break;
case CSV_ENTRYBOOKS_IMPORT:
datas = extractFile(filePath, charset.getEncoding());
- result = importService.importEntryBooksChartAsCSV(datas);
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.ENTRYBOOK);
break;
case CSV_FINANCIALSTATEMENTS_IMPORT:
datas = extractFile(filePath, charset.getEncoding());
- result = importService.importFinancialStatementsChartAsCSV(datas);
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.FINANCIALSTATEMENT);
break;
case EBP_ACCOUNTCHARTS_IMPORT:
//For windows ebp
1
0
Author: jpepin
Date: 2010-08-12 15:51:19 +0200 (Thu, 12 Aug 2010)
New Revision: 3000
Url: http://chorem.org/repositories/revision/lima/3000
Log:
Ajout d'une fonction pour v?\195?\169rifier la concordance entre le plan BCR et le plan des comptes.
Refactor du type Double vers BigDecimal.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -38,7 +38,6 @@
import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
-import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
@@ -440,9 +439,10 @@
/**
* Convert string of extends number to list of accounts
* Example '22, 45..48, 67' -> [22, 45, 46, 47, 48, 67]
+ * SubAccountsMode return list of existing subaccounts ex 6 return : 61, 62, .., 69, 610, .., 619 etc
*/
@Override
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, TopiaContext topiaContext) throws LimaException{
+ public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException{
List<Account> accounts = new ArrayList<Account>();
if (selectedAccounts != null){
try {
@@ -452,45 +452,96 @@
selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
//use hashset for delete duplicate numbers
HashSet<String> accountNumbers = new HashSet<String>();
- //Split comma
- StringTokenizer stComma = new StringTokenizer(selectedAccounts, ",");
- while (stComma.hasMoreTokens()) {
- String s = stComma.nextToken();
- if (s.contains("..")){
- //Split ..
- String stringDoubleDot[] = s.split("\\.\\.");
- int lowAccount=Integer.parseInt(stringDoubleDot[0]);
- int highAccount=Integer.parseInt(stringDoubleDot[1]);
- for (int i=lowAccount; i <= highAccount; i++) {
- accountNumbers.add(String.valueOf(i));
- }
- }
- else{
- accountNumbers.add(s);
- }
- }
-
+ HashSet<String> accountNumbersToRemove = new HashSet<String>();
+ Boolean first = true;
+ StringTokenizer stStar = new StringTokenizer(selectedAccounts, "-");
+ while (stStar.hasMoreTokens()) {
+ String subString = stStar.nextToken();
+
+ //Split comma
+ StringTokenizer stComma = new StringTokenizer(subString, ",");
+ while (stComma.hasMoreTokens()) {
+ String s = stComma.nextToken();
+ if (s.contains("..")){
+ //Split ..
+ String stringDoubleDot[] = s.split("\\.\\.");
+ int lowAccount=Integer.parseInt(stringDoubleDot[0]);
+ int highAccount=Integer.parseInt(stringDoubleDot[1]);
+ for (int i=lowAccount; i <= highAccount; i++) {
+ //if first add accounts, else remove
+ if (first){
+ accountNumbers.add(String.valueOf(i));
+ }
+ else {
+ accountNumbersToRemove.add(String.valueOf(i));
+ }
+ }
+ }
+ else{
+ //if first
+ if (first){
+ accountNumbers.add(s);
+ }
+ else {
+ accountNumbersToRemove.add(s);
+ }
+ }
+ }
+ first=false;
+ }
+ //add all accounts
+ log.debug("accountNumbers "+accountNumbers);
for (String accountNumber : accountNumbers) {
- Account account = accountDAO.findByAccountNumber(accountNumber);
- if (account == null){
- TopiaQuery query = accountDAO.createQuery();
- query.addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
- List<Account> accountsResult = accountDAO.findAllByQuery(query);
- if (accountsResult != null){
- accounts.addAll(accountsResult);
+ if (subAccountsMode){
+ Account account = accountDAO.findSubAccountByNumber(accountNumber);
+ if (account == null){
+ TopiaQuery query = accountDAO.createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere("not exists elements ("+subLedgersProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ List<Account> accountsResult = accountDAO.findAllByQuery(query);
+ if (accountsResult != null){
+ accounts.addAll(accountsResult);
+ }
}
+ //add account if exist
+ else {
+ accounts.add(account);
+ }
}
- //add account if exist
else {
- accounts.add(account);
+ Account account = accountDAO.findByAccountNumber(accountNumber);
+ if (account != null){
+ accounts.add(account);
+ }
}
+
}
+ //remove all accounts
+ log.debug("accountNumbersToRemove "+accountNumbersToRemove);
+ for (String accountNumber : accountNumbersToRemove) {
+ Account account = null;
+ if (subAccountsMode){
+ account = accountDAO.findSubAccountByNumber(accountNumber);
+ }
+ else {
+ account = accountDAO.findByAccountNumber(accountNumber);
+ }
+ if (account != null) {
+ accounts.remove(account);
+ }
+ }
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
}
}
-
+ for (Account account : accounts) {
+ log.debug("accounts " + account.getAccountNumber());
+ }
+
return accounts;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
@@ -377,10 +378,16 @@
String label = financialStatementAmount.getLabel();
int level = financialStatementAmount.getLevel();
- Double grossAmount =
+ BigDecimal grossAmount =
financialStatementAmount.getGrossAmount();
- Double provisionDeprecationAmount =
+ if (grossAmount == null){
+ grossAmount = new BigDecimal(0);
+ }
+ BigDecimal provisionDeprecationAmount =
financialStatementAmount.getProvisionDeprecationAmount();
+ if (provisionDeprecationAmount == null){
+ provisionDeprecationAmount = new BigDecimal(0);
+ }
if (financialStatementAmount.getSubAmount() && level==1){
cell.setGrayFill(0.88f);
@@ -414,7 +421,7 @@
c.setHorizontalAlignment(Element.ALIGN_LEFT);
t.addCell(c);
//cell2
- if (grossAmount != 0.0){
+ if (grossAmount.doubleValue() != 0){
phrase = new Phrase(String.valueOf(
grossAmount), normalFont);
}
@@ -423,7 +430,7 @@
}
t.addCell(phrase);
//cell 3
- if (provisionDeprecationAmount != 0.0){
+ if (provisionDeprecationAmount.doubleValue() != 0){
phrase = new Phrase(String.valueOf(
provisionDeprecationAmount), normalFont);
}
@@ -432,9 +439,10 @@
}
t.addCell(phrase);
//cell 4
- if (grossAmount-provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(
- grossAmount-provisionDeprecationAmount), normalFont);
+ BigDecimal solde = grossAmount;
+ solde = solde.subtract(provisionDeprecationAmount);
+ if (solde.doubleValue() != 0){
+ phrase = new Phrase(solde.toString(), normalFont);
}
else {
phrase = new Phrase("");
@@ -476,8 +484,8 @@
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- Double currentAmountDebit = 0.0;
- Double currentAmountCredit = 0.0;
+ BigDecimal currentAmountDebit = new BigDecimal(0);
+ BigDecimal currentAmountCredit = new BigDecimal(0);
String accountcarry ="";
String filePath = path+File.separator+DocumentsEnum.LEDGER.getFileName();
@@ -537,8 +545,12 @@
for (Object object : subList) {
if (object instanceof Entry){
Entry entry = (Entry) object;
- currentAmountDebit += entry.getDebit() ? entry.getAmount() : 0;
- currentAmountCredit += entry.getDebit() ? 0 : entry.getAmount();
+ if (entry.getDebit()){
+ currentAmountDebit = currentAmountDebit.add(entry.getAmount());
+ }
+ else {
+ currentAmountCredit = currentAmountCredit.add(entry.getAmount());
+ }
}
else {
ReportsDatas reportsDatas = (ReportsDatas) object;
@@ -636,8 +648,8 @@
if (account != null){
accountS = account.getAccountNumber()+"\t"+account.getLabel();
}
- Double amountCredit = reportsDatas.getAmountCredit();
- Double amountDebit = reportsDatas.getAmountDebit();
+ BigDecimal amountCredit = reportsDatas.getAmountCredit();
+ BigDecimal amountDebit = reportsDatas.getAmountDebit();
Cell c = new Cell(new Phrase(accountS, boldFont));
c.setColspan(4);
@@ -645,7 +657,9 @@
t.addCell(c);
t.addCell(new Phrase(String.valueOf(amountDebit), boldFont));
t.addCell(new Phrase(String.valueOf(amountCredit), boldFont));
- t.addCell(new Phrase(String.valueOf(amountDebit-amountCredit), boldFont));
+ BigDecimal solde = amountDebit;
+ solde = solde.subtract(amountCredit);
+ t.addCell(new Phrase(String.valueOf(solde), boldFont));
}
else {
Entry entry = (Entry) object;
@@ -655,21 +669,27 @@
if (entryBook != null){
entryBookCode = entryBook.getCode();
}
+ BigDecimal amountDebit = new BigDecimal(0),
+ amountCredit = new BigDecimal(0);
+ if (entry.getDebit()){
+ amountDebit = entry.getAmount();
+ }
+ else {
+ amountCredit = entry.getAmount();
+ }
- Double amountDebit = entry.getDebit() ? entry.getAmount() : 0;
- Double amountCredit = entry.getDebit() ? 0 : entry.getAmount();
-
t.addCell(new Phrase(dateFormat.format(
entry.getFinancialTransaction().getTransactionDate()),
normalFont));
t.addCell(new Phrase(entryBookCode, normalFont));
t.addCell(new Phrase(entry.getVoucher(), normalFont));
t.addCell(new Phrase(entry.getDescription(), normalFont));
- t.addCell(new Phrase(String.valueOf(amountDebit),
+ t.addCell(new Phrase(amountDebit.toString(),
normalFont));
- t.addCell(new Phrase(String.valueOf(amountCredit),
+ t.addCell(new Phrase(amountCredit.toString(),
normalFont));
- t.addCell(new Phrase(String.valueOf(amountDebit-amountCredit),
+ BigDecimal solde = amountDebit.subtract(amountCredit);
+ t.addCell(new Phrase(solde.toString(),
normalFont));
}
@@ -681,7 +701,7 @@
return t;
}
- public Table createLedgerAmountTable(String account, String title, Double credit, Double debit){
+ public Table createLedgerAmountTable(String account, String title, BigDecimal debit, BigDecimal credit){
Table t = null;
try {
t = new Table(5,1);
@@ -695,7 +715,6 @@
cell.setBorder(Rectangle.RIGHT);
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
t.setDefaultCell(cell);
-
Cell accountCell = new Cell(new Phrase(account, boldFont));
accountCell.setHorizontalAlignment(Element.ALIGN_LEFT);
accountCell.setBorder(Rectangle.NO_BORDER);
@@ -703,7 +722,7 @@
t.addCell(new Phrase(title, boldFont));
t.addCell(new Phrase(debit.toString(), boldFont));
t.addCell(new Phrase(credit.toString(), boldFont));
- Double solde = debit-credit;
+ BigDecimal solde = debit.subtract(credit);
t.addCell(new Phrase(solde.toString(), boldFont));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
@@ -765,22 +784,22 @@
List<Entry> entries = entryDAO.findAllByQuery(query);
List<Object[]> results = new ArrayList<Object[]>();
- Double debit = 0.0;
- Double credit = 0.0;
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal credit = new BigDecimal(0);
query.setSelect(Entry.DEBIT, "SUM("+Entry.AMOUNT+")");
query.addGroup(Entry.DEBIT);
results = query.execute(transaction);
int nbAmount = results.size();
if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
@@ -913,7 +932,7 @@
return t;
}
- public Table createEntryBooksAmountTable(String title, Double credit, Double debit){
+ public Table createEntryBooksAmountTable(String title, BigDecimal credit, BigDecimal debit){
Table t = null;
try {
t = new Table(3,1);
@@ -954,10 +973,10 @@
String hourS = hourFormat.format(newDate);
String fileDateS = filedateFormat.format(newDate);
- Double currentAmountDebit = 0.0;
- Double currentAmountCredit = 0.0;
- Double currentSoldeDebit = 0.0;
- Double currentSoldeCredit = 0.0;
+ BigDecimal currentAmountDebit = new BigDecimal(0);
+ BigDecimal currentAmountCredit = new BigDecimal(0);
+ BigDecimal currentSoldeDebit = new BigDecimal(0);
+ BigDecimal currentSoldeCredit = new BigDecimal(0);
String filePath = path+File.separator+DocumentsEnum.BALANCE.getFileName();
FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension());
@@ -1014,12 +1033,14 @@
paragraphTable.add(table);
chapter.add(paragraphTable);
for (ReportsDatas reportsDatas : subList){
- currentAmountDebit += reportsDatas.getAmountDebit();
- currentAmountCredit += reportsDatas.getAmountCredit();
- currentSoldeDebit +=
- reportsDatas.getSoldeDebit() ? reportsDatas.getAmountSolde() : 0;
- currentSoldeCredit +=
- reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde();
+ currentAmountDebit = currentAmountDebit.add(reportsDatas.getAmountDebit());
+ currentAmountCredit = currentAmountCredit.add(reportsDatas.getAmountCredit());
+ if (reportsDatas.getSoldeDebit()){
+ currentSoldeDebit = currentSoldeDebit.add(reportsDatas.getAmountSolde());
+ }
+ else {
+ currentSoldeCredit = currentSoldeCredit.add(reportsDatas.getAmountSolde());
+ }
}
//forward amounts
if (n > max && i <= n-max){
@@ -1118,7 +1139,7 @@
return t;
}
- public Table createBalanceAmountTable(String title, Double amountDebit, Double amountCredit, Double soldeDebit, Double soldeCredit ){
+ public Table createBalanceAmountTable(String title, BigDecimal amountDebit, BigDecimal amountCredit, BigDecimal soldeDebit, BigDecimal soldeCredit){
Table t = null;
try {
t = new Table(5,1);
@@ -1191,21 +1212,21 @@
financialPeriodDAO.findAllByQuery(financialPeriodsQuery);
List<GeneralEntryBooksDatas> list = new ArrayList<GeneralEntryBooksDatas>();
- Double amountDebit = 0.0;
- Double amountCredit = 0.0;
+ BigDecimal amountDebit = new BigDecimal(0);
+ BigDecimal amountCredit = new BigDecimal(0);
for (FinancialPeriod financialPeriod : financialPeriods) {
List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList =
closedPeriodicEntryBookDAO.findAllByDates(
financialPeriod.getBeginDate(), financialPeriod.getEndDate());
- Double subAmountDebit = 0.0;
- Double subAmountCredit = 0.0;
+ BigDecimal subAmountDebit = new BigDecimal(0);
+ BigDecimal subAmountCredit = new BigDecimal(0);
for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) {
List<Object[]> results = new ArrayList<Object[]>();
TopiaQuery query = entryDAO.createQuery();
- Double debit = 0.0;
- Double credit = 0.0;
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal credit = new BigDecimal(0);
String financialPeriodProperty = TopiaQuery.getProperty(
Entry.FINANCIAL_TRANSACTION,
@@ -1223,15 +1244,15 @@
int nbAmount = results.size();
if(nbAmount == 2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount == 1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
GeneralEntryBooksDatas generalEntryBooksDatas =
@@ -1245,8 +1266,8 @@
generalEntryBooksDatas.setCredit(credit);
generalEntryBooksDatas.setDebit(debit);
list.add(generalEntryBooksDatas);
- subAmountCredit += credit;
- subAmountDebit += debit;
+ subAmountCredit = subAmountCredit.add(credit);
+ subAmountDebit = subAmountDebit.add(debit);
}
GeneralEntryBooksDatas generalEntryBooksDatas =
new GeneralEntryBooksDatasImpl();
@@ -1256,8 +1277,8 @@
generalEntryBooksDatas.setPeriod(
monthYearFormat.format(financialPeriod.getBeginDate()));
list.add(generalEntryBooksDatas);
- amountCredit += subAmountCredit;
- amountDebit += subAmountDebit;
+ amountCredit = amountCredit.add(subAmountCredit);
+ amountDebit = amountDebit.add(subAmountDebit);
}
GeneralEntryBooksDatas generalEntryBooksDatas =
new GeneralEntryBooksDatasImpl();
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -21,6 +21,7 @@
import java.io.IOException;
import java.io.StringWriter;
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.ejb.Stateless;
@@ -140,7 +141,7 @@
nextLine[3] = accountNumber;
nextLine[5] = '"'+entry.getDescription()+'"';
nextLine[6] = '"'+entry.getVoucher()+'"';
- nextLine[7] = new Double(entry.getAmount()).toString();
+ nextLine[7] = entry.getAmount().toString();
nextLine[8] = debitcredit;
// Ajoute la ligne au fichier
@@ -492,10 +493,8 @@
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] =
SDateFormat.format(financialTransaction.getTransactionDate());
- nextLine[3] = new Double(
- financialTransaction.getAmountDebit()).toString();
- nextLine[4] = new Double(
- financialTransaction.getAmountCredit()).toString();
+ nextLine[3] = financialTransaction.getAmountDebit().toString();
+ nextLine[4] = financialTransaction.getAmountCredit().toString();
nextLine[5] =
SDateFormat.format(financialTransaction.getFinancialPeriod().
getBeginDate());
@@ -514,7 +513,7 @@
nextLine[0] = ImportExportEntityEnum.ENTRY.getLabel();
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] = entry.getDescription();
- nextLine[3] = new Double(entry.getAmount()).toString();
+ nextLine[3] = entry.getAmount().toString();
nextLine[4] = new Boolean(entry.getDebit()).toString();
nextLine[5] = entry.getLettering();
nextLine[6] = entry.getDetail();
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -20,6 +20,8 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -308,7 +310,7 @@
List<FinancialStatement> financialStatements =
getChildrenFinancialStatement(financialStatement);
try {
- Double grossAmount = 0.0, provisionDeprecationAmount = 0.0;
+ BigDecimal grossAmount = new BigDecimal(0), provisionDeprecationAmount = new BigDecimal(0);
List<FinancialStatementAmounts> subResult =
new ArrayList<FinancialStatementAmounts>();
for (FinancialStatement subFinancialStatement : financialStatements) {
@@ -317,19 +319,20 @@
selectedBeginDate, selectedEndDate, topiaContext);
if (!subFinancialStatement.getHeader()){
//on calcul
- grossAmount += financialStatementAmounts.getGrossAmount();
- provisionDeprecationAmount +=
- financialStatementAmounts.getProvisionDeprecationAmount();
+ grossAmount = grossAmount.add(financialStatementAmounts.getGrossAmount());
+ provisionDeprecationAmount = provisionDeprecationAmount.add(
+ financialStatementAmounts.getProvisionDeprecationAmount());
subResult.add(financialStatementAmounts);
}
else {
FinancialStatementDatas financialStatementDatas =
financialStatementReport(subFinancialStatement,
selectedBeginDate, selectedEndDate, result, topiaContext);
- grossAmount += financialStatementDatas.
- getFinancialStatementAmounts().getGrossAmount();
- provisionDeprecationAmount += financialStatementDatas.
- getFinancialStatementAmounts().getProvisionDeprecationAmount();
+ grossAmount = grossAmount.add(financialStatementDatas.
+ getFinancialStatementAmounts().getGrossAmount());
+ provisionDeprecationAmount = provisionDeprecationAmount.
+ add(financialStatementDatas.getFinancialStatementAmounts().
+ getProvisionDeprecationAmount());
FinancialStatementAmounts headerfinancialStatementAmounts =
@@ -371,8 +374,8 @@
subResult.add(headerfinancialStatementAmounts);
}
else {
- headerfinancialStatementAmounts.setGrossAmount(0);
- headerfinancialStatementAmounts.setProvisionDeprecationAmount(0);
+ headerfinancialStatementAmounts.setGrossAmount(new BigDecimal(0));
+ headerfinancialStatementAmounts.setProvisionDeprecationAmount(new BigDecimal(0));
subResult.add(headerfinancialStatementAmounts);
}
//ajoute liste
@@ -411,8 +414,7 @@
try {
// DEBIT & CREDIT
String accountsString = financialStatement.getAccounts();
- log.debug("\n" + accountsString);
- Double amount = 0.0;
+ BigDecimal amount = new BigDecimal(0);
if (accountsString != null){
//Remove Spaces
accountsString = StringUtils.deleteWhitespace(accountsString);
@@ -420,8 +422,8 @@
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
List<Account> accountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(s, topiaContext);
- Double resAmount = 0.0;
+ stringToListAccountsWithTransaction(s, false, topiaContext);
+ BigDecimal resAmount = new BigDecimal(0);
for (Account account : accountsList) {
log.debug(account.getAccountNumber());
@@ -434,51 +436,53 @@
financialStatement.getMasterFinancialStatement().getWay();
switch (financialStatementWayEnum) {
case BOTH:
- resAmount += reportsDatas.getAmountSolde();
+ resAmount = resAmount.add(reportsDatas.getAmountSolde());
break;
case DEBIT:
- resAmount += reportsDatas.getAmountDebit()-reportsDatas.getAmountCredit();
+ resAmount = resAmount.add(reportsDatas.getAmountDebit());
+ resAmount = resAmount.subtract(reportsDatas.getAmountCredit());
break;
case CREDIT:
- resAmount += reportsDatas.getAmountCredit()-reportsDatas.getAmountDebit();
+ resAmount = resAmount.add(reportsDatas.getAmountCredit());
+ resAmount = resAmount.subtract(reportsDatas.getAmountDebit());
break;
}
}
- if (amount == 0){
- amount=resAmount;
+ if (amount.doubleValue() == 0){
+ amount = resAmount;
}
else {
- amount-=resAmount;
+ amount = amount.subtract(resAmount);
}
}
}
// CREDIT
String creditAccountsString = financialStatement.getCreditAccounts();
- Double creditAmount = 0.0;
+ BigDecimal creditAmount = new BigDecimal(0);
if (creditAccountsString != null){
List<Account> creditAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(creditAccountsString, topiaContext);
+ stringToListAccountsWithTransaction(creditAccountsString, false, topiaContext);
for (Account account : creditAccountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- creditAmount += reportsDatas.getAmountCredit();
+ creditAmount = creditAmount.add(reportsDatas.getAmountCredit());
}
}
// DEBIT
String debitAccountsString = financialStatement.getDebitAccounts();
- Double debitAmount = 0.0;
+ BigDecimal debitAmount = new BigDecimal(0);
if (debitAccountsString != null){
List<Account> debitAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(debitAccountsString, topiaContext);
+ stringToListAccountsWithTransaction(debitAccountsString, false, topiaContext);
for (Account account : debitAccountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- debitAmount += reportsDatas.getAmountDebit();
+ debitAmount = debitAmount.add(reportsDatas.getAmountDebit());
}
}
@@ -486,22 +490,23 @@
// PROVISION & DEPRECATION
String provisionDeprecationAccountsString =
financialStatement.getProvisionDeprecationAccounts();
- Double provisionDeprecationAmount = 0.0;
+ BigDecimal provisionDeprecationAmount = new BigDecimal(0);
if (provisionDeprecationAccountsString != null){
List<Account> provisionDeprecationAccountsList =
accountServiceLocal.stringToListAccountsWithTransaction(
- provisionDeprecationAccountsString, topiaContext);
+ provisionDeprecationAccountsString, false, topiaContext);
for (Account account : provisionDeprecationAccountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- provisionDeprecationAmount += reportsDatas.getAmountSolde();
+ provisionDeprecationAmount = provisionDeprecationAmount.add(reportsDatas.getAmountSolde());
}
}
// set result
- financialStatementAmounts.setGrossAmount(
- amount+creditAmount+debitAmount);
+ amount = amount.add(creditAmount);
+ amount = amount.add(debitAmount);
+ financialStatementAmounts.setGrossAmount(amount);
financialStatementAmounts.setLabel(financialStatement.getLabel());
financialStatementAmounts.setProvisionDeprecationAmount(
provisionDeprecationAmount);
@@ -520,36 +525,43 @@
@Override
public String checkFinancialStatementChart() throws LimaException {
- String result = "";
- List<Account> accountsList = new ArrayList<Account>();
-
+ String result ="";
TopiaContext transaction = null;
try {
transaction = beginTransaction();
AccountDAO accountDAO =
LimaCallaoDAOHelper.getAccountDAO(transaction);
+ FinancialStatementDAO financialStatementDAO =
+ LimaCallaoDAOHelper.getFinancialStatementDAO(transaction);
- accountsList = accountDAO.findAllSubAccounts();
- Collections.sort(accountsList, new AccountComparator());
-
+ List<Account> accountsList = accountDAO.findAllSubAccounts();
+
+ List<FinancialStatement> financialStatementsList =
+ financialStatementDAO.findAll();
+
+
+ for (FinancialStatement financialStatement : financialStatementsList) {
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getAccounts(), true, transaction));
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getCreditAccounts(), true, transaction));
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getDebitAccounts(), true, transaction));
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getProvisionDeprecationAccounts(), true, transaction));
+ }
+
for (Account account : accountsList) {
- Boolean find = false;
- String accountNumber = account.getAccountNumber();
- if (accountNumber.length()>1){
- while (!find && accountNumber.length() > 1){
- log.debug(accountNumber);
- List<FinancialStatement> financialStatements =
- findFinancialStatementByAccountNumber(accountNumber, transaction);
- log.debug(financialStatements);
- if (!(find = financialStatements.size() > 0)){
- accountNumber = accountNumber.substring(0, accountNumber.length()-1);
- }
- }
-
- if (!find){
- result += "NOT FOUND : "+account.getAccountNumber()+"\n";
- }
- }
+
+ result += "NOT FOUND : "+account.getAccountNumber()+"\n";
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -20,6 +20,8 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
@@ -80,6 +82,7 @@
public void createFinancialTransactionWithTransaction(
FinancialTransaction financialtransaction, TopiaContext topiaContext)
throws LimaException {
+ log.debug(financialtransaction);
try {
//check if the financial period is blocked
accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(
@@ -439,22 +442,32 @@
accountingRules.updateEntryRules(entry, entryOld, topiaContext);
//get new entry amounts
- Double entryAmount = entry.getAmount();
- Boolean entryAmountBool = entry.getDebit();
- Double entryDebit = entryAmountBool ? entryAmount : 0;
- Double entryCredit = entryAmountBool ? 0 : entryAmount;
+ BigDecimal entryAmount = entry.getAmount();
+ Boolean entryAmountIsDebit = entry.getDebit();
+ BigDecimal entryDebit = new BigDecimal(0), entryCredit = new BigDecimal(0);
+ if (entryAmountIsDebit){
+ entryDebit = entryAmount;
+ }
+ else {
+ entryCredit = entryAmount;
+ }
//get old entry amounts
- Double entryAmountOld = entryOld.getAmount();
- Boolean entryAmountBoolOld = entryOld.getDebit();
- Double entryDebitOld = entryAmountBoolOld ? entryAmountOld : 0;
- Double entryCreditOld = entryAmountBoolOld ? 0 : entryAmountOld;
+ BigDecimal entryAmountOld = entryOld.getAmount();
+ Boolean entryAmountOldIsDebit = entryOld.getDebit();
+ BigDecimal entryDebitOld = new BigDecimal(0), entryCreditOld = new BigDecimal(0);
+ if (entryAmountOldIsDebit){
+ entryDebitOld = entryAmountOld;
+ }
+ else {
+ entryCreditOld = entryAmountOld;
+ }
//FIXME PEPIN 20100520 conflict object already instanciate
// Exist best solution ?
entryOld.setAccount(entry.getAccount());
entryOld.setAmount(entryAmount);
- entryOld.setDebit(entryAmountBool);
+ entryOld.setDebit(entryAmountIsDebit);
entryOld.setDescription(entry.getDescription());
entryOld.setVoucher(entry.getVoucher());
entryOld.setFinancialTransaction(entry.getFinancialTransaction());
@@ -464,13 +477,17 @@
//calculate financial transaction amounts
FinancialTransaction financialTransaction =
entryOld.getFinancialTransaction();
- Double amountDebit = financialTransaction.getAmountDebit();
- Double amountCredit = financialTransaction.getAmountCredit();
- financialTransaction.setAmountDebit(
- amountDebit-entryDebitOld+entryDebit);
- financialTransaction.setAmountCredit(
- amountCredit-entryCreditOld+entryCredit);
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ amountDebit = amountDebit.subtract(entryDebitOld);
+ amountDebit = amountDebit.add(entryDebit);
+ financialTransaction.setAmountDebit(amountDebit);
+
+ BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ amountCredit = amountCredit.subtract(entryCreditOld);
+ amountCredit = amountCredit.add(entryCredit);
+ financialTransaction.setAmountCredit(amountCredit);
+
//update financial transaction
updateFinancialTransactionWithTransaction(
financialTransaction, topiaContext);
@@ -503,18 +520,26 @@
entry.getFinancialTransaction(), topiaContext);
//get entry amounts
- Double entryAmount = entry.getAmount();
- Boolean entryAmountBool = entry.getDebit();
- Double entryDebit = entryAmountBool ? entryAmount : 0;
- Double entryCredit = entryAmountBool ? 0 : entryAmount;
+ BigDecimal entryAmount = entry.getAmount();
+ Boolean entryAmountIsDebit = entry.getDebit();
+ BigDecimal entryDebit = new BigDecimal(0), entryCredit = new BigDecimal(0);
+ if (entryAmountIsDebit){
+ entryDebit = entryAmount;
+ }
+ else {
+ entryCredit = entryAmount;
+ }
//calculate financial transaction amounts
FinancialTransaction financialTransaction =
entry.getFinancialTransaction();
- Double amountDebit = financialTransaction.getAmountDebit();
- Double amountCredit = financialTransaction.getAmountCredit();
- financialTransaction.setAmountDebit(amountDebit-entryDebit);
- financialTransaction.setAmountCredit(amountCredit-entryCredit);
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ amountDebit = amountDebit.subtract(entryDebit);
+ financialTransaction.setAmountDebit(amountDebit);
+
+ BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ amountCredit = amountCredit.subtract(entryCredit);
+ financialTransaction.setAmountCredit(amountCredit);
//update financial transaction
updateFinancialTransactionWithTransaction(
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -21,10 +21,12 @@
import java.io.IOException;
import java.io.StringReader;
+import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -65,6 +67,7 @@
import org.chorem.lima.business.ejbinterface.ImportService;
import org.chorem.lima.business.ejbinterface.ImportServiceLocal;
import org.chorem.lima.business.utils.AccountEBPComparator;
+import org.chorem.lima.business.utils.EntryEBPComparator;
import org.chorem.lima.business.utils.FiscalPeriodComparator;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
@@ -188,16 +191,20 @@
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
List<EntryEBPImpl> list = csv.parse(strat, csvReader);
+ Collections.sort(list, new EntryEBPComparator());
// DAOs
AccountDAO accountDAO = LimaCallaoDAOHelper
.getAccountDAO(topiaContext);
EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
.getEntryBookDAO(topiaContext);
+ List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriods();
+ Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
+ int nbFiscalPeriods = fiscalPeriods.size();
FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper
.getFinancialPeriodDAO(topiaContext);
- if (financialPeriodDAO.findAll().size() == 0) {
+ if (nbFiscalPeriods == 0) {
throw new LimaBusinessException(
"Can't import entries, no fiscalperiod is open");
}
@@ -208,18 +215,33 @@
Entry entry = new EntryImpl();
Account account = accountDAO.findByAccountNumber(entryEBP
.getCompte());
+
+ Date date = epbDateFormat.parse(entryEBP.getDatEcr());
+ Date beginDate = fiscalPeriods.get(0).getBeginDate();
+ Date endDate = fiscalPeriods.get(nbFiscalPeriods-1).getEndDate();
+
// if account not exist not export
if (account == null) {
throw new LimaBusinessException(
"FAILED : Account "
+ entryEBP.getCompte()
+ " not exist !\n"
- + "Import or create all accounts before import entries");
- } else {
+ + "Import aborted ! Create all accounts before import entries");
+ }
+
+ else if (date.compareTo(beginDate) < 0 || date.compareTo(endDate) > 0){
+
+ result += "WARNING : " + date + " entries is out of range of" +
+ " opened fiscal periods. "
+ + "Entry was skip !\n";
+ }
+ else {
entry.setAccount(account);
- Double debit = new Double(entryEBP.getDebit());
- Double credit = new Double(entryEBP.getCredit());
- if (debit == 0) {
+ BigDecimal debit = new BigDecimal(entryEBP.getDebit());
+ log.debug(debit);
+ BigDecimal credit = new BigDecimal(entryEBP.getCredit());
+ log.debug(credit);
+ if (debit.doubleValue() == 0) {
entry.setDebit(false);
entry.setAmount(credit);
} else {
@@ -229,7 +251,6 @@
entry.setDescription(entryEBP.getLibelle());
entry.setLettering(entryEBP.getLettre());
entry.setVoucher(entryEBP.getPiece());
- Date date = epbDateFormat.parse(entryEBP.getDatEcr());
String entryBookCode = entryEBP.getJournal();
EntryBook entryBook = entryBookDAO
.findByCode(entryBookCode);
@@ -245,11 +266,9 @@
}
if (financialTransaction == null
- || !(date.equals(financialTransaction
- .getTransactionDate()) && entryBook
- .getCode().equals(
- financialTransaction.getEntryBook()
- .getCode()))) {
+ || !(date.equals(financialTransaction.getTransactionDate())
+ && entryBook.getCode().equals(financialTransaction.getEntryBook().getCode()))) {
+
// update previous financial transaction before create
// new
if (financialTransaction != null) {
@@ -1085,9 +1104,9 @@
.parse(financialTransactionImport.getDate());
financialTransaction
.setTransactionDate(dateFinancialTransaction);
- financialTransaction.setAmountDebit(new Double(
+ financialTransaction.setAmountDebit(new BigDecimal(
financialTransactionImport.getAmountDebit()));
- financialTransaction.setAmountCredit(new Double(
+ financialTransaction.setAmountCredit(new BigDecimal(
financialTransactionImport.getAmountCredit()));
EntryBook entryBook = entryBookDAO
.findByCode(financialTransactionImport
@@ -1107,7 +1126,7 @@
.findByAccountNumber(entryImport.getAccount());
entry.setAccount(account);
entry.setDescription(entryImport.getDescription());
- entry.setAmount(new Double(entryImport.getAmount()));
+ entry.setAmount(new BigDecimal(entryImport.getAmount()));
entry.setDebit(new Boolean(entryImport.getDebit()));
entry.setLettering(entryImport.getLettering());
entry.setDetail(entryImport.getDetail());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,7 @@
package org.chorem.lima.business.ejb;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -103,7 +104,9 @@
@Override
public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
if (account != null){
// First subaccount
List<Account> accounts = (List<Account>) account.getSubAccounts();
@@ -119,15 +122,18 @@
ReportsDatas subReportsDatas =
generateAccountReportsWithTransaction(subAccount,
beginDate,endDate, topiaContext);
- debit += subReportsDatas.getAmountDebit();
- credit += subReportsDatas.getAmountCredit();
+ debit = debit.add(subReportsDatas.getAmountDebit());
+ credit = credit.add(subReportsDatas.getAmountCredit());
entries.addAll(subReportsDatas.getListEntry());
}
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
reportsDatas.setAmountSolde(solde);
@@ -170,7 +176,10 @@
@SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountReportsWithTransaction(Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
+
List<Object[]> results = new ArrayList<Object[]>();
String queryAlias = "E";
if (beginDate != null && endDate != null){
@@ -194,24 +203,27 @@
results = amountsQuery.execute(topiaContext);
int nbAmount = results.size();
if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal) results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal) results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
@@ -235,10 +247,15 @@
@SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountBalanceWithTransaction(Account account, Date beginDate, Date endDate, Boolean getEntries, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
+
+
List<Object[]> results = new ArrayList<Object[]>();
String queryAlias = "E";
if (beginDate != null && endDate != null){
+ log.debug("solde 0 : "+solde);
try {
EntryDAO entryDAO= LimaCallaoDAOHelper.getEntryDAO(topiaContext);
@@ -261,24 +278,28 @@
results = amountsQuery.execute(topiaContext);
int nbAmount = results.size();
if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
+
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
@@ -306,7 +327,10 @@
@Override
public ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
+
List<Object[]> results = new ArrayList<Object[]>();
if (entryBook != null && beginDate != null && endDate != null){
// Get all entries with a topia query
@@ -339,24 +363,26 @@
results = amountsQuery.execute(topiaTransaction);
int nbAmount = results.size();
if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit;
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
@@ -419,8 +445,9 @@
public BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries, Boolean movementedFilter) throws LimaException {
BalanceTrial balanceTrial = new BalanceTrialImpl();
balanceTrial.setReportsDatas(new ArrayList<ReportsDatas>());
- double credit = 0, debit = 0, solde = 0;
-
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
TopiaContext topiaTransaction = null;
try {
topiaTransaction = beginTransaction();
@@ -439,16 +466,20 @@
}
//build list account from selectedAccounts
else{
- accounts=accountServiceLocal.stringToListAccountsWithTransaction(selectedAccounts, topiaTransaction);
+ accounts = accountServiceLocal.stringToListAccountsWithTransaction(
+ selectedAccounts, false, topiaTransaction);
}
for (Account account : accounts) {
ReportsDatas reportsDatas =
generateSubAccountBalanceWithTransaction(account, beginDate,
endDate, getEntries, topiaTransaction);
reportsDatas.setAccount(account);
- Double amount = reportsDatas.getAmountSolde();
+ BigDecimal amount = reportsDatas.getAmountSolde();
+ if (amount == null){
+ amount = new BigDecimal(0);
+ }
if (movementedFilter){
- if (amount != 0){
+ if (amount.doubleValue() != 0){
// add balance sheet to balance trial
balanceTrial.addReportsDatas(reportsDatas);
}
@@ -459,18 +490,20 @@
}
if (reportsDatas.getSoldeDebit()) {
- debit += amount;
+ debit = debit.add(amount);
}
else {
- credit += amount;
+ credit = credit.add(amount);
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit;
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+ if (solde.doubleValue() > 0){
balanceTrial.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
balanceTrial.setAmountCredit(credit);
balanceTrial.setAmountDebit(debit);
balanceTrial.setAmountSolde(solde);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -40,7 +40,7 @@
@Local
public interface AccountServiceLocal extends AccountService{
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, TopiaContext topiaContext) throws LimaException;
+ public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException;
void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -0,0 +1,38 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+package org.chorem.lima.business.utils;
+
+import java.util.Comparator;
+import org.chorem.lima.beans.EntryEBP;
+
+public class EntryEBPComparator implements Comparator<EntryEBP>{
+
+ @Override
+ public int compare(EntryEBP o1, EntryEBP o2) {
+
+ int result = o1.getDatEcr().compareTo(o2.getDatEcr());
+
+ if(result==0)
+ result = o1.getJournal().compareTo(o2.getJournal());
+
+ return result;
+ }
+
+}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -47,4 +47,15 @@
return (List<Account>) findAllByQuery(query);
}
+ @Override
+ public Account findSubAccountByNumber(String number) throws TopiaException {
+ TopiaQuery query = createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere("not exists elements ("+subLedgersProperty+")")
+ .addEquals(Account.ACCOUNT_NUMBER, number);
+ return findByQuery(query);
+ }
+
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -1,17 +1,25 @@
package org.chorem.lima.entity;
+import java.math.BigDecimal;
+
public class FinancialTransactionImpl extends FinancialTransactionAbstract {
@Override
public void setAmounts() {
+ if (amountDebit == null){
+ amountDebit = new BigDecimal(0);
+ }
+ if (amountCredit == null){
+ amountCredit = new BigDecimal(0);
+ }
for (Entry entryFT : entry) {
if (entryFT.getDebit()){
- amountDebit += entryFT.getAmount();
+ amountDebit = amountDebit.add(entryFT.getAmount());
}
else {
- amountCredit += entryFT.getAmount();
+ amountCredit = amountCredit.add(entryFT.getAmount());
}
}
}
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-12 13:51:19 UTC (rev 3000)
@@ -42,7 +42,7 @@
getEndDatePicker().setDate(endDate);
void $afterCompleteSetup() {
- getHandler().refresh();
+ //getHandler().refresh();
}
]]>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,8 @@
package org.chorem.lima.ui.accountsreports;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -91,15 +93,18 @@
public ReportsDatas getDataList(){
ReportsDatas results = null;
- try {
- results = reportService.generateAccountsReports(selectedAccount,
- selectedBeginDate, selectedEndDate);
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
+ //avoid unnecessary call to service
+ if (selectedAccount != null){
+ try {
+ results = reportService.generateAccountsReports(selectedAccount,
+ selectedBeginDate, selectedEndDate);
}
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+ ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ }
}
return results;
}
@@ -117,13 +122,13 @@
if (datasList != null){
// set amounts credit and debit and solde
- view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- Double amountSolde = datasList.getAmountSolde();
- view.amountSoldeLabel.setText(String.valueOf(amountSolde));
+ view.amountCreditLabel.setText(datasList.getAmountCredit().toString());
+ view.amountDebitLabel.setText(datasList.getAmountDebit().toString());
+ BigDecimal amountSolde = datasList.getAmountSolde();
+ view.amountSoldeLabel.setText(amountSolde.toString());
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -21,6 +21,7 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -134,11 +135,11 @@
// set amounts credit, debit and solde
view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- Double amountSolde = datasList.getAmountSolde();
+ BigDecimal amountSolde = datasList.getAmountSolde();
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -48,7 +48,7 @@
int result = 0;
// just prevent too much result
- if (cacheDataList.getListEntry() != null) {
+ if (cacheDataList != null && cacheDataList.getListEntry() != null) {
result = cacheDataList.getListEntry().size();
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-12 13:51:19 UTC (rev 3000)
@@ -43,7 +43,7 @@
getEndDatePicker().setDate(endDate);
void $afterCompleteSetup() {
- getHandler().refresh();
+ //getHandler().refresh();
}
]]>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -22,6 +22,7 @@
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -43,7 +44,6 @@
import org.chorem.lima.business.utils.FormatsEnum;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.combobox.EntryBookComboBoxModel;
import org.chorem.lima.util.ErrorHelper;
@@ -114,16 +114,18 @@
}
public ReportsDatas getDataList(){
- ReportsDatas results = new ReportsDatasImpl();
- try {
- results =
- reportService.generateEntryBooksReports(selectedEntryBook, selectedBeginDate, selectedEndDate);
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
+ ReportsDatas results = null;
+ if (selectedEntryBook != null){
+ try {
+ results =
+ reportService.generateEntryBooksReports(selectedEntryBook, selectedBeginDate, selectedEndDate);
}
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+ ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ }
}
return results;
}
@@ -143,11 +145,10 @@
// set amounts credit, debit and solde
view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- Double amountSolde = datasList.getAmountSolde();
+ BigDecimal amountSolde = datasList.getAmountSolde();
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
-
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -23,6 +23,7 @@
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -145,8 +146,15 @@
//get entries for the period for the current row
if (result instanceof FinancialStatementAmounts) {
FinancialStatementAmounts currentRow = (FinancialStatementAmounts) result;
- Double grossAmount = currentRow.getGrossAmount();
- Double provisionDeprecationAmount = currentRow.getProvisionDeprecationAmount();
+ BigDecimal grossAmount = currentRow.getGrossAmount();
+ if (grossAmount == null ){
+ grossAmount = new BigDecimal(0);
+ }
+
+ BigDecimal provisionDeprecationAmount = currentRow.getProvisionDeprecationAmount();
+ if (provisionDeprecationAmount == null ){
+ provisionDeprecationAmount = new BigDecimal(0);
+ }
switch (column) {
case 0:
result = "";
@@ -159,7 +167,7 @@
}
break;
case 1:
- if (grossAmount == 0){
+ if (grossAmount.doubleValue() == 0){
result = null;
}
else {
@@ -167,7 +175,7 @@
}
break;
case 2:
- if (provisionDeprecationAmount == 0){
+ if (provisionDeprecationAmount.doubleValue() == 0){
result = null;
}
else {
@@ -175,11 +183,12 @@
}
break;
case 3:
- if (grossAmount-provisionDeprecationAmount == 0){
+ BigDecimal solde = grossAmount.subtract(provisionDeprecationAmount);
+ if (solde.doubleValue() == 0){
result = null;
}
else {
- result = grossAmount-provisionDeprecationAmount;
+ result = solde;
}
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,8 @@
package org.chorem.lima.ui.financialtransaction;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
@@ -160,13 +162,13 @@
result = String.class;
break;
case 6:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 7:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 8:
- result = Double.class;
+ result = BigDecimal.class;
break;
}
@@ -231,8 +233,8 @@
if (result instanceof FinancialTransaction) {
FinancialTransaction currentRow = (FinancialTransaction)result;
- Double amountDebit = currentRow.getAmountDebit();
- Double amountCredit = currentRow.getAmountCredit();
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
switch (column) {
case 0:
@@ -265,7 +267,7 @@
result = amountCredit;
break;
case 8:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
@@ -458,11 +460,11 @@
currentEntry.setPosition((String)value);
break;
case 6:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
case 7:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,8 @@
package org.chorem.lima.ui.financialtransactionunbalanced;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -152,13 +154,13 @@
result = String.class;
break;
case 6:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 7:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 8:
- result = Double.class;
+ result = BigDecimal.class;
break;
}
@@ -224,8 +226,8 @@
if (result instanceof FinancialTransaction) {
FinancialTransaction currentRow = (FinancialTransaction)result;
- Double amountDebit = currentRow.getAmountDebit();
- Double amountCredit = currentRow.getAmountCredit();
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
switch (column) {
case 0:
@@ -258,7 +260,7 @@
result = amountCredit;
break;
case 8:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
@@ -403,11 +405,11 @@
currentEntry.setPosition((String)value);
break;
case 6:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
case 7:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -20,6 +20,8 @@
package org.chorem.lima.ui.ledger;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.swing.table.AbstractTableModel;
@@ -110,8 +112,8 @@
if (result instanceof ReportsDatas) {
ReportsDatas currentRow = (ReportsDatas)result;
- Double amountDebit = currentRow.getAmountDebit();
- Double amountCredit = currentRow.getAmountCredit();
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
switch (column) {
case 0:
@@ -141,15 +143,21 @@
result = amountCredit;
break;
case 7:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
else if (result instanceof Entry) {
Entry currentRow = (Entry)result;
- Double amountDebit = currentRow.getDebit() ? currentRow.getAmount() : 0;
- Double amountCredit = currentRow.getDebit() ? 0 : currentRow.getAmount();
-
+ BigDecimal amountDebit = new BigDecimal(0),
+ amountCredit = new BigDecimal(0);
+ if (currentRow.getDebit()){
+ amountDebit = currentRow.getAmount();
+ }
+ else {
+ amountCredit = currentRow.getAmount();
+ }
+
switch (column) {
case 0:
result = null; // account
@@ -179,7 +187,7 @@
result = amountCredit;
break;
case 7:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -22,6 +22,7 @@
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -164,11 +165,11 @@
String.valueOf(balanceTrialCache.getAmountCredit()));
view.amountDebitLabel.setText(
String.valueOf(balanceTrialCache.getAmountDebit()));
- Double amountSolde = balanceTrialCache.getAmountSolde();
+ BigDecimal amountSolde = balanceTrialCache.getAmountSolde();
view.amountSoldeLabel.setText(
String.valueOf(amountSolde));
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
1
0
Author: tchemit
Date: 2010-08-11 16:50:40 +0200 (Wed, 11 Aug 2010)
New Revision: 2999
Url: http://chorem.org/repositories/revision/lima/2999
Log:
Utilisation de mavenpom4redmine 2.2.3
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-06 15:10:31 UTC (rev 2998)
+++ trunk/pom.xml 2010-08-11 14:50:40 UTC (rev 2999)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>2.2.2.1</version>
+ <version>2.2.3</version>
</parent>
<groupId>org.chorem</groupId>
1
0