Author: rchapelet Date: 2009-08-19 17:38:35 +0200 (Wed, 19 Aug 2009) New Revision: 2678 Added: trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanActifEnum.java trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanPassifEnum.java trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanActifTableModel.java trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanPassifTableModel.java Removed: trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanTableModel.java Modified: trunk/lima-main/src/main/java/org/chorem/lima/bilan/Bilan.java trunk/lima-main/src/main/java/org/chorem/lima/table/model/ResultChargesTableModel.java trunk/lima-main/src/main/java/org/chorem/lima/table/renderer/TransactionAllCellRenderer.java trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanView.jaxx trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanViewImpl.java Log: Cr?\195?\169ation du bilan. Il fontionne pour l'instant sur un exemple simple (cad sans amortissements). Il reste ?\195?\160 am?\195?\169liorer le rendu, mettre les amortissements, tester sur des exemples plus complexes, compl?\195?\169ter avec le r?\195?\169sultat pour avoir actif et passif ?\195?\169quilibr?\195?\169. Modified: trunk/lima-main/src/main/java/org/chorem/lima/bilan/Bilan.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/bilan/Bilan.java 2009-08-19 15:36:51 UTC (rev 2677) +++ trunk/lima-main/src/main/java/org/chorem/lima/bilan/Bilan.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -19,13 +19,9 @@ package org.chorem.lima.bilan; -import org.chorem.lima.dto.AccountDTO; -import org.chorem.lima.dto.EntryDTO; -import org.chorem.lima.dto.PeriodDTO; -import org.chorem.lima.dto.TransactionDTO; -import org.chorem.lima.dto.util.DTOHelper; -import org.chorem.lima.Main; -import org.chorem.lima.service.util.ServiceHelper; +import org.chorem.lima.dto.BilanDTO; +import org.chorem.lima.dto.BalanceDTO; +import org.chorem.lima.util.Util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -35,206 +31,67 @@ /** * @author Rémi Chapelet */ -public class Bilan { -/** +public class Bilan extends BilanDTO { + private static final Log log = LogFactory.getLog(Bilan.class); + private List<BalanceDTO> listBalance; - private BilanDTO ACTIF_IMMOBILISE = new BilanDTO("ACTIF_IMMOBILISE","0",new LinkedList()); - private BilanDTO ACTIF_IMMOBILISE_INCORPOREL = new BilanDTO("ACTIF_IMMOBILISE_INCORPOREL","0",new LinkedList()); - private BilanDTO ACTIF_IMMOBILISE_CORPOREL = new BilanDTO("ACTIF_IMMOBILISE_CORPOREL","0",new LinkedList()); - private BilanDTO ACTIF_IMMOBILISE_FINANCIER = new BilanDTO("ACTIF_IMMOBILISE_FINANCIER","0",new LinkedList()); - private BilanDTO ACTIF_CIRCULANT = new BilanDTO("ACTIF_CIRCULANT","0",new LinkedList()); - private BilanDTO ACTIF_CIRCULANT_STOCK = new BilanDTO("ACTIF_CIRCULANT_STOCK","0",new LinkedList()); - private BilanDTO ACTIF_CIRCULANT_AVANCES = new BilanDTO("ACTIF_CIRCULANT_AVANCES","0",new LinkedList()); - private BilanDTO ACTIF_CIRCULANT_CREANCES = new BilanDTO("ACTIF_CIRCULANT_CREANCES","0",new LinkedList()); - private BilanDTO ACTIF_CIRCULANT_VMP = new BilanDTO("ACTIF_CIRCULANT_VMP","0",new LinkedList()); - private BilanDTO ACTIF_CIRCULANT_DISPONIBILITE = new BilanDTO("ACTIF_CIRCULANT_DISPONIBILITE","0",new LinkedList()); - private BilanDTO ACTIF_CIRCULANT_CCA = new BilanDTO("ACTIF_CIRCULANT_CCA","0",new LinkedList()); - private BilanDTO PASSIF_CP_CAPITAL = new BilanDTO("PASSIF_CP_CAPITAL","0",new LinkedList()); - private BilanDTO PASSIF_CP_RESERVES = new BilanDTO("PASSIF_CP_RESERVES","0",new LinkedList()); - private BilanDTO PASSIF_CP_RAN = new BilanDTO("PASSIF_CP_RAN","0",new LinkedList()); - private BilanDTO PASSIF_CP_RESULTAT = new BilanDTO("PASSIF_CP_RESULTAT","0",new LinkedList()); - private BilanDTO PASSIF_CP_SUBVENTION = new BilanDTO("PASSIF_CP_SUBVENTION","0",new LinkedList()); - private BilanDTO PASSIF_CP_PROVISION = new BilanDTO("PASSIF_CP_PROVISION","0",new LinkedList()); - private BilanDTO PASSIF_PROVISIONS = new BilanDTO("PASSIF_PROVISIONS","0",new LinkedList()); - private BilanDTO PASSIF_DETTES = new BilanDTO("PASSIF_DETTES","0",new LinkedList()); - private BilanDTO PASSIF_DETTES_EMPRUNTS = new BilanDTO("PASSIF_DETTES_EMPRUNTS","0",new LinkedList()); - private BilanDTO PASSIF_DETTES_AVANCES = new BilanDTO("PASSIF_DETTES_AVANCES","0",new LinkedList()); - private BilanDTO PASSIF_DETTES_FOURNISSEURS = new BilanDTO("PASSIF_DETTES_FOURNISSEURS","0",new LinkedList()); - private BilanDTO PASSIF_DETTES_FISCALES = new BilanDTO("PASSIF_DETTES_FISCALES","0",new LinkedList()); - private BilanDTO PASSIF_DETTES_IMMOBILISATIONS = new BilanDTO("PASSIF_DETTES_IMMOBILISATIONS","0",new LinkedList()); - private BilanDTO PASSIF_DETTES_AUTRES_DETTES = new BilanDTO("PASSIF_DETTES_AUTRES_DETTES","0",new LinkedList()); - private BilanDTO PASSIF_DETTES_PCA = new BilanDTO("PASSIF_DETTES_PCA","0",new LinkedList()); - - private List<BilanDTO> listBilan = new LinkedList<BilanDTO>(); - - private List<AccountDTO> listAccount = ServiceHelper.getAllFlatAccount(Main.getContext().getDataManager().getAccountModel().getData()); - - - public Bilan () { - - // Immobilisés - addAccountBilan("2",ACTIF_IMMOBILISE); - addAccountBilan("20",ACTIF_IMMOBILISE_INCORPOREL); - addAccountBilan("21",ACTIF_IMMOBILISE_CORPOREL); - addAccountBilan("22",ACTIF_IMMOBILISE_FINANCIER); - addAccountBilan("23",ACTIF_IMMOBILISE_FINANCIER); - addAccountBilan("25",ACTIF_IMMOBILISE_FINANCIER); - addAccountBilan("26",ACTIF_IMMOBILISE_FINANCIER); - addAccountBilan("27",ACTIF_IMMOBILISE_FINANCIER); - // Circulant - addAccountBilan("3",ACTIF_CIRCULANT); - addAccountBilan("4",ACTIF_CIRCULANT); - addAccountBilan("5",ACTIF_CIRCULANT); - addAccountBilan("486",ACTIF_CIRCULANT); // compte CCA - addAccountBilan("31",ACTIF_CIRCULANT_STOCK); - addAccountBilan("32",ACTIF_CIRCULANT_STOCK); - addAccountBilan("33",ACTIF_CIRCULANT_STOCK); - addAccountBilan("34",ACTIF_CIRCULANT_STOCK); - addAccountBilan("35",ACTIF_CIRCULANT_STOCK); - addAccountBilan("36",ACTIF_CIRCULANT_STOCK); - addAccountBilan("37",ACTIF_CIRCULANT_STOCK); - addAccountBilan("38",ACTIF_CIRCULANT_STOCK); - addAccountBilan("41",ACTIF_CIRCULANT_CREANCES); - addAccountBilan("50",ACTIF_CIRCULANT_VMP); - addAccountBilan("51",ACTIF_CIRCULANT_DISPONIBILITE); - addAccountBilan("52",ACTIF_CIRCULANT_DISPONIBILITE); - addAccountBilan("53",ACTIF_CIRCULANT_DISPONIBILITE); - addAccountBilan("54",ACTIF_CIRCULANT_DISPONIBILITE); - addAccountBilan("58",ACTIF_CIRCULANT_DISPONIBILITE); - addAccountBilan("59",ACTIF_CIRCULANT_DISPONIBILITE); - addAccountBilan("486",ACTIF_CIRCULANT_CCA); - - - // Capitaux propres - addAccountBilan("101",PASSIF_CP_CAPITAL); - addAccountBilan("104",PASSIF_CP_CAPITAL); - addAccountBilan("105",PASSIF_CP_CAPITAL); - addAccountBilan("107",PASSIF_CP_CAPITAL); - addAccountBilan("108",PASSIF_CP_CAPITAL); - addAccountBilan("109",PASSIF_CP_CAPITAL); - addAccountBilan("106",PASSIF_CP_RESERVES); - addAccountBilan("11",PASSIF_CP_RAN); - addAccountBilan("12",PASSIF_CP_RESULTAT); - addAccountBilan("13",PASSIF_CP_SUBVENTION); - addAccountBilan("14",PASSIF_CP_PROVISION); - // Provisions - addAccountBilan("15",PASSIF_PROVISIONS); - addAccountBilan("16",PASSIF_DETTES_EMPRUNTS); - addAccountBilan("15",PASSIF_DETTES_AVANCES); - addAccountBilan("40",PASSIF_DETTES_FOURNISSEURS); - addAccountBilan("43",PASSIF_DETTES_FISCALES); - addAccountBilan("44",PASSIF_DETTES_FISCALES); - addAccountBilan("999",PASSIF_DETTES_IMMOBILISATIONS); - addAccountBilan("999",PASSIF_DETTES_AUTRES_DETTES); - addAccountBilan("487",PASSIF_DETTES_PCA); - - - listBilan.add(ACTIF_IMMOBILISE_INCORPOREL); - listBilan.add(ACTIF_IMMOBILISE_CORPOREL); - listBilan.add(ACTIF_IMMOBILISE_FINANCIER); - listBilan.add(ACTIF_CIRCULANT_STOCK); - listBilan.add(ACTIF_CIRCULANT_AVANCES); - listBilan.add(ACTIF_CIRCULANT_CREANCES); - listBilan.add(ACTIF_CIRCULANT_VMP); - listBilan.add(ACTIF_CIRCULANT_CCA); - listBilan.add(PASSIF_CP_CAPITAL); - listBilan.add(PASSIF_CP_RESERVES); - listBilan.add(PASSIF_CP_RAN); - listBilan.add(PASSIF_CP_RESULTAT); - listBilan.add(PASSIF_CP_SUBVENTION); - listBilan.add(PASSIF_CP_PROVISION); - listBilan.add(PASSIF_PROVISIONS); - + public Bilan () + { + super(); } - private void addAccountBilan (String numberAccount,BilanDTO bilan) + public Bilan (String name, String total, List<BalanceDTO> listBalance) { - // Recherche du compte avec le numéro - AccountDTO account = ServiceHelper.findAccountById(listAccount, numberAccount); - if (account != null) + super(name,total); + if ( listBalance == null) { - bilan.addChild(account); + this.listBalance = new LinkedList<BalanceDTO>(); + } else { + this.listBalance = listBalance; } } - private BilanDTO returnCategory (String accountNumber) - { - log.debug("****** BilanCategory"); - BilanDTO result = null; - for (BilanDTO bilan : listBilan) - { - log.debug("Bilan : "+bilan.getName()); - String numberCategory = ""; - for ( AccountDTO account : bilan.getAccount() ) - { - log.debug("Account : "+account.getIdNumber()); - if ( accountNumberCategory(account.getIdNumber(),accountNumber) ) - { - log.debug("Bingo !"); - if ( numberCategory.length() < account.getIdNumber().length()) - { - numberCategory = account.getIdNumber(); - result = bilan; - } - } - } - } - return result; + /** + * @return the listBalance + */ + public List<BalanceDTO> getListBalance() { + return listBalance; } + /** + * @param listBalance the listBalance to set + */ + public void setListBalance(List<BalanceDTO> listBalance) { + this.listBalance = listBalance; + } - - private boolean accountNumberCategory (String number,String numberAccount) + /** + * Ajoute la balance dans le bilan + * @param balance + */ + public void add (BalanceDTO balance) { - int result = 1; - int size = number.length(); - if ( size <= numberAccount.length()) + if (balance != null) { - log.debug("Size "+size+" number :"+number+" numberAccount :"+numberAccount); - result = number.compareTo(numberAccount.substring(0, size)); - log.debug("Result :"+result); - log.debug("Resize :"+numberAccount.substring(0, size)); + listBalance.add(balance); } - return result == 0; } - - - - public void bilan (PeriodDTO period) { - - // Récupère toutes les transactions comptables - List<TransactionDTO> listAllTransaction = Main.getContext().getDataManager().getTransactionModel().getData(); - // Récupère toutes les transactions de la période - List<TransactionDTO> listTransaction = ServiceHelper.findTransactionByPeriod(period, listAllTransaction); - - - // Pour chaque transaction comptable - if ( listTransaction != null ) { - for (TransactionDTO transaction : listTransaction) - { - List<EntryDTO> listEntries = transaction.getEntries(); - // Pour chaque entrée - for (EntryDTO entry : listEntries) - { - // Récupère son numéro de compte - AccountDTO account = entry.getAccount(); - // Mise en place de la catégorie pour cette entrée comptable - BilanDTO bilan = returnCategory(account.getIdNumber()); - float Total = Float.parseFloat(bilan.total.replace(',','.')); - float Ajout = Float.parseFloat(entry.getAmount().replace(',','.')); - bilan.total = Float.toString(Total + Ajout); - log.debug(bilan.getName()+" : "+bilan.total); - } - } + /** + * + * @param balance + * @param total + */ + public void add (BalanceDTO balance, String total) + { + if (balance != null) + { + this.setTotal(Util.AddNumbersString(this.getTotal(), total)); + listBalance.add(balance); } - } - -*/ - } \ No newline at end of file Added: trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanActifEnum.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanActifEnum.java (rev 0) +++ trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanActifEnum.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -0,0 +1,35 @@ +/** + * *##% Lima + * Copyright (C) 2009 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.enumeration; + +/** + * @author Rémi Chapelet + */ +public enum BilanActifEnum { + + /** + * + */ + ACTIF, + /** + * + */ + TOTAL +} Added: trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanPassifEnum.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanPassifEnum.java (rev 0) +++ trunk/lima-main/src/main/java/org/chorem/lima/enumeration/BilanPassifEnum.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -0,0 +1,35 @@ +/** + * *##% Lima + * Copyright (C) 2009 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.enumeration; + +/** + * @author Rémi Chapelet + */ +public enum BilanPassifEnum { + + /** + * + */ + PASSIF, + /** + * + */ + TOTAL +} Copied: trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanActifTableModel.java (from rev 2646, trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanTableModel.java) =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanActifTableModel.java (rev 0) +++ trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanActifTableModel.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -0,0 +1,117 @@ +/** + * *##% Lima-Callao + * Copyright (C) 2009 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.table.model; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import static org.nuiton.i18n.I18n._; +import org.chorem.lima.bilan.Bilan; +import org.chorem.lima.dto.util.DTOHelper; +import org.chorem.lima.enumeration.BilanActifEnum; + +import javax.swing.table.AbstractTableModel; +import java.util.List; + + +/** + * @author Remi Chapelet + */ +public class BilanActifTableModel extends AbstractTableModel { + + /** + * log + */ + private static final Log log = LogFactory.getLog(BilanActifTableModel.class); + private List<Bilan> data; + + + + /** + * @param list + */ + public BilanActifTableModel(List<Bilan> list) { + data = list; + } + + /** + * @return + */ + public List<Bilan> getData() { + return data; + } + + public void setData(List<Bilan> listBalance) { + data = listBalance; + } + + @Override + public int getRowCount() { + return data.size(); + } + + @Override + public int getColumnCount() { + return 2; + } + + /** + * @param row + * @return + */ + public Bilan getRow(int row) { + return data.get(row); + } + + @Override + public Object getValueAt(int row, int col) { + Object res = null; + Object current = getRow(row); + if (current instanceof Bilan) { + Bilan bilan = (Bilan) current; + switch (BilanActifEnum.values()[col]) { + case ACTIF: + return bilan.getName(); + case TOTAL: + return bilan.getTotal(); + } + } + return res; + } + + @Override + public String getColumnName(int col) { + String res = DTOHelper.EMPTY_STRING; + switch (BilanActifEnum.values()[col]) { + case ACTIF: + res = _("lima.account"); + break; + case TOTAL: + res = _("lima.result.charge"); + break; + } + return res; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + +} Property changes on: trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanActifTableModel.java ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanPassifTableModel.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanPassifTableModel.java (rev 0) +++ trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanPassifTableModel.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -0,0 +1,117 @@ +/** + * *##% Lima-Callao + * Copyright (C) 2009 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.table.model; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import static org.nuiton.i18n.I18n._; +import org.chorem.lima.bilan.Bilan; +import org.chorem.lima.dto.util.DTOHelper; +import org.chorem.lima.enumeration.BilanPassifEnum; + +import javax.swing.table.AbstractTableModel; +import java.util.List; + + +/** + * @author Remi Chapelet + */ +public class BilanPassifTableModel extends AbstractTableModel { + + /** + * log + */ + private static final Log log = LogFactory.getLog(BilanPassifTableModel.class); + private List<Bilan> data; + + + + /** + * @param list + */ + public BilanPassifTableModel(List<Bilan> list) { + data = list; + } + + /** + * @return + */ + public List<Bilan> getData() { + return data; + } + + public void setData(List<Bilan> listBalance) { + data = listBalance; + } + + @Override + public int getRowCount() { + return data.size(); + } + + @Override + public int getColumnCount() { + return 2; + } + + /** + * @param row + * @return + */ + public Bilan getRow(int row) { + return data.get(row); + } + + @Override + public Object getValueAt(int row, int col) { + Object res = null; + Object current = getRow(row); + if (current instanceof Bilan) { + Bilan bilan = (Bilan) current; + switch (BilanPassifEnum.values()[col]) { + case PASSIF: + return bilan.getName(); + case TOTAL: + return bilan.getTotal(); + } + } + return res; + } + + @Override + public String getColumnName(int col) { + String res = DTOHelper.EMPTY_STRING; + switch (BilanPassifEnum.values()[col]) { + case PASSIF: + res = _("lima.account"); + break; + case TOTAL: + res = _("lima.result.charge"); + break; + } + return res; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + +} Deleted: trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanTableModel.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanTableModel.java 2009-08-19 15:36:51 UTC (rev 2677) +++ trunk/lima-main/src/main/java/org/chorem/lima/table/model/BilanTableModel.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -1,192 +0,0 @@ -/** - * *##% Lima-Callao - * Copyright (C) 2009 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.table.model; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import static org.nuiton.i18n.I18n._; -import org.chorem.lima.dto.PeriodDTO; -import org.chorem.lima.dto.StatusDTO; -import org.chorem.lima.dto.TransactionDTO; -import org.chorem.lima.dto.util.DTOHelper; -import org.chorem.lima.enumeration.ClosureEnum; -import org.chorem.lima.service.PeriodService; -import org.chorem.lima.service.ServiceFactory; -import org.chorem.lima.service.util.ServiceHelper; - -import javax.swing.table.AbstractTableModel; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.List; - - -/** - * @author Remi Chapelet - */ -public class BilanTableModel extends AbstractTableModel { - - /** - * log - */ - private static final Log log = LogFactory.getLog(ClosureTableModel.class); - private final List<PeriodDTO> data; - /** - * Services - */ - protected final PeriodService periodServ; - - /** - * Change support delegate - */ - private final PropertyChangeSupport changeSupport = new PropertyChangeSupport(this); - public final String UPDATE_PROPERTY = "update"; - - /** - * @param list - */ - public BilanTableModel(List<PeriodDTO> list) { - data = list; - /** Services */ - periodServ = ServiceFactory.getServiceFactory().getPeriodService(); - } - - /** - * @return - */ - public List<PeriodDTO> getData() { - return data; - } - - @Override - public int getRowCount() { - return data.size(); - } - - @Override - public int getColumnCount() { - return 2; - } - - /** - * @param row - * @return - */ - public PeriodDTO getRow(int row) { - return data.get(row); - } - - @Override - public Object getValueAt(int row, int col) { - Object res = null; - Object current = getRow(row); - if (current instanceof PeriodDTO) { - PeriodDTO period = (PeriodDTO) current; - switch (ClosureEnum.values()[col]) { - case NAME: - return (ServiceHelper.dateToMonth(period.getBegin())+" "+(period.getBegin().getYear()+1900)); - case DESCRIPTION: - String desc = _("lima.period.close"); - if ( period.getStatus().getIdType().equals(ServiceHelper.PE_OPEN) ) - { - desc = _("lima.period.open"); - } - return desc; - } - } - return res; - } - - @Override - public String getColumnName(int col) { - String res = DTOHelper.EMPTY_STRING; - switch (ClosureEnum.values()[col]) { - case NAME: - res = _("lima.model.name"); - break; - case DESCRIPTION: - res = _("lima.model.etat"); - break; - } - return res; - } - - @Override - public void setValueAt(Object value, int row, int col) { - String cellValue = (String) value; - Object current = getRow(row); - if (current instanceof PeriodDTO) { - PeriodDTO period = (PeriodDTO) current; - switch (ClosureEnum.values()[col]) { - case NAME: - period.getStatus().getIdType(); - break; - case DESCRIPTION: - period.getStatus().getIdType(); - break; - } - changeSupport.firePropertyChange(UPDATE_PROPERTY, null, period); - } - } - - @Override - public boolean isCellEditable(int rowIndex, int columnIndex) { - return false; - } - - - - /** - * Register listener. - * - * @param listener The listener to be added. - */ - public void addPropertyChangeListener(PropertyChangeListener listener) { - changeSupport.addPropertyChangeListener(listener); - } - - /** - * Register listener. - * - * @param propertyName The target property - * @param listener The listener to be added. - */ - public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { - changeSupport.addPropertyChangeListener(propertyName, listener); - } - - /** - * Unregister listener. - * - * @param listener The listener to be removed. - */ - public void removePropertyChangeListener(PropertyChangeListener listener) { - changeSupport.removePropertyChangeListener(listener); - } - - /** - * Unregister listener. - * - * @param propertyName The target property - * @param listener The listener to be removed. - */ - public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { - changeSupport.removePropertyChangeListener(propertyName, listener); - } -} Modified: trunk/lima-main/src/main/java/org/chorem/lima/table/model/ResultChargesTableModel.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/table/model/ResultChargesTableModel.java 2009-08-19 15:36:51 UTC (rev 2677) +++ trunk/lima-main/src/main/java/org/chorem/lima/table/model/ResultChargesTableModel.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -25,7 +25,6 @@ import org.chorem.lima.dto.BalanceDTO; import org.chorem.lima.dto.util.DTOHelper; import org.chorem.lima.enumeration.ResultChargeEnum; -import org.chorem.lima.util.Util; import javax.swing.table.AbstractTableModel; import java.util.List; Modified: trunk/lima-main/src/main/java/org/chorem/lima/table/renderer/TransactionAllCellRenderer.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/table/renderer/TransactionAllCellRenderer.java 2009-08-19 15:36:51 UTC (rev 2677) +++ trunk/lima-main/src/main/java/org/chorem/lima/table/renderer/TransactionAllCellRenderer.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -56,11 +56,6 @@ /** * Définition des couleurs */ - // Si la cellule est sélectionnée - if ( hasFocus ) - { - setBackground(new Color(254,254,165)); - } // Récupère la JXTable des transactions TransactionJXTable t = (TransactionJXTable) table; // Récupère la nature de la ligne @@ -70,24 +65,39 @@ // Si la transaction n'est pas équilibrée if ( !DTOHelper.isBalanced((TransactionDTO) t.getModel().getElementAt(row)) ) { + // Si la cellule est sélectionnée + if ( hasFocus ) + { + setBackground(new Color(255,193,190)); + } // Si la cellule est sur la ligne, et non sélectionnée if ( isSelected && !hasFocus ) { setBackground(new Color(251,92,92)); } } else { + // Si la cellule est sélectionnée + if ( hasFocus ) + { + setBackground(new Color(252,252,57)); + } // Si la cellule est sur la ligne, et non sélectionnée if ( isSelected && !hasFocus ) { - setBackground(new Color(192,192,192)); + setBackground(new Color(254,254,165)); } } } else { /** La ligne est une entrée */ + // Si la cellule est sélectionnée + if ( hasFocus ) + { + setBackground(new Color(254,254,165)); + } // Si la cellule est sur la ligne, et non sélectionnée if ( isSelected && !hasFocus ) { - setBackground(new Color(236,236,236)); + setBackground(new Color(252,255,214)); } } return this; Modified: trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanView.jaxx =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanView.jaxx 2009-08-19 15:36:51 UTC (rev 2677) +++ trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanView.jaxx 2009-08-19 15:38:35 UTC (rev 2678) @@ -16,11 +16,14 @@ </cell> </row> - <!-- Affichage du bilan --> - <row columns="2" weightx="1" weighty="1" anchor="center" fill="both"> + <!-- Affichage du bilan (actif et passif) --> + <row weightx="1" weighty="6" anchor="center" fill="both"> <cell> - <JScrollPane id="tableBilan" /> + <JScrollPane id="tabActif" /> </cell> + <cell> + <JScrollPane id="tabPassif" /> + </cell> </row> <!-- Affichage du résultat --> Modified: trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanViewImpl.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanViewImpl.java 2009-08-19 15:36:51 UTC (rev 2677) +++ trunk/lima-main/src/main/java/org/chorem/lima/ui/BilanViewImpl.java 2009-08-19 15:38:35 UTC (rev 2678) @@ -19,25 +19,24 @@ package org.chorem.lima.ui; - import org.chorem.lima.combobox.renderer.PeriodComboBoxRenderer; +import org.chorem.lima.dto.BalanceDTO; import org.chorem.lima.bilan.Bilan; -import org.chorem.lima.dto.AccountDTO; -import org.chorem.lima.dto.BalanceDTO; -import org.chorem.lima.dto.EntryDTO; -import org.chorem.lima.dto.TransactionDTO; import org.chorem.lima.dto.PeriodDTO; import org.chorem.lima.balance.Balance; +import org.chorem.lima.balance.Category; import org.chorem.lima.Main; import org.chorem.lima.service.util.ServiceHelper; +import org.chorem.lima.table.model.BilanActifTableModel; +import org.chorem.lima.table.model.BilanPassifTableModel; +import org.chorem.lima.util.Util; import static org.nuiton.i18n.I18n._; +import org.jdesktop.swingx.decorator.HighlighterFactory; import org.jdesktop.swingx.JXTable; -import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.table.*; -import java.util.Date; +import java.util.Hashtable; import java.util.List; import java.util.LinkedList; import java.util.Vector; @@ -48,60 +47,269 @@ public class BilanViewImpl extends BilanView { private JComboBox comboBoxPeriod = new JComboBox (); - //private final JXTable table ; - private Bilan bb = new Bilan(); - + private JXTable tableActif; + private JXTable tablePassif; + private BilanActifTableModel modelBilanActif; + private BilanPassifTableModel modelBilanPassif; private Balance balance = new Balance(); - + /** * Constructor */ public BilanViewImpl() { - //tableBilan + // Initialise la combobox pour les périodes initComboBoxPeriod(); - /** - table = new JXTable(Main.getContext().getDataManager().getClosureModel()); - table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); - table.setColumnControlVisible(true); - tableBilan.setViewportView(table); - * */ + // Création des modèles + modelBilanActif = new BilanActifTableModel(null); + modelBilanPassif = new BilanPassifTableModel(null); - //TBilan.setBorder(BorderFactory.createLineBorder(Color.black)); + // Charge les produits et charges + updateBilan(); - String[] columnNames = {"Actif","Net","Passif","Net"}; + /** ACTIF */ + tableActif = new JXTable(modelBilanActif); + /** Design de la table */ + tableActif.setRowHeight(24); + // Permet d'alterner les couleurs des lignes pour le tableau + tableActif.setHighlighters(HighlighterFactory.createAlternateStriping()); + tableActif.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); + tableActif.setColumnControlVisible(true); + // Ajout du tableau + tabActif.setViewportView(tableActif); - Object[][] data = { - {"a","\n\nb\r\n\n","c","d"},{"a","b","c","d"},{"a","b","c","d"}, - {"a","b","c","d"},{"a","b","c","d"},{"a","b","c","d"} - }; + /** PASSIF */ + tablePassif = new JXTable(modelBilanPassif); + /** Design de la table */ + tablePassif.setRowHeight(24); + // Permet d'alterner les couleurs des lignes pour le tableau + tablePassif.setHighlighters(HighlighterFactory.createAlternateStriping()); + tablePassif.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); + tablePassif.setColumnControlVisible(true); + // Ajout du tableau + tabPassif.setViewportView(tablePassif); - JTable table = new JTable (data,columnNames); - - - //bb.bilan((PeriodDTO) comboBoxPeriod.getSelectedItem()); - - - tableBilan.setViewportView(table); - - - /** * Ajout d'un listener lorsque l'utilisateur change de période. */ comboBoxPeriod.addItemListener(new ItemListener() { - @Override + @Override public void itemStateChanged(ItemEvent e) { - //bb.bilan((PeriodDTO) comboBoxPeriod.getSelectedItem()); + updateBilan(); } - }); - // Création de la balance - List<BalanceDTO> listBalance = balance.createBalance(Main.getContext().getDataManager().getCurrentPeriod()); + } + public void updateBilan () + { + log.debug("Update bilan :"); + // Chargement de la balance + List<BalanceDTO> ListbalanceDTO = balance.createBalance((PeriodDTO) comboBoxPeriod.getSelectedItem()); + /** ACTIF */ + Hashtable<String,Bilan> actifTab = new Hashtable<String,Bilan>(); + actifTab.put("ACTIF_IMMOBILISE_INCORPOREL", new Bilan("ACTIF_IMMOBILISE_INCORPOREL","0",null)); + actifTab.put("ACTIF_IMMOBILISE_CORPOREL", new Bilan("ACTIF_IMMOBILISE_CORPOREL","0",null)); + actifTab.put("ACTIF_IMMOBILISE_FINANCIER", new Bilan("ACTIF_IMMOBILISE_FINANCIER","0",null)); + actifTab.put("ACTIF_CIRCULANT_STOCK", new Bilan("ACTIF_CIRCULANT_STOCK","0",null)); + actifTab.put("ACTIF_CIRCULANT_AVANCES", new Bilan("ACTIF_CIRCULANT_AVANCES","0",null)); + actifTab.put("ACTIF_CIRCULANT_CREANCES", new Bilan("ACTIF_CIRCULANT_CREANCES","0",null)); + actifTab.put("ACTIF_CIRCULANT_VMP", new Bilan("ACTIF_CIRCULANT_VMP","0",null)); + actifTab.put("ACTIF_CIRCULANT_DISPONIBILITE", new Bilan("ACTIF_CIRCULANT_DISPONIBILITE","0",null)); + actifTab.put("ACTIF_CIRCULANT_CCA", new Bilan("ACTIF_CIRCULANT_CCA","0",null)); + /** PASSIF */ + Hashtable<String,Bilan> passifTab = new Hashtable<String,Bilan>(); + passifTab.put("PASSIF_CP_CAPITAL", new Bilan("PASSIF_CP_CAPITAL","0",null)); + passifTab.put("PASSIF_CP_RESERVES", new Bilan("PASSIF_CP_RESERVES","0",null)); + passifTab.put("PASSIF_CP_RAN", new Bilan("PASSIF_CP_RAN","0",null)); + passifTab.put("PASSIF_CP_RESULTAT", new Bilan("PASSIF_CP_RESULTAT","0",null)); + passifTab.put("PASSIF_CP_SUBVENTION", new Bilan("PASSIF_CP_SUBVENTION","0",null)); + passifTab.put("PASSIF_CP_PROVISION", new Bilan("PASSIF_CP_PROVISION","0",null)); + passifTab.put("PASSIF_PROVISIONS", new Bilan("PASSIF_PROVISIONS","0",null)); + passifTab.put("PASSIF_DETTES_EMPRUNTS", new Bilan("PASSIF_DETTES_EMPRUNTS","0",null)); + passifTab.put("PASSIF_DETTES_AVANCES", new Bilan("PASSIF_DETTES_AVANCES","0",null)); + passifTab.put("PASSIF_DETTES_FOURNISSEURS", new Bilan("PASSIF_DETTES_FOURNISSEURS","0",null)); + passifTab.put("PASSIF_DETTES_FISCALES", new Bilan("PASSIF_DETTES_FISCALES","0",null)); + passifTab.put("PASSIF_DETTES_IMMOBILISATIONS", new Bilan("PASSIF_DETTES_IMMOBILISATIONS","0",null)); + passifTab.put("PASSIF_DETTES_AUTRES_DETTES", new Bilan("PASSIF_DETTES_AUTRES_DETTES","0",null)); + passifTab.put("PASSIF_DETTES_PCA", new Bilan("PASSIF_DETTES_PCA","0",null)); + + // Category + for ( BalanceDTO balanceDTO : ListbalanceDTO) + { + /** + * ACTIF + */ + /** IMMOBILISATION */ + if ( Category.accountNumberCategory("20", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_IMMOBILISE_INCORPOREL").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + if ( Category.accountNumberCategory("21", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_IMMOBILISE_CORPOREL").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + if ( Category.accountNumberCategory("22", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("23", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("25", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("26", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("27", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_IMMOBILISE_FINANCIER").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + /** ACTIF CIRCULANT */ + if ( Category.accountNumberCategory("31", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("32", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("33", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("34", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("35", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("36", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("37", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_CIRCULANT_STOCK").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + if ( Category.accountNumberCategory("99", balanceDTO.getAccount().getIdNumber()) ) + { + // TODO + //actifTab.get("ACTIF_CIRCULANT_AVANCES").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + if ( Category.accountNumberCategory("41", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_CIRCULANT_CREANCES").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + if ( Category.accountNumberCategory("50", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_CIRCULANT_VMP").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + if ( Category.accountNumberCategory("51", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("52", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("53", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("54", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("35", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("36", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("37", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_CIRCULANT_DISPONIBILITE").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + if ( Category.accountNumberCategory("486", balanceDTO.getAccount().getIdNumber()) ) + { + actifTab.get("ACTIF_CIRCULANT_CCA").add(balanceDTO,Util.SubNumbersString(balanceDTO.getDebit(), balanceDTO.getCredit())); + } + /** + * PASSIF + */ + /** CAPITAUX PROPRES */ + if ( Category.accountNumberCategory("101", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("104", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("105", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("107", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("108", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("109", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("37", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_CP_CAPITAL").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("106", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_CP_RESERVES").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("11", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_CP_RAN").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("12", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_CP_RESULTAT").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("13", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_CP_SUBVENTION").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("14", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_CP_PROVISION").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + /** PROVISIONS */ + if ( Category.accountNumberCategory("15", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_PROVISIONS").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + /** DETTES */ + if ( Category.accountNumberCategory("16", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_DETTES_EMPRUNTS").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("15", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_DETTES_AVANCES").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("40", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_DETTES_FOURNISSEURS").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("43", balanceDTO.getAccount().getIdNumber()) || + Category.accountNumberCategory("44", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_DETTES_FISCALES").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("999", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_DETTES_IMMOBILISATIONS").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("9999", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_DETTES_AUTRES_DETTES").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + if ( Category.accountNumberCategory("487", balanceDTO.getAccount().getIdNumber()) ) + { + passifTab.get("PASSIF_DETTES_PCA").add(balanceDTO,Util.SubNumbersString(balanceDTO.getCredit(), balanceDTO.getDebit())); + } + + } + + /** ACTIF */ + List<Bilan> listActif = new LinkedList<Bilan>(); + listActif.add(new Bilan("ACTIF IMMOBILISE","0",null)); + listActif.add(actifTab.get("ACTIF_IMMOBILISE_INCORPOREL")); + listActif.add(actifTab.get("ACTIF_IMMOBILISE_CORPOREL")); + listActif.add(actifTab.get("ACTIF_IMMOBILISE_FINANCIER")); + listActif.add(new Bilan("ACTIF CIRCULANT","0",null)); + listActif.add(actifTab.get("ACTIF_CIRCULANT_STOCK")); + listActif.add(actifTab.get("ACTIF_CIRCULANT_AVANCES")); + listActif.add(actifTab.get("ACTIF_CIRCULANT_CREANCES")); + listActif.add(actifTab.get("ACTIF_CIRCULANT_VMP")); + listActif.add(actifTab.get("ACTIF_CIRCULANT_DISPONIBILITE")); + listActif.add(actifTab.get("ACTIF_CIRCULANT_CCA")); + // Création du modèle à partir de la liste précédement créée + modelBilanActif.setData(listActif); + modelBilanActif.fireTableDataChanged(); + + /** PASSIF */ + List<Bilan> listPassif = new LinkedList<Bilan>(); + listPassif.add(new Bilan("CAPITAUX PROPRES","0",null)); + listPassif.add(passifTab.get("PASSIF_CP_CAPITAL")); + listPassif.add(passifTab.get("PASSIF_CP_RESERVES")); + listPassif.add(passifTab.get("PASSIF_CP_RAN")); + listPassif.add(passifTab.get("PASSIF_CP_SUBVENTION")); + listPassif.add(passifTab.get("PASSIF_CP_RESERVES")); + listPassif.add(passifTab.get("PASSIF_CP_PROVISION")); + listPassif.add(new Bilan("PROVISIONS","0",null)); + listPassif.add(passifTab.get("PASSIF_PROVISIONS")); + listPassif.add(new Bilan("DETTES","0",null)); + listPassif.add(passifTab.get("PASSIF_DETTES_EMPRUNTS")); + listPassif.add(passifTab.get("PASSIF_DETTES_AVANCES")); + listPassif.add(passifTab.get("PASSIF_DETTES_FOURNISSEURS")); + listPassif.add(passifTab.get("PASSIF_DETTES_FISCALES")); + listPassif.add(passifTab.get("PASSIF_DETTES_IMMOBILISATIONS")); + listPassif.add(passifTab.get("PASSIF_DETTES_AUTRES_DETTES")); + listPassif.add(passifTab.get("PASSIF_DETTES_PCA")); + + // Création du modèle à partir de la liste précédement créée + modelBilanPassif.setData(listPassif); + modelBilanPassif.fireTableDataChanged(); + }