r2886 - in trunk: lima-business/src/main/java/org/chorem/lima/business lima-business/src/main/java/org/chorem/lima/business/ejb lima-swing/src/main/java/org/chorem/lima/ui lima-swing/src/main/java/org/chorem/lima/ui/accountsreports lima-swing/src/main/java/org/chorem/lima/ui/transaction lima-swing/src/main/java/org/chorem/lima/ui/transaction/table lima-swing/src/main/resources/i18n
Author: jpepin Date: 2010-05-06 18:48:20 +0200 (Thu, 06 May 2010) New Revision: 2886 Url: http://chorem.org/repositories/revision/lima/2886 Log: Visualisation des comptes Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/ 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 Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/FinancialTransactionViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTableModel.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/FinancialTransactionService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -21,6 +21,7 @@ import java.util.List; +import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FinancialPeriod; @@ -86,5 +87,7 @@ void updateEntry(Entry entry) throws LimaException; void removeEntry(Entry entry) throws LimaException; + + List<Entry> getAllEntriesForAccount(Account account) throws LimaException; } 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-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -364,4 +364,35 @@ doFinally(topiaContext, log); } } + + @Override + public List<Entry> getAllEntriesForAccount(Account account) throws LimaException { + List<Entry> entries = null; + TopiaContext topiaContext = null; + try { + // basic check done, make check in database + // TODO move it into JTA + topiaContext = rootContext.beginTransaction(); + + EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext); + entries = entryDAO.findAllByAccount(account); + + //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION + for (Entry entry : entries) { + entry.getEntryBook(); + entry.getFinancialTransaction().getTransactionDate(); + } + + // commit + topiaContext.commitTransaction(); + } + catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + finally { + doFinally(topiaContext, log); + } + + return entries; + } } \ No newline at end of file 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-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-05-06 16:48:20 UTC (rev 2886) @@ -131,13 +131,15 @@ <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"> + <JMenuItem text="lima.accounts" onActionPerformed='getHandler().showAccountReports(this)'/> <JMenuItem text="lima.reports" onActionPerformed='getHandler().showReportsView(this)' actionIcon='rapport'/> <JMenuItem text="lima.balance" onActionPerformed='getHandler().showBalanceView(this)'/> <JMenuItem text="lima.bilan" onActionPerformed='getHandler().showBilanView(this)'/> 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-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -36,6 +36,7 @@ import org.chorem.lima.LimaConfig; import org.chorem.lima.LimaContext; import org.chorem.lima.ui.account.AccountView; +import org.chorem.lima.ui.accountsreports.AccountsReportsView; import org.chorem.lima.ui.entrybook.EntryBookView; import org.chorem.lima.ui.fiscalperiod.FiscalPeriodView; import org.chorem.lima.ui.transaction.FinancialTransactionView; @@ -271,7 +272,56 @@ HomeView homeView = new HomeView(mainView); mainView.showTab(_("lima.tab.home"), homeView, false); } + + /** + * Show fiscal period view to create or block a period + * @param rootContext + */ + public void showFiscalPeriodView(JAXXContext rootContext) { + MainView mainView = getUI(rootContext); + FiscalPeriodView fiscalPeriodView = new FiscalPeriodView(mainView); + mainView.showTab(_("lima.tab.fiscalperiod"), fiscalPeriodView); + } + /** + * Show account tree table view to create or modify accounts + * @param rootContext + */ + public void showAccountView(JAXXContext rootContext) { + MainView mainView = getUI(rootContext); + AccountView accountView = new AccountView(mainView); + mainView.showTab(_("lima.tab.account"), accountView); + } + + /** + * Show account table report to view an account on a period + * @param rootContext + */ + public void showAccountReports(JAXXContext rootContext) { + MainView mainView = getUI(rootContext); + AccountsReportsView accountsReportsView = new AccountsReportsView(mainView); + mainView.showTab(_("lima.tab.accounts"), accountsReportsView); + } + + /** + * Show financial transactions view to create entries + * @param rootContext + */ + public void showTransactionView(JAXXContext rootContext) { + MainView mainView = getUI(rootContext); + FinancialTransactionView transactionView = new FinancialTransactionView(mainView); + mainView.showTab(_("lima.tab.transaction"), transactionView); + } + /** + * Show EntryBook view to create entry book + * @param rootContext + */ + public void showJournalView(JAXXContext rootContext) { + MainView mainView = getUI(rootContext); + EntryBookView entryBookView = new EntryBookView(mainView); + mainView.showTab(_("lima.tab.journal"), entryBookView); + } + public void showBilanView(JAXXContext rootContext) { MainView mainView = getUI(rootContext); // BilanView bilanView = new BilanView(mainView); @@ -284,12 +334,6 @@ // mainView.showTab(_("lima.tab.balance"), balanceView); } - public void showFiscalPeriodView(JAXXContext rootContext) { - MainView mainView = getUI(rootContext); - FiscalPeriodView fiscalPeriodView = new FiscalPeriodView(mainView); - mainView.showTab(_("lima.tab.fiscalperiod"), fiscalPeriodView); - } - public void showClosureTimeSpanView(JAXXContext rootContext) { //getClosureView().initBlockForm(); } @@ -318,25 +362,6 @@ mainView.showTab(_("lima.tab.search.result"), searchResultView);*/ } - public void showAccountView(JAXXContext rootContext) { - MainView mainView = getUI(rootContext); - AccountView accountView = new AccountView(mainView); - mainView.showTab(_("lima.tab.account"), accountView); - } - - - public void showTransactionView(JAXXContext rootContext) { - MainView mainView = getUI(rootContext); - FinancialTransactionView transactionView = new FinancialTransactionView(mainView); - mainView.showTab(_("lima.tab.transaction"), transactionView); - } - - public void showJournalView(JAXXContext rootContext) { - MainView mainView = getUI(rootContext); - EntryBookView entryBookView = new EntryBookView(mainView); - mainView.showTab(_("lima.tab.journal"), entryBookView); - } - public void showSearchView(JAXXContext rootContext) { /*if (!getSearchView().isEnabled()) { getSearchView().setEnabled(true); @@ -355,38 +380,5 @@ //ResultView resultView = new ResultView(mainView); // mainView.showTab(_("lima.tab.result"), resultView); } - - /** - * Called by menuitem "Vue a plat". - * - * Mais le fonctionnement est a revoir, car un peu trop de code... - * - * @param rootContext - */ - protected void onChangeView(JAXXContext rootContext) { - /*if (log.isDebugEnabled()) { - log.debug("onChangeView : "); - } - transactionView = getTransactionView(); - searchResultView = getSearchResultView(); - if (viewFlatten.getState()) { - // View not flatten - if (log.isDebugEnabled()) { - log.debug("onChangeView : setModel : getSortedModel"); - } - transactionView.getTransactionTable().setModel(transactionView.getSortedModel()); - searchResultView.getTransactionTable().setModel(searchResultView.getSortedModel()); - } else { - // View Flatten - if (log.isDebugEnabled()) { - log.debug("onChangeView : setModel : getFlattenModel"); - } - transactionView.getTransactionTable().setModel(transactionView.getFlattenModel()); - searchResultView.getTransactionTable().setModel(searchResultView.getFlattenModel()); - } - // Pack all columns - transactionView.getTransactionTable().packAll(); - searchResultView.getTransactionTable().packAll();*/ - } } Added: 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 (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -0,0 +1,221 @@ +/* + * *##% Lima Main + * 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.accountsreports; + +import static org.nuiton.i18n.I18n._; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.swing.table.AbstractTableModel; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.business.EntryBookService; +import org.chorem.lima.business.FinancialTransactionService; +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.FinancialTransaction; +import org.chorem.lima.service.LimaServiceFactory; +import org.chorem.lima.util.ErrorHelper; + +/** + * Entry book table model. + * + * @author ore + * @author chatellier + * @version $Revision: 2865 $ + * + * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $ + * By : $Author: jpepin $ + */ +public class AccountsReportsTableModel extends AbstractTableModel { + + /** serialVersionUID. */ + private static final long serialVersionUID = 7578692417919755647L; + + /** log. */ + private static final Log log = LogFactory.getLog(AccountsReportsTableModel.class); + + /** Services. */ + protected FinancialTransactionService financialTransactionService; + + /** Account. */ + protected Account selectedAccount; + + /** data cache */ + protected List<Entry> cacheDataList; + + /** + * Constructor. + */ + public AccountsReportsTableModel() { + + financialTransactionService = LimaServiceFactory.getInstance().getTransactionService(); + } + + @Override + public int getRowCount() { + int result = 0; + + // just prevent too much result + if (selectedAccount != null) { + result = cacheDataList.size(); + } + else { + if (log.isDebugEnabled()) { + log.debug("No account selected skip table model update"); + } + } + + return result; + } + + @Override + public int getColumnCount() { + return 6; + } + + @Override + public String getColumnName(int column) { + String res = "n/a"; + switch (column) { + case 0: + res = _("lima.transaction.column.date"); //Date + break; + case 1: + res = _("lima.transaction.column.entrybook"); //EntryBook + break; + case 2: + res = _("lima.transaction.column.voucher"); // Voucher + break; + case 3: + res = _("lima.transaction.column.description"); //Description + break; + case 4: + res = _("lima.transaction.column.debit"); //Debit + break; + case 5: + res = _("lima.transaction.column.credit"); //Credit + break; + } + return res; + } + + @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 = String.class; + break; + case 4: + result = String.class; + break; + case 5: + result = String.class; + break; + } + + return result; + } + + @Override + public Object getValueAt(int row, int column) { + Object result = null; + if(selectedAccount != null) { + Entry currentRow = cacheDataList.get(row); + + switch (column) { + case 0: + result = currentRow.getFinancialTransaction().getTransactionDate(); + break; + case 1: + if (currentRow.getEntryBook() != null){ + result = currentRow.getEntryBook().getCode(); + } + else { + result = null; + } + break; + case 2: + result = currentRow.getVoucher(); + break; + case 3: + result = currentRow.getDescription(); + break; + case 4: + result = currentRow.getDebit() ? currentRow.getAmount() : 0; + break; + case 5: + result = currentRow.getDebit() ? 0 : currentRow.getAmount(); + break; + } + } + else { + if (log.isDebugEnabled()) { + log.debug("No Account selected skip table model update"); + } + } + + return result; + } + + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + // Just read, no write + return false; + } + + /** + * @param entryBook + * @throws LimaException + */ + public void setAccount(Account account) { + if (account != null){ + selectedAccount = account; + try { + log.debug(selectedAccount); + cacheDataList = financialTransactionService.getAllEntriesForAccount(selectedAccount); + } + catch (LimaException eee) { + if (log.isErrorEnabled()) { + log.debug("Can't update model", eee); + } + ErrorHelper.showErrorDialog("Can't get entries list", eee); + } + } + } +} Added: 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 (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-05-06 16:48:20 UTC (rev 2886) @@ -0,0 +1,68 @@ +<!-- ##% 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> + <AccountsReportsViewHandler id="handler" javaBean="new AccountsReportsViewHandler(this)" /> + <Boolean id="selectedRow" javaBean="false" /> + <org.chorem.lima.ui.transaction.model.AccountComboBoxModel id="modelAccounts"/> + <org.chorem.lima.ui.accountsreports.AccountsReportsTableModel id="modelAccountsReportsTable"/> + <script> + <![CDATA[ + + import org.chorem.lima.entity.Account; + + ]]> + </script> + <row fill="horizontal" weightx="1" weighty="0" anchor="center"> + <cell> + <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/> + </cell> + <cell> + <JLabel text="TODO begincalendarPanel"/> + </cell> + <cell> + <JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/> + </cell> + <cell> + <JLabel text="TODO endcalendarPanel"/> + </cell> + <cell> + <JLabel id="accountSelectorLabel" text="lima.account"/> + </cell> + <cell> + <JComboBox id="accountSelectorComboBox" + model="{getModelAccounts()}" + renderer="{new org.chorem.lima.ui.transaction.model.AccountRenderer()}" + onItemStateChanged="getModelAccountsReportsTable().setAccount((Account) event.getItem())" + editable="false" + /> + </cell> + </row> + <row> + <cell fill="both" weightx="1" weighty="1" rows="3" columns="7"> + <JScrollPane> + <org.jdesktop.swingx.JXTable id="accountsReportsTable" rowHeight="24" + model="{getModelAccountsReportsTable()}" + highlighters="{org.jdesktop.swingx.decorator.HighlighterFactory.createSimpleStriping(new java.awt.Color(222,222,222))}" + selectionMode="{ListSelectionModel.SINGLE_SELECTION}" + columnControlVisible="true"/> + <javax.swing.ListSelectionModel javaBean="getAccountsReportsTable().getSelectionModel()" + onValueChanged="setSelectedRow(accountsReportsTable.getSelectedRow() != -1)"/> + </JScrollPane> + </cell> + </row> +</Table> \ No newline at end of file Added: 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 (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -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.accountsreports; + +import static org.nuiton.i18n.I18n._; + + +import javax.swing.JOptionPane; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.ui.transaction.table.FinancialTransactionTable; +import org.chorem.lima.ui.transaction.table.FinancialTransactionTableModel; +import org.chorem.lima.util.ErrorHelper; + +/** + * Handler associated with accounts reports view. + * + * @author chatellier + * @version $Revision: 2884 $ + * + * Last update : $Date: 2010-05-06 11:57:19 +0200 (jeu. 06 mai 2010) $ + * By : $Author: jpepin $ + */ +public class AccountsReportsViewHandler { + + /** log. */ + private static final Log log = + LogFactory.getLog(AccountsReportsViewHandler.class); + + protected AccountsReportsView view; + + protected AccountsReportsViewHandler(AccountsReportsView view) { + this.view = view; + } +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/FinancialTransactionViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/FinancialTransactionViewHandler.java 2010-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/FinancialTransactionViewHandler.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -32,7 +32,7 @@ import org.chorem.lima.util.ErrorHelper; /** - * Handler associated with account view. + * Handler associated with financial transaction view. * * @author chatellier * @version $Revision$ Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTable.java 2010-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTable.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -62,83 +62,26 @@ /** */ - public FinancialTransactionTable(FinancialTransactionViewHandler handler/* - TransactionSortedTableColumnModel columnModel*/) { - //super(model, columnModel); + public FinancialTransactionTable(FinancialTransactionViewHandler handler) { this.handler = handler; - /* - * New Table Header - */ - //header renderer getTableHeader().setDefaultRenderer(TransactionHeaderRenderer.getInstance()); - //getTableHeader().addMouseListener(new TransactionHeaderListener(this)); addKeyListener(this); - - // cell rendering - /*TableColumnModel tcm = getColumnModel(); - tcm.getColumn(TransactionEnum.DATE.ordinal()).setCellRenderer(DateTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.ACCOUNT.ordinal()).setCellRenderer(AccountTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.JOURNAL.ordinal()).setCellRenderer(JournalTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.PERIOD.ordinal()).setCellRenderer(PeriodTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.STATUS.ordinal()).setCellRenderer(StatusTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.DEBIT.ordinal()).setCellRenderer(AmountTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.CREDIT.ordinal()).setCellRenderer(AmountTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.BALANCE.ordinal()).setCellRenderer(AmountTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.DESCRIPTION.ordinal()).setCellRenderer(TextTableCellRenderer.getInstance()); - tcm.getColumn(TransactionEnum.DOCUMENT.ordinal()).setCellRenderer(TextTableCellRenderer.getInstance()); - - // cell editoring - tcm.getColumn(TransactionEnum.DATE.ordinal()).setCellEditor(DateTableCellEditor.getInstance()); - tcm.getColumn(TransactionEnum.ACCOUNT.ordinal()).setCellEditor(AccountTableCellEditor.getInstance()); - tcm.getColumn(TransactionEnum.JOURNAL.ordinal()).setCellEditor(JournalTableCellEditor.getInstance()); - tcm.getColumn(TransactionEnum.DEBIT.ordinal()).setCellEditor(NumberTableCellEditor.getInstance()); - tcm.getColumn(TransactionEnum.CREDIT.ordinal()).setCellEditor(NumberTableCellEditor.getInstance()); - tcm.getColumn(TransactionEnum.DESCRIPTION.ordinal()).setCellEditor(TextTableCellEditor.getInstance()); - tcm.getColumn(TransactionEnum.DOCUMENT.ordinal()).setCellEditor(TextTableCellEditor.getInstance()); - tcm.getColumn(TransactionEnum.PERIOD.ordinal()).setCellEditor(PeriodTableCellEditor.getInstance());*/ - + //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(); + addColorNonBalancedTransaction(); } - - public void addColorEmptyLine() { - // Renvoie une couleur jaune pour chaque nouvelle ligne créée - //removeColorEmptyLine(); - /* if (TransactionFlattenTableModel.isFlattenModel(getModel())) { - final int posNext = ((TransactionFlattenTableModel) getModel()).getEmptyLinePosition(); - HighlightPredicate predicate = new HighlightPredicate() { - - @Override - public boolean isHighlighted(Component arg0, ComponentAdapter adapter) { - return adapter.row == posNext; - } - }; - colorEmptyLine = new ColorHighlighter(predicate, new Color(248,255,136), Color.BLACK,new Color(248,255,136), Color.BLACK); - addHighlighter(colorEmptyLine); - }*/ - } - /** - * - */ - public void removeColorEmptyLine() { - if (colorEmptyLine != null) { - removeHighlighter(colorEmptyLine); - } - } - - /** * 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 @@ -191,24 +134,6 @@ addHighlighter(colorTransaction); } - /* @Override - public FinancialTransactionTableModel getModel() { - return (FinancialTransactionTableModel) this.dataModel; - }*/ - - /* @Override - public TransactionSortedTableColumnModel getColumnModel() { - return (TransactionSortedTableColumnModel) this.columnModel; - }*/ - - /* - public EmptyLineSelectionListener getEmptyLineSelectionListener() { - if (emptyLineSelectionListener == null) { - return new EmptyLineSelectionListener(); - } - return emptyLineSelectionListener; - } -*/ /** * for each action combination key are think * for extend keyboard and laptop keyboard Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTableModel.java 2010-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/transaction/table/FinancialTransactionTableModel.java 2010-05-06 16:48:20 UTC (rev 2886) @@ -120,7 +120,6 @@ List<Object> results = new ArrayList<Object>(); try { - log.debug("CHARGE DEBUT"); List<FinancialTransaction> financialtransactions = transactionService.getAllFinancialTransactionsForFinancialPeriod( selectedFinancialPeriod); @@ -128,8 +127,6 @@ results.add(financialtransaction); results.addAll(financialtransaction.getEntry()); } - log.debug("CHARGE £FIN"); - } catch (LimaException eee) { if (log.isErrorEnabled()) { 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-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-05-06 16:48:20 UTC (rev 2886) @@ -7,6 +7,9 @@ Exercice= Global\ lima\ exception= Loading\ accounting...= +TODO\ begincalendarPanel= +TODO\ endcalendarPanel= +calendarPanel\ TODO= lima.about.message= lima.account=Account lima.account.label=Label @@ -17,6 +20,9 @@ lima.account.type3= lima.account.type4= lima.accountplan=Plan de comptes +lima.accounts= +lima.accountsreports.begincalendar= +lima.accountsreports.endcalendar= lima.actif=Asset lima.action.commandline.disable.main.ui=Do not launch main ui lima.action.commandline.help=Show help in console @@ -295,6 +301,7 @@ lima.subledger.type= lima.success=Success lima.tab.account=Account +lima.tab.accounts= lima.tab.balance=Balance lima.tab.bilan=Results lima.tab.closure=Closure 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-05-06 10:23:43 UTC (rev 2885) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-05-06 16:48:20 UTC (rev 2886) @@ -6,6 +6,9 @@ Do\ you\ really\ want\ to\ delete\ entry\ book\ %s\ ?= Global\ lima\ exception= Loading\ accounting...= +TODO\ begincalendarPanel= +TODO\ endcalendarPanel= +calendarPanel\ TODO= lima.about.message=\u00C0 propos de Lima lima.account=Compte lima.account.label=Libell\u00E9 @@ -17,6 +20,9 @@ lima.account.type2=Passif lima.account.type3=Produit lima.account.type4=Charge +lima.accounts= +lima.accountsreports.begincalendar= +lima.accountsreports.endcalendar= lima.actif=Actif lima.action.commandline.disable.main.ui=Ne pas lancer l'ui lima.action.commandline.help=Afficher l'aide en console @@ -279,6 +285,7 @@ lima.subledger.type= lima.success=Succ\u00E8s lima.tab.account=Plan Comptable +lima.tab.accounts= lima.tab.balance=Balance lima.tab.bilan=Bilan lima.tab.blocked=Block\u00E9
participants (1)
-
jpepin@users.chorem.org