Author: jpepin Date: 2010-08-06 16:01:37 +0200 (Fri, 06 Aug 2010) New Revision: 2997 Url: http://chorem.org/repositories/revision/lima/2997 Log: Debug generation bilan et compte de resultat : - ajout d'un sens d?\195?\169bit et cr?\195?\169dit (utile pour le compte de r?\195?\169sultat). - dans la liste des comptes de chaque poste, recherche de tout les comptes commencant par le compte recherch?\195?\169. Ajout combobox editable dans accounts report avec auto completion. Modification des filtres dans la balance et le grand-livre : filtre automatique lors de la saisie. Added: trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java Removed: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.jaxx Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java trunk/lima-callao/src/main/xmi/accounting.zargo trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -38,12 +38,14 @@ import org.chorem.lima.business.utils.AccountComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountDAO; +import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaContextFactory; import org.nuiton.topia.TopiaException; import org.nuiton.topia.TopiaNotFoundException; import org.nuiton.topia.framework.TopiaQuery; +import org.nuiton.topia.framework.TopiaQuery.Op; /** * Permet d'implémenter le Plan Comptable Général. @@ -222,8 +224,7 @@ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction); - List<Account> accounts = accountDAO.findAll(); - accountsList.addAll(accounts); + accountsList = accountDAO.findAll(); Collections.sort(accountsList, new AccountComparator()); } @@ -470,10 +471,18 @@ } for (String accountNumber : accountNumbers) { - Account accountFilter = accountDAO.findByAccountNumber(accountNumber); + Account account = accountDAO.findByAccountNumber(accountNumber); + if (account == null){ + TopiaQuery query = accountDAO.createQuery(); + query.addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%"); + List<Account> accountsResult = accountDAO.findAllByQuery(query); + if (accountsResult != null){ + accounts.addAll(accountsResult); + } + } //add account if exist - if (accountFilter != null){ - accounts.add(accountFilter); + else { + accounts.add(account); } } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -27,6 +27,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.FinancialStatementWayEnum; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ejbinterface.ExportService; @@ -295,7 +296,7 @@ */ public void exportFinancialStatementChartAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException { try { - String[] nextLine = new String[10]; + String[] nextLine = new String[11]; // Get all Financialstatements FinancialStatementDAO financialStatementDAO = LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext); @@ -328,6 +329,12 @@ masterFinancialStatement.getLabel(); } nextLine[9] = masterFinancialStatementString; + FinancialStatementWayEnum financialStatementWayEnum = financialStatement.getWay(); + String financialStatementWay = ""; + if (financialStatementWayEnum != null){ + financialStatementWay = financialStatementWayEnum.name(); + } + nextLine[10] = financialStatementWay; // Add line in file csvWriter.writeNext(nextLine); } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -21,6 +21,7 @@ import static org.nuiton.i18n.I18n._; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.List; import java.util.StringTokenizer; @@ -29,6 +30,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.FinancialStatementWayEnum; import org.chorem.lima.beans.FinancialStatementAmounts; import org.chorem.lima.beans.FinancialStatementAmountsImpl; import org.chorem.lima.beans.FinancialStatementDatas; @@ -42,7 +44,9 @@ import org.chorem.lima.business.ejbinterface.FinancialStatementService; import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal; import org.chorem.lima.business.ejbinterface.ReportServiceLocal; +import org.chorem.lima.business.utils.AccountComparator; import org.chorem.lima.entity.Account; +import org.chorem.lima.entity.AccountDAO; import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialStatementDAO; import org.chorem.lima.entity.LimaCallaoDAOHelper; @@ -51,6 +55,7 @@ import org.nuiton.topia.TopiaException; import org.nuiton.topia.TopiaNotFoundException; import org.nuiton.topia.framework.TopiaQuery; +import org.nuiton.topia.framework.TopiaQuery.Op; @Stateless public class FinancialStatementServiceImpl extends AbstractLimaService implements FinancialStatementService, FinancialStatementServiceLocal{ @@ -406,6 +411,7 @@ try { // DEBIT & CREDIT String accountsString = financialStatement.getAccounts(); + log.debug("\n" + accountsString); Double amount = 0.0; if (accountsString != null){ //Remove Spaces @@ -413,14 +419,30 @@ StringTokenizer stQuote = new StringTokenizer(accountsString, "-"); while (stQuote.hasMoreTokens()) { String s = stQuote.nextToken(); - List<Account> accountsStringList = accountServiceLocal. + List<Account> accountsList = accountServiceLocal. stringToListAccountsWithTransaction(s, topiaContext); Double resAmount = 0.0; - for (Account accountString : accountsStringList) { + + for (Account account : accountsList) { + log.debug(account.getAccountNumber()); ReportsDatas reportsDatas = reportServiceLocal. - generateAccountReportsWithTransaction(accountString, + generateAccountReportsWithTransaction(account, selectedBeginDate, selectedEndDate, topiaContext); - resAmount += reportsDatas.getAmountSolde(); + + //check the way of financialstatement amount + FinancialStatementWayEnum financialStatementWayEnum = + financialStatement.getMasterFinancialStatement().getWay(); + switch (financialStatementWayEnum) { + case BOTH: + resAmount += reportsDatas.getAmountSolde(); + break; + case DEBIT: + resAmount += reportsDatas.getAmountDebit()-reportsDatas.getAmountCredit(); + break; + case CREDIT: + resAmount += reportsDatas.getAmountCredit()-reportsDatas.getAmountDebit(); + break; + } } if (amount == 0){ amount=resAmount; @@ -456,7 +478,7 @@ ReportsDatas reportsDatas = reportServiceLocal. generateAccountReportsWithTransaction(account, selectedBeginDate, selectedEndDate, topiaContext); - debitAmount += reportsDatas.getAmountCredit(); + debitAmount += reportsDatas.getAmountDebit(); } } @@ -493,8 +515,74 @@ return financialStatementAmounts; } + + - protected TopiaContext beginTransaction() throws TopiaException { + @Override + public String checkFinancialStatementChart() throws LimaException { + String result = ""; + List<Account> accountsList = new ArrayList<Account>(); + + TopiaContext transaction = null; + try { + transaction = beginTransaction(); + AccountDAO accountDAO = + LimaCallaoDAOHelper.getAccountDAO(transaction); + + accountsList = accountDAO.findAllSubAccounts(); + Collections.sort(accountsList, new AccountComparator()); + + for (Account account : accountsList) { + Boolean find = false; + String accountNumber = account.getAccountNumber(); + if (accountNumber.length()>1){ + while (!find && accountNumber.length() > 1){ + log.debug(accountNumber); + List<FinancialStatement> financialStatements = + findFinancialStatementByAccountNumber(accountNumber, transaction); + log.debug(financialStatements); + if (!(find = financialStatements.size() > 0)){ + accountNumber = accountNumber.substring(0, accountNumber.length()-1); + } + } + + if (!find){ + result += "NOT FOUND : "+account.getAccountNumber()+"\n"; + } + } + } + + } + catch (TopiaException ex) { + doCatch(transaction, ex, log); + } + finally { + doFinally(transaction, log); + } + return result; + } + + public List<FinancialStatement> findFinancialStatementByAccountNumber(String accountNumber, TopiaContext topiaContext) throws TopiaException{ + + FinancialStatementDAO financialStatementDAO = + LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext); + TopiaQuery query = financialStatementDAO.createQuery(); + + String accountProperty = TopiaQuery.getProperty(FinancialStatement.ACCOUNTS); + String creditAccountProperty = TopiaQuery.getProperty(FinancialStatement.CREDIT_ACCOUNTS); + String debitAccountProperty = TopiaQuery.getProperty(FinancialStatement.DEBIT_ACCOUNTS); + String provisionDeprecationProperty = TopiaQuery.getProperty(FinancialStatement.PROVISION_DEPRECATION_ACCOUNTS); + String likeCondition = " " + Op.LIKE + " '%"+accountNumber + "%'"; + + query.addWhere(accountProperty + likeCondition + + " OR " + creditAccountProperty + likeCondition + + " OR " + debitAccountProperty + likeCondition + + " OR " + provisionDeprecationProperty + likeCondition); + + return financialStatementDAO.findAllByQuery(query); + } + + protected TopiaContext beginTransaction() throws TopiaException { // basic check done, make check in database // TODO move it into JTA TopiaContext topiaTransaction; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -37,6 +37,7 @@ import javax.ejb.Stateless; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.FinancialStatementWayEnum; import org.chorem.lima.beans.AccountEBP; import org.chorem.lima.beans.AccountEBPImpl; import org.chorem.lima.beans.AccountImport; @@ -749,6 +750,7 @@ String subAmount = nextLine[7]; String headerAmount = nextLine[8]; String masterFinancialStatement = nextLine[9]; + String financialStatementWay = nextLine[10]; try { FinancialStatementDAO financialStatementDAO = LimaCallaoDAOHelper @@ -769,6 +771,7 @@ financialStatementImport.setSubAmount(subAmount); financialStatementImport .setMasterFinancialStatement(masterFinancialStatement); + financialStatementImport.setWay(financialStatementWay); // put it in hashlinkedlist if (financialStatements.containsKey(label)){ @@ -891,6 +894,13 @@ financialStatement.setHeaderAmount(Boolean .parseBoolean(financialStatementImport .getHeaderAmount())); + String financialStatementWay = financialStatementImport.getWay(); + if (!financialStatementWay.equals("")){ + FinancialStatementWayEnum financialStatementWayEnum = + FinancialStatementWayEnum.valueOf(financialStatementWay); + financialStatement.setWay(financialStatementWayEnum); + } + financialStatementService .createFinancialStatementWithTransaction( Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -180,6 +180,7 @@ createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias); //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION entriesQuery.addLoad(Entry.FINANCIAL_TRANSACTION); + entriesQuery.addLoad(Entry.ACCOUNT); String loadEntryBookProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -41,5 +41,7 @@ public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException; public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException; + + public String checkFinancialStatementChart() throws LimaException; } Added: trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java (rev 0) +++ trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -0,0 +1,7 @@ +package org.chorem.lima; + +public enum FinancialStatementWayEnum { + + BOTH, DEBIT, CREDIT; + +} Modified: trunk/lima-callao/src/main/xmi/accounting.zargo =================================================================== (Binary files differ) Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -42,7 +42,6 @@ import org.chorem.lima.ui.financialstatementchart.FinancialStatementChartView; import org.chorem.lima.ui.financialstatementreport.FinancialStatementReportView; import org.chorem.lima.ui.financialtransaction.FinancialTransactionView; -import org.chorem.lima.ui.financialtransaction.LetteringView; import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView; import org.chorem.lima.ui.home.HomeView; import org.chorem.lima.ui.identity.IdentityForm; @@ -414,8 +413,8 @@ public void showLetteringView(JAXXContext rootContext) { MainView mainView = getUI(rootContext); - LetteringView letteringView = new LetteringView(mainView); - mainView.showTab(_("lima.entries.lettering"), letteringView); + // LetteringView letteringView = new LetteringView(mainView); + // mainView.showTab(_("lima.entries.lettering"), letteringView); } public void showSearchView(JAXXContext rootContext) { Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -0,0 +1,88 @@ +/* *##% Lima Swing + * Copyright (C) 2008 - 2010 CodeLutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%*/ + +package org.chorem.lima.ui.accountsreports; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import javax.swing.JComboBox; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.entity.Account; +import org.chorem.lima.util.AccountToString; +import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator; + +public class AccountComboBox extends JComboBox implements KeyListener, ActionListener { + + private static final long serialVersionUID = 1L; + + private static final Log log = + LogFactory.getLog(AccountComboBox.class); + + protected AccountsReportsViewHandler handler; + + public AccountComboBox(AccountsReportsViewHandler handler) { + this.handler = handler; + AccountComboBoxModel accountComboBoxModel = new AccountComboBoxModel(); + AccountRenderer accountRenderer = new AccountRenderer(); + setModel(accountComboBoxModel); + setRenderer(accountRenderer); + setEditable(true); + AutoCompleteDecorator.decorate(this, AccountToString.getInstance()); + this.getEditor().getEditorComponent().addKeyListener(this); + this.addActionListener(this); + } + + + + @Override + public void actionPerformed(ActionEvent e) { + Object object = this.getSelectedItem(); + if (object instanceof Account){ + handler.setAccount((Account) this.getSelectedItem()); + } + } + + + @Override + public void keyPressed(KeyEvent e) { + + } + + @Override + public void keyReleased(KeyEvent e) { + Object object = this.getSelectedItem(); + if (object instanceof Account){ + handler.setAccount((Account) this.getSelectedItem()); + } + + // delegate popup list menu + if ( e.getKeyChar() == KeyEvent.VK_ENTER ) + { + firePopupMenuCanceled(); + } + } + + @Override + public void keyTyped(KeyEvent e) { + + } + +} Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java) =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -0,0 +1,110 @@ +/* *##% Lima Swing + * Copyright (C) 2008 - 2010 CodeLutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%*/ + +package org.chorem.lima.ui.accountsreports; + +import java.util.List; +import javax.swing.AbstractListModel; +import javax.swing.ComboBoxModel; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.business.AccountServiceMonitorable; +import org.chorem.lima.business.ImportServiceMonitorable; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ServiceListener; +import org.chorem.lima.entity.Account; +import org.chorem.lima.service.LimaServiceFactory; +import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel; + +/** + * Account combo box model. + */ + +public class AccountComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener { + + private static final long serialVersionUID = 1L; + + private static final Log log = + LogFactory.getLog(FinancialPeriodTableModel.class); + + protected Object selectedAccount; + + protected List<Account> datasCache; + + protected AccountServiceMonitorable accountService; + + public AccountComboBoxModel () { + accountService = + LimaServiceFactory.getInstance().getService( + AccountServiceMonitorable.class); + accountService.addListener(this); + LimaServiceFactory.getInstance().getService( + ImportServiceMonitorable.class).addListener(this); + datasCache = getDataList(); + } + + @Override + public Object getSelectedItem() { + return selectedAccount; + } + + @Override + public void setSelectedItem(Object anItem) { + selectedAccount = anItem; + fireContentsChanged(this, -1, -1); + } + + + @Override + public Object getElementAt(int index) { + return datasCache.get(index); + } + + @Override + public int getSize() { + return datasCache.size(); + } + + public List<Account> getDataList(){ + List<Account> result = null; + try { + result = accountService.getAllAccounts(); + } + catch (LimaException eee) { + if (log.isDebugEnabled()){ + log.debug("Can't get list accounts", eee); + } + } + return result; + + } + + public void refresh(){ + datasCache = getDataList(); + fireContentsChanged(this, 0, datasCache.size()); + } + + @Override + public void notifyMethod(String serviceName, String methodeName) { + if (methodeName.contains("Account") || methodeName.contains("importAll")){ + refresh(); + } + } + + +} Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java) =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -0,0 +1,49 @@ +/* *##% Lima Swing + * Copyright (C) 2008 - 2010 CodeLutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%*/ + +package org.chorem.lima.ui.accountsreports; + +import java.awt.Component; + +import javax.swing.DefaultListCellRenderer; +import javax.swing.JLabel; +import javax.swing.JList; + +import org.chorem.lima.entity.Account; + +public class AccountRenderer extends DefaultListCellRenderer { + + private static final long serialVersionUID = 1L; + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + + JLabel label = new JLabel(); + Account account = (Account) value; + if (account != null){ + String accountLabel = account.getLabel(); + int nbChars = 30; + if (accountLabel.length()>nbChars){ + accountLabel = accountLabel.substring(0, nbChars)+"…"; + } + label.setText(account.getAccountNumber() +" - " + accountLabel); + } + return label; + } + +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -59,29 +59,32 @@ @Override public int getColumnCount() { - return 6; + return 7; } @Override public String getColumnName(int column) { String res = "n/a"; switch (column) { - case 0: + case 0: + res = _("lima.table.account"); //Account Number + break; + case 1: res = _("lima.table.date"); //Date break; - case 1: + case 2: res = _("lima.table.entrybook"); //EntryBook break; - case 2: + case 3: res = _("lima.table.voucher"); // Voucher break; - case 3: + case 4: res = _("lima.table.description"); //Description break; - case 4: + case 5: res = _("lima.table.debit"); //Debit break; - case 5: + case 6: res = _("lima.table.credit"); //Credit break; } @@ -97,11 +100,14 @@ = new SimpleDateFormat("dd MMMMM yyyy"); switch (column) { - case 0: + case 0: + result = currentRow.getAccount().getAccountNumber(); + break; + case 1: result = simpleDateFormat. format(currentRow.getFinancialTransaction().getTransactionDate()); break; - case 1: + case 2: if (currentRow.getFinancialTransaction().getEntryBook() != null){ result = currentRow.getFinancialTransaction().getEntryBook().getCode(); } @@ -109,16 +115,16 @@ result = null; } break; - case 2: + case 3: result = currentRow.getVoucher(); break; - case 3: + case 4: result = currentRow.getDescription(); break; - case 4: + case 5: result = currentRow.getDebit() ? currentRow.getAmount() : 0; break; - case 5: + case 6: result = currentRow.getDebit() ? 0 : currentRow.getAmount(); break; } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-06 14:01:37 UTC (rev 2997) @@ -18,7 +18,6 @@ <Table> <AccountsReportsViewHandler id="handler" javaBean="new AccountsReportsViewHandler(this)" /> <Boolean id="selectedRow" javaBean="false" /> - <org.chorem.lima.ui.combobox.AccountComboBoxModel id="modelAccounts"/> <org.chorem.lima.ui.accountsreports.AccountsReportsTableModel id="modelAccountsReportsTable"/> <script> <![CDATA[ @@ -67,12 +66,7 @@ <JLabel id="accountSelectorLabel" text="lima.account"/> </cell> <cell anchor="west"> - <JComboBox id="accountSelectorComboBox" - model="{getModelAccounts()}" - renderer="{new org.chorem.lima.ui.combobox.AccountRenderer()}" - onActionPerformed="getHandler().setAccount((Account) accountSelectorComboBox.getSelectedItem())" - editable="false" - /> + <JComboBox javaBean='new org.chorem.lima.ui.accountsreports.AccountComboBox(getHandler())' /> </cell> </row> <row> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -30,7 +30,6 @@ import org.chorem.lima.business.ServiceListener; import org.chorem.lima.entity.Account; import org.chorem.lima.service.LimaServiceFactory; -import org.chorem.lima.ui.combobox.AccountComboBoxModel; import org.chorem.lima.util.ErrorHelper; Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -0,0 +1,56 @@ +/* + * *##% Lima Swing + * Copyright (C) 2008 - 2010 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* + */ + +package org.chorem.lima.ui.balance; + +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import javax.swing.JTextField; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class BalanceFilterTextField extends JTextField implements KeyListener { + + private static final long serialVersionUID = 1L; + + private static final Log log = + LogFactory.getLog(BalanceFilterTextField.class); + + protected BalanceViewHandler handler; + + public BalanceFilterTextField(BalanceViewHandler handler) { + this.handler = handler; + addKeyListener(this); + } + + @Override + public void keyPressed(KeyEvent e) { + } + + @Override + public void keyReleased(KeyEvent e) { + handler.setAccountFilter(getText()); + } + + @Override + public void keyTyped(KeyEvent e) { + + } + +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -1,5 +1,5 @@ /* - * *##% Lima Main + * *##% Lima Swing * Copyright (C) 2008 - 2010 CodeLutin * * This program is free software: you can redistribute it and/or modify Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-06 14:01:37 UTC (rev 2997) @@ -25,9 +25,7 @@ import org.chorem.lima.entity.Account; import org.apache.commons.lang.time.DateUtils; import java.util.Calendar; - - getRootPane().setDefaultButton(filter); - + // get begin date Calendar calendarBegin = Calendar.getInstance(); // set begindate to JAN 1 - 0:00.000 of this years @@ -66,11 +64,10 @@ onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/> </cell> <cell anchor="east"> - <JTextField id="accountFilter"/> + <JLabel text="lima.accountsreports.accountfilter"/> </cell> <cell anchor="west"> - <JButton id="filter" text="lima.accountsreports.accountfilter" - onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/> + <JTextField javaBean="new org.chorem.lima.ui.balance.BalanceFilterTextField(getHandler())"/> </cell> <cell anchor="center"> <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false' @@ -78,8 +75,8 @@ </cell> <cell> <EnumEditor id='DocumentEditor' - constructorParams='org.chorem.lima.business.utils.FormatsEnum.class' - onActionPerformed="getHandler().createDocument()"/> + constructorParams='org.chorem.lima.business.utils.FormatsEnum.class' + onActionPerformed="getHandler().createDocument()"/> </cell> </row> <row> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -32,7 +32,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.entity.Account; -import org.chorem.lima.ui.combobox.AccountRenderer; +import org.chorem.lima.ui.accountsreports.AccountRenderer; import org.chorem.lima.ui.combobox.SubAccountComboBoxModel; import org.chorem.lima.util.AccountToString; import org.chorem.lima.widgets.JWideComboBox; Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -1,110 +0,0 @@ -/* *##% Lima Swing - * Copyright (C) 2008 - 2010 CodeLutin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%*/ - -package org.chorem.lima.ui.combobox; - -import java.util.List; -import javax.swing.AbstractListModel; -import javax.swing.ComboBoxModel; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.AccountServiceMonitorable; -import org.chorem.lima.business.ImportServiceMonitorable; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ServiceListener; -import org.chorem.lima.entity.Account; -import org.chorem.lima.service.LimaServiceFactory; -import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel; - -/** - * Account combo box model. - */ - -public class AccountComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener { - - private static final long serialVersionUID = 1L; - - private static final Log log = - LogFactory.getLog(FinancialPeriodTableModel.class); - - protected Object selectedAccount; - - protected List<Account> datasCache; - - protected AccountServiceMonitorable accountService; - - public AccountComboBoxModel() { - accountService = - LimaServiceFactory.getInstance().getService( - AccountServiceMonitorable.class); - accountService.addListener(this); - LimaServiceFactory.getInstance().getService( - ImportServiceMonitorable.class).addListener(this); - datasCache = getDataList(); - } - - @Override - public Object getSelectedItem() { - return selectedAccount; - } - - @Override - public void setSelectedItem(Object anItem) { - selectedAccount = anItem; - fireContentsChanged(this, -1, -1); - } - - - @Override - public Object getElementAt(int index) { - return datasCache.get(index); - } - - @Override - public int getSize() { - return datasCache.size(); - } - - public List<Account> getDataList(){ - List<Account> result = null; - try { - result = accountService.getAllAccounts(); - } - catch (LimaException eee) { - if (log.isDebugEnabled()){ - log.debug("Can't get list accounts", eee); - } - } - return result; - - } - - public void refresh(){ - datasCache = getDataList(); - fireContentsChanged(this, 0, datasCache.size()); - } - - @Override - public void notifyMethod(String serviceName, String methodeName) { - if (methodeName.contains("Account") || methodeName.contains("importAll")){ - refresh(); - } - } - - -} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -1,44 +0,0 @@ -/* *##% Lima Swing - * Copyright (C) 2008 - 2010 CodeLutin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%*/ - -package org.chorem.lima.ui.combobox; - -import java.awt.Component; - -import javax.swing.DefaultListCellRenderer; -import javax.swing.JLabel; -import javax.swing.JList; - -import org.chorem.lima.entity.Account; - -public class AccountRenderer extends DefaultListCellRenderer { - - private static final long serialVersionUID = 1L; - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - - JLabel label = new JLabel(); - Account account = (Account) value; - if (account != null){ - label.setText(account.getAccountNumber()+" - "+account.getLabel()); - } - return label; - } - -} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-06 14:01:37 UTC (rev 2997) @@ -27,7 +27,7 @@ </script> <row> - <cell fill="both" weightx="1" weighty="1" rows='5'> + <cell fill="both" weightx="1" weighty="1" rows='6'> <JScrollPane> <org.jdesktop.swingx.JXTreeTable id="treeTable" selectionMode="{ListSelectionModel.SINGLE_SELECTION}" @@ -64,10 +64,16 @@ enabled="{isSelectedRow()}"/> </cell> </row> - <row> + <row> <cell fill="horizontal"> <JButton id="importButton" text="lima.importexport.import" onActionPerformed="getHandler().importFinancialStatementChart()"/> </cell> </row> + <row> + <cell fill="horizontal"> + <JButton id="checkButton" text="lima.financialstament.check" + onActionPerformed="getHandler().financialStatementChartCheck()"/> + </cell> + </row> </Table> \ No newline at end of file Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -302,6 +302,18 @@ } + public void financialStatementChartCheck(){ + String result; + try { + result = financialStatementService.checkFinancialStatementChart(); + DialogHelper.showReportDialog(result, _("lima.financialstatement.check"), view); + + } catch (LimaException e) { + log.error("Can't check financialstatement chart",e); + } + + } + @Override public void notifyMethod(String serviceName, String methodName) { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-08-06 14:01:37 UTC (rev 2997) @@ -22,6 +22,21 @@ <script> <![CDATA[ + import org.chorem.lima.entity.FinancialStatementImpl; + import org.chorem.lima.FinancialStatementWayEnum; + + + protected void getFinancialStatementWayValue(){ + + FinancialStatementWayEnum fSWE = + (FinancialStatementWayEnum) wayEnumEditor.getSelectedItem(); + + if (fSWE == null){ + fSWE = FinancialStatementWayEnum.BOTH; + } + getFinancialStatement().setWay(fSWE); + } + getRootPane().setDefaultButton(ok); protected void performCancel() { setFinancialStatement(null); @@ -57,6 +72,14 @@ </cell> </row> <row> + <cell> + <EnumEditor id='wayEnumEditor' + selectedItem="{getFinancialStatement().getWay()}" + constructorParams='org.chorem.lima.FinancialStatementWayEnum.class' + onActionPerformed="getFinancialStatementWayValue()"/> + </cell> + </row> + <row> <cell fill="none"> <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/> </cell> Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.jaxx 2010-08-06 14:01:37 UTC (rev 2997) @@ -1,122 +0,0 @@ -<!-- ##% Lima Swing - Copyright (C) 2008 - 2010 CodeLutin - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - ##% --> - -<Table fill="both"> - <script> - <![CDATA[ - import org.chorem.lima.entity.Account; - import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator; - import org.jdesktop.swingx.autocomplete.ObjectToStringConverter; - - // Swingx auto complete (for account) : - AutoCompleteDecorator.decorate(accountComboBox, new ObjectToStringConverter() { - @Override - public String getPreferredStringForItem(Object item) { - if (item == null) { - return ""; - } - Account account = (Account) item; - return account.getAccountNumber() + " : " + account.getLabel(); - } - }); - - protected void addLettering() { - // never been implemented :( - }; - protected void removeLettering() { - // never been implemented :( - }; - ]]> - </script> - <row> - <cell> - <Table> - <!-- account --> - <row fill="horizontal" weightx="1" anchor="center"> - <cell anchor="east"> - <JLabel text="lima.account"/> - </cell> - <cell> - <org.chorem.lima.widgets.JWideComboBox id="accountComboBox" - model="{new org.chorem.lima.ui.combobox.AccountComboBoxModel()}" /> - </cell> - </row> - <!-- from --> - <row fill="horizontal" weightx="1" anchor="center"> - <cell anchor="east"> - <JLabel text="lima.lettering.from"/> - </cell> - <cell> - <org.chorem.lima.widgets.JWideComboBox id="fromPeriodComoboBox" /> - </cell> - </row> - <!-- to --> - <row fill="horizontal" weightx="1" anchor="center"> - <cell anchor="east"> - <JLabel text="lima.lettering.to"/> - </cell> - <cell> - <org.chorem.lima.widgets.JWideComboBox id="toPeriodComoboBox" /> - </cell> - </row> - </Table> - </cell> - <cell> - <!-- entries --> - <Table fill="both"> - <row columns="3"> - <cell> - <JLabel text="lima.lettering.entries"/> - </cell> - </row> - <row> - <cell> - <JRadioButton buttonGroup='entryButtons' text='lima.lettering.lettered' - value='{_("lima.lettering.lettered")}' selected='true'/> - </cell> - <cell> - <JRadioButton buttonGroup='entryButtons' text='lima.lettering.notlettered' - value='{_("lima.lettering.notlettered")}'/> - </cell> - <cell> - <JRadioButton buttonGroup='entryButtons' text='lima.lettering.letteredall' - value='{_("lima.lettering.letteredall")}'/> - </cell> - </row> - </Table> - </cell> - </row> - <row columns="2" weightx="1" weighty="1" anchor="center" fill="both"> - <cell> - <JScrollPane> - <org.jdesktop.swingx.JXTable id="letteringTable" /> - </JScrollPane> - </cell> - </row> - <row> - <cell> - <!-- add lettering --> - <JButton id="addButton" text="lima.lettering.add" - onActionPerformed="addLettering()"/> - </cell> - <cell> - <!-- remove lettering --> - <JButton id="removeButton" text="lima.lettering.remove" - onActionPerformed="removeLettering()"/> - </cell> - </row> -</Table> \ No newline at end of file Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java 2010-08-06 14:01:37 UTC (rev 2997) @@ -0,0 +1,58 @@ +/* + * *##% Lima Swing + * Copyright (C) 2008 - 2010 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* + */ + +package org.chorem.lima.ui.ledger; + +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import javax.swing.JTextField; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class LedgerFilterTextField extends JTextField implements KeyListener { + + private static final long serialVersionUID = 1L; + + private static final Log log = + LogFactory.getLog(LedgerFilterTextField.class); + + protected LedgerViewHandler handler; + + public LedgerFilterTextField(LedgerViewHandler handler) { + this.handler = handler; + addKeyListener(this); + } + + @Override + public void keyPressed(KeyEvent e) { + + } + + @Override + public void keyReleased(KeyEvent e) { + handler.setAccountFilter(getText()); + + } + + @Override + public void keyTyped(KeyEvent e) { + + } + +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-06 14:01:37 UTC (rev 2997) @@ -26,8 +26,6 @@ import org.apache.commons.lang.time.DateUtils; import java.util.Calendar; - getRootPane().setDefaultButton(filter); - // get begin date Calendar calendarBegin = Calendar.getInstance(); // set begindate to JAN 1 - 0:00.000 of this years @@ -65,11 +63,10 @@ onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/> </cell> <cell anchor="east"> - <JTextField id="accountFilter"/> + <JLabel text="lima.accountsreports.accountfilter"/> </cell> <cell anchor="west"> - <JButton id="filter" text="lima.accountsreports.accountfilter" - onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/> + <JTextField javaBean="new org.chorem.lima.ui.ledger.LedgerFilterTextField(getHandler())"/> </cell> <cell anchor="center"> <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false' Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-06 14:01:37 UTC (rev 2997) @@ -96,8 +96,12 @@ lima.export.all=Export all datas (XML) lima.export.all.csv=Exporter all datas (CSV) lima.financialperiod.block= +lima.financialstament.check= lima.financialstatement.accounts= +lima.financialstatement.check= +lima.financialstatement.credit= lima.financialstatement.creditaccounts= +lima.financialstatement.debit= lima.financialstatement.debitaccounts= lima.financialstatement.delete= lima.financialstatement.formula= Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-05 10:50:11 UTC (rev 2996) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-06 14:01:37 UTC (rev 2997) @@ -91,7 +91,10 @@ lima.export.all=Exporter toutes les donn\u00E9es (XML) lima.export.all.csv=Exporter toutes les donn\u00E9es (CSV) lima.financialperiod.block=Cloturer une p\u00E9riode +lima.financialstament.check= lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit +lima.financialstatement.check= +lima.financialstatement.credit=Sens du poste \: d\u00E9bit lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit lima.financialstatement.delete=Supprimer le plan BCR actuel avant d'importer