branch feature/1218 updated (e39aa14 -> 89caf6e)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1218 in repository lima. See http://git.chorem.org/lima.git discards e39aa14 refs #1218: Plan BCR : exception à la deuxième modification d'un regrouppement adds f8d81c6 refs #1226 Hide close tab button if you cannot close the tab adds 2184fc7 fixes #1226 Hide close tab button if you cannot close the tab Merge branch 'feature/1226' into develop adds e06ef0c fixes #1193 La zone des critères de recherche apparait réduite, les critères de recherche ne sont donc pas visibles, il faudrait définir une taille minimale adds 2581c20 refs #1226 Hide close tab button if you cannot close the tab adds a9d9110 utilisation css adds e8a9357 fixes #1193: La zone des critères de recherche apparait réduite, les critères de recherche ne sont donc pas visibles, il faudrait définir une taille minimale Merge branch 'feature/1193' into develop adds 9243835 change remove icon on tab adds 47dacdc refs #1187 : account popups adds 0e30c25 refs #1187 : entry book popups adds 4ac2c21 refs #1187 : fiscal period popups adds ece040e refs #1187 : inancial statement popups adds 1f5f807 refs #1187 : Vat chart popups adds 37937e4 refs #1187 : identitiy popups adds 964faf1 fixes #1187: Améliorer l'apparence des Popup Merge branch 'feature/1187' into develop adds 3c0f684 refs #1221: Erreur à l'annulation des import/export adds 80adf13 fixes #1221 Erreur à l'annulation des import/export Merge branch 'feature/1221' into develop adds 9aa89d0 refs #1222: Le lettrage ne fonctionne plus adds cc2841b fixes #1222 Le lettrage ne fonctionne plus Merge branch 'feature/1222' into develop adds 8da87c9 refs #1209: A l'ajout automatique d'une écriture le focus ne correspond pas à la cellule éditée adds 275821d fixes #1209 A l'ajout automatique d'une écriture le focus ne correspond pas à la cellule éditée Merge branch 'feature/1209' into develop new 89caf6e refs #1218: Plan BCR : exception à la deuxième modification d'un regrouppement This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (e39aa14) \ N -- N -- N refs/heads/feature/1218 (89caf6e) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 89caf6e9bb57e0465ab27d7b5554e749ac79030b Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 8 09:58:55 2015 +0200 refs #1218: Plan BCR : exception à la deuxième modification d'un regrouppement Summary of changes: .../org/chorem/lima/FinancialStatementWayEnum.java | 42 +--- .../resources/i18n/lima-callao_en_GB.properties | 6 +- .../resources/i18n/lima-callao_fr_FR.properties | 6 +- .../src/main/java/org/chorem/lima/LimaMain.java | 1 + .../org/chorem/lima/enums/AccountsChartEnum.java | 24 +- .../lima/enums/FinancialStatementsChartEnum.java | 22 +- .../chorem/lima/enums/VatStatementsChartEnum.java | 26 +- .../java/org/chorem/lima/ui/ClosableTabHeader.css | 14 +- .../java/org/chorem/lima/ui/ClosableTabHeader.jaxx | 6 +- .../src/main/java/org/chorem/lima/ui/MainView.css | 275 +++++++++++++++++---- .../java/org/chorem/lima/ui/MainViewHandler.java | 1 + .../org/chorem/lima/ui/account/AccountForm.css | 2 + .../org/chorem/lima/ui/account/AccountForm.jaxx | 20 +- .../chorem/lima/ui/account/AccountImportForm.css | 39 +-- .../chorem/lima/ui/account/AccountImportForm.jaxx | 61 ++--- .../chorem/lima/ui/account/AccountViewHandler.java | 2 +- .../chorem/lima/ui/account/UpdateAccountForm.css | 2 + .../chorem/lima/ui/account/UpdateAccountForm.jaxx | 17 +- .../org/chorem/lima/ui/entrybook/EntryBookForm.css | 2 + .../chorem/lima/ui/entrybook/EntryBookForm.jaxx | 20 +- .../lima/ui/entrybook/EntryBookImportForm.css | 2 + .../lima/ui/entrybook/EntryBookImportForm.jaxx | 26 +- .../FinancialStatementChartViewHandler.java | 6 +- .../FinancialStatementHeaderForm.css | 25 +- .../FinancialStatementHeaderForm.jaxx | 65 ++--- .../FinancialStatementImportForm.css | 41 ++- .../FinancialStatementImportForm.jaxx | 84 +++---- .../FinancialStatementMovementForm.css | 16 +- .../FinancialStatementMovementForm.jaxx | 63 +++-- .../FinancialTransactionTable.java | 11 +- .../FinancialTransactionViewHandler.java | 13 +- .../FinancialTransactionSearchView.css | 6 +- .../FinancialTransactionSearchView.jaxx | 7 +- .../FinancialTransactionSearchViewHandler.java | 13 +- .../org/chorem/lima/ui/fiscalperiod/AddPeriod.css | 6 +- .../org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx | 28 +-- .../ui/fiscalperiod/FiscalPeriodViewHandler.java | 70 ++++-- .../fiscalperiod/RetainedEarningsEntryBookForm.css | 33 ++- .../RetainedEarningsEntryBookForm.jaxx | 85 ++----- .../org/chorem/lima/ui/identity/IdentityForm.css | 18 +- .../org/chorem/lima/ui/identity/IdentityForm.jaxx | 130 +++++----- .../chorem/lima/ui/importexport/ImportExport.java | 55 +++-- .../org/chorem/lima/ui/lettering/LetteringView.css | 6 +- .../chorem/lima/ui/vatchart/VatChartImportForm.css | 35 +-- .../lima/ui/vatchart/VatChartImportForm.jaxx | 84 +++---- .../lima/ui/vatchart/VatChartMovementForm.css | 29 ++- .../lima/ui/vatchart/VatChartMovementForm.jaxx | 59 +++-- .../lima/ui/vatchart/VatChartViewHandler.java | 7 +- .../java/org/chorem/lima/util/ReportDialogView.css | 5 +- .../org/chorem/lima/util/ReportDialogView.jaxx | 2 +- .../resources/i18n/lima-swing_en_GB.properties | 13 +- .../resources/i18n/lima-swing_fr_FR.properties | 49 ++-- .../src/main/resources/icons/action-cancel.png | Bin 0 -> 587 bytes ...{action-account-remove.png => action-close.png} | Bin .../src/main/resources/icons/action-closeTab.png | Bin 3140 -> 0 bytes lima-swing/src/main/resources/icons/action-ok.png | Bin 0 -> 537 bytes 56 files changed, 903 insertions(+), 777 deletions(-) create mode 100644 lima-swing/src/main/resources/icons/action-cancel.png copy lima-swing/src/main/resources/icons/{action-account-remove.png => action-close.png} (100%) delete mode 100644 lima-swing/src/main/resources/icons/action-closeTab.png create mode 100644 lima-swing/src/main/resources/icons/action-ok.png -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1218 in repository lima. See http://git.chorem.org/lima.git commit 89caf6e9bb57e0465ab27d7b5554e749ac79030b Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 8 09:58:55 2015 +0200 refs #1218: Plan BCR : exception à la deuxième modification d'un regrouppement --- .../business/api/FinancialStatementService.java | 4 +- .../ejb/FinancialStatementServiceImpl.java | 54 +++++-------- .../lima/business/ejb/ImportServiceImpl.java | 17 ++-- .../FinancialStatementChartTreeTableModel.java | 94 ++++++++++++---------- .../FinancialStatementChartViewHandler.java | 29 ++++--- 5 files changed, 96 insertions(+), 102 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java index af30ffb..a24f032 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java @@ -40,12 +40,12 @@ public interface FinancialStatementService { */ FinancialStatement newFinancialStatement(); - void createMasterFinacialStatements(FinancialStatement masterFinancialStatements); + FinancialStatement createMasterFinacialStatements(FinancialStatement masterFinancialStatements); FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException; - void updateFinancialStatement(FinancialStatement financialStatement); + FinancialStatement updateFinancialStatement(FinancialStatement financialStatement); void removeFinancialStatement(FinancialStatement financialStatement); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java index d98e599..4fb4cb7 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java @@ -23,6 +23,7 @@ package org.chorem.lima.business.ejb; import com.google.common.base.Function; +import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; @@ -46,8 +47,6 @@ import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountTopiaDao; import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialStatementTopiaDao; -import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderFactory; import javax.ejb.EJB; import javax.ejb.Remote; @@ -97,25 +96,6 @@ public class FinancialStatementServiceImpl extends AbstractLimaService implement } } - protected void addFinancialStatementToMaster(FinancialStatement masterFinancialStatement, - FinancialStatement financialStatement) { - if (masterFinancialStatement != null) { - FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao(); - - masterFinancialStatement.addSubFinancialStatements(financialStatement); - - if (masterFinancialStatement.isPersisted()) { - // update the persisted entity to avoid NonUniqueObjectException: A different object with the same identifier value was already associated with the session - FinancialStatement financialStatementToUpdate = financialStatementTopiaDao.forTopiaIdEquals(masterFinancialStatement.getTopiaId()).findUnique(); - Binder<FinancialStatement, FinancialStatement> binder = BinderFactory.newBinder(FinancialStatement.class, FinancialStatement.class); - binder.copy(masterFinancialStatement, financialStatementToUpdate); - financialStatementTopiaDao.update(financialStatementToUpdate); - } else { - financialStatementTopiaDao.create(masterFinancialStatement); - } - } - } - @Override public FinancialStatement newFinancialStatement() { FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao(); @@ -124,29 +104,32 @@ public class FinancialStatementServiceImpl extends AbstractLimaService implement } @Override - public void createMasterFinacialStatements(FinancialStatement masterFinancialStatements) { + public FinancialStatement createMasterFinacialStatements(FinancialStatement masterFinancialStatements) { FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao(); - financialStatementTopiaDao.create(masterFinancialStatements); + FinancialStatement result = financialStatementTopiaDao.create(masterFinancialStatements); + return result; } @Override - public FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement, + public FinancialStatement createFinancialStatement(FinancialStatement parentFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException { - validateNewFinancialStatement(masterFinancialStatement, financialStatement); + validateNewFinancialStatement(parentFinancialStatement, financialStatement); + Preconditions.checkState(parentFinancialStatement.isPersisted(), "parents statement must be persited"); + Preconditions.checkState(! financialStatement.isPersisted(), " statement to create must be not persited"); FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao(); - FinancialStatement result; - if (!financialStatement.isPersisted()) { - result = financialStatementTopiaDao.create(financialStatement); - } else { - result = financialStatement; - } + // refresh parent financialstatement + parentFinancialStatement = financialStatementTopiaDao.forTopiaIdEquals(parentFinancialStatement.getTopiaId()).findUnique(); - addFinancialStatementToMaster(masterFinancialStatement, result); + financialStatement = financialStatementTopiaDao.create(financialStatement); - return result; + parentFinancialStatement.addSubFinancialStatements(financialStatement); + + financialStatementTopiaDao.update(parentFinancialStatement); + + return financialStatement; } @Override @@ -192,13 +175,14 @@ public class FinancialStatementServiceImpl extends AbstractLimaService implement } @Override - public void updateFinancialStatement(FinancialStatement financialStatement) { + public FinancialStatement updateFinancialStatement(FinancialStatement financialStatement) { // TopiaDao FinancialStatementTopiaDao financialStatementHeaderTopiaDao = getDaoHelper().getFinancialStatementDao(); //update - financialStatementHeaderTopiaDao.update(financialStatement); + financialStatement = financialStatementHeaderTopiaDao.update(financialStatement); + return financialStatement; } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java index 188cd3f..b9d34b6 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java @@ -480,7 +480,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ if (rootFinancialStatement == null) { rootFinancialStatement = financialStatement; - rootFinancialStatement = financialStatementService.createFinancialStatement(null, rootFinancialStatement); + rootFinancialStatement = financialStatementService.createMasterFinacialStatements(rootFinancialStatement); } else { // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted // the sub financial statements @@ -527,15 +527,14 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ return alreadyCreated; } - protected FinancialStatement createRootFinancialStatement(Map<String, FinancialStatement> orderedFinancialStatements, String rootMasterName, final FinancialStatement rootFinancialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException { - FinancialStatement _rootFinancialStatement = rootFinancialStatement; - if (_rootFinancialStatement == null) { - _rootFinancialStatement = financialStatementService.newFinancialStatement(); - _rootFinancialStatement.setLabel(rootMasterName); - _rootFinancialStatement = financialStatementService.createFinancialStatement(null, _rootFinancialStatement); - orderedFinancialStatements.put(rootMasterName, _rootFinancialStatement); + protected FinancialStatement createRootFinancialStatement(Map<String, FinancialStatement> orderedFinancialStatements, String rootMasterName, FinancialStatement rootFinancialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException { + if (rootFinancialStatement == null) { + rootFinancialStatement = financialStatementService.newFinancialStatement(); + rootFinancialStatement.setLabel(rootMasterName); + rootFinancialStatement = financialStatementService.createMasterFinacialStatements(rootFinancialStatement); + orderedFinancialStatements.put(rootMasterName, rootFinancialStatement); } - return _rootFinancialStatement; + return rootFinancialStatement; } protected VatStatement returnVATStatement (final VatStatement rootVATStatement, String subVATStatementLabel) throws AlreadyExistVatStatementException, NotAllowedLabelException { diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java index b5f0cab..e2687e8 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java @@ -26,14 +26,16 @@ import com.google.common.collect.Lists; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaSwingConfig; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.api.FinancialStatementService; import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement; import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialStatementImpl; -import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; import org.jdesktop.swingx.treetable.AbstractTreeTableModel; +import org.nuiton.util.beans.Binder; +import org.nuiton.util.beans.BinderFactory; import javax.swing.tree.TreePath; import java.util.List; @@ -58,16 +60,27 @@ public class FinancialStatementChartTreeTableModel extends AbstractTreeTableMode /** Services. */ protected final FinancialStatementService financialStatementService; + Binder<FinancialStatement, FinancialStatement> binderFinancialStatement; + protected ErrorHelper errorHelper; /** Model constructor. Init account service used here. */ public FinancialStatementChartTreeTableModel() { + //create root for the tree super(new FinancialStatementImpl()); - // Gets factory service + + // Gets factory service financialStatementService = LimaServiceFactory.getService(FinancialStatementService.class); + + FinancialStatement master = (FinancialStatement) root; + master.addAllSubFinancialStatements(financialStatementService.getRootFinancialStatements()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); + + binderFinancialStatement = BinderFactory.newBinder(FinancialStatement.class); + } @@ -101,54 +114,33 @@ public class FinancialStatementChartTreeTableModel extends AbstractTreeTableMode @Override public int getChildCount(Object node) { - int result = 0; - if (node == getRoot()) { - result = financialStatementService. - getRootFinancialStatements().size(); - } else { - FinancialStatement parentFinancialStatementHeader = + FinancialStatement parentFinancialStatementHeader = (FinancialStatement) node; - result = parentFinancialStatementHeader.getSubFinancialStatements().size(); - } + int result = parentFinancialStatementHeader.sizeSubFinancialStatements(); return result; } @Override public Object getChild(Object parent, int index) { - Object result = null; - if (parent == getRoot()) { - List<FinancialStatement> financialStatements = - financialStatementService.getRootFinancialStatements(); - result = financialStatements.get(index); - } else { - FinancialStatement parentFinancialStatement = - (FinancialStatement) parent; + FinancialStatement parentFinancialStatement = + (FinancialStatement) parent; - List<FinancialStatement> financialStatements = - Lists.newArrayList(parentFinancialStatement.getSubFinancialStatements()); + List<FinancialStatement> financialStatements = + Lists.newArrayList(parentFinancialStatement.getSubFinancialStatements()); - result = financialStatements.get(index); - } + FinancialStatement result = financialStatements.get(index); return result; } @Override public int getIndexOfChild(Object parent, Object child) { - int result = 0; - - if (parent == getRoot()) { - List<FinancialStatement> financialStatements = - financialStatementService.getRootFinancialStatements(); - result = financialStatements.indexOf(child); - } else { - FinancialStatement parentFinancialStatement = - (FinancialStatement) parent; + FinancialStatement parentFinancialStatement = + (FinancialStatement) parent; - List<FinancialStatement> financialStatements = - Lists.newArrayList(parentFinancialStatement.getSubFinancialStatements()); + List<FinancialStatement> financialStatements = + Lists.newArrayList(parentFinancialStatement.getSubFinancialStatements()); - result = financialStatements.indexOf(child); - } + int result = financialStatements.indexOf(child); return result; } @@ -183,13 +175,17 @@ public class FinancialStatementChartTreeTableModel extends AbstractTreeTableMode @Override public boolean isLeaf(Object node) { - return getChildCount(node) == 0; + FinancialStatement financialStatement = (FinancialStatement) node; + return financialStatement != getRoot() && !financialStatement.isHeader(); } /** Refresh FinancialStatementChart. */ public void refreshTree() { + FinancialStatement master = (FinancialStatement) root; + master.setSubFinancialStatements(financialStatementService.getRootFinancialStatements()); + modelSupport.fireNewRoot(); } @@ -204,12 +200,22 @@ public class FinancialStatementChartTreeTableModel extends AbstractTreeTableMode // Calling account service FinancialStatement parentFinancialStatementHeader = (FinancialStatement) path.getLastPathComponent(); - if (parentFinancialStatementHeader == getRoot()) { - parentFinancialStatementHeader = null; - } + try { - financialStatementService.createFinancialStatement( - parentFinancialStatementHeader, financialStatement); + + if (parentFinancialStatementHeader == getRoot()) { + financialStatement = financialStatementService.createMasterFinacialStatements( + financialStatement); + parentFinancialStatementHeader.addSubFinancialStatements(financialStatement); + } else { + financialStatement = financialStatementService.createFinancialStatement( + parentFinancialStatementHeader, financialStatement); + binderFinancialStatement.copy(financialStatement.getMasterFinancialStatement(), parentFinancialStatementHeader); + } + + modelSupport.fireTreeStructureChanged(path); + + } catch (AlreadyExistFinancialStatement alreadyExistFinancialStatement) { errorHelper.showErrorMessage(t("lima.financialStatement.error.alreadyExistFinancialStatement", alreadyExistFinancialStatement.getFinancialStatementLabel(), alreadyExistFinancialStatement.getMasterLabel())); @@ -217,7 +223,6 @@ public class FinancialStatementChartTreeTableModel extends AbstractTreeTableMode errorHelper.showErrorMessage(t("lima.error.notAllowedLabel", notAllowedLabel.getLabel())); } - modelSupport.fireTreeStructureChanged(path); } @@ -229,8 +234,9 @@ public class FinancialStatementChartTreeTableModel extends AbstractTreeTableMode */ public void updateFinancialStatement(TreePath path, FinancialStatement financialStatement) { - financialStatementService.updateFinancialStatement(financialStatement); - modelSupport.fireTreeStructureChanged(path); + FinancialStatement updateFinancialStatement = financialStatementService.updateFinancialStatement(financialStatement); + binderFinancialStatement.copy(updateFinancialStatement, financialStatement); + modelSupport.firePathChanged(path); } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java index e0f3e35..3fb4314 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java @@ -24,6 +24,7 @@ package org.chorem.lima.ui.financialstatementchart; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.FinancialStatementService; import org.chorem.lima.business.api.ImportService; @@ -32,15 +33,20 @@ import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialStatementImpl; import org.chorem.lima.enums.FinancialStatementsChartEnum; import org.chorem.lima.enums.ImportExportEnum; -import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.ui.importexport.ImportExport; import org.chorem.lima.util.ReportDialogView; import org.jdesktop.swingx.JXTreeTable; import org.nuiton.util.Resource; -import javax.swing.*; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; +import javax.swing.InputMap; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.JTextArea; +import javax.swing.KeyStroke; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; @@ -255,18 +261,13 @@ public class FinancialStatementChartViewHandler implements ServiceListener { (FinancialStatementChartTreeTableModel) treeTable.getTreeTableModel(); // get selected account - int selectedRow = view.treeTable.getSelectedRow(); - TreePath treePath = view.treeTable.getPathForRow(selectedRow); // not null + int selectedRow = treeTable.getSelectedRow(); + TreePath treePath = treeTable.getPathForRow(selectedRow); // not null FinancialStatement financialStatement = (FinancialStatement) treePath.getLastPathComponent(); //update Account or update SubLedger if (financialStatement != null) { - // get current selection path - if (selectedRow != -1) { - treePath = view.treeTable.getPathForRow(selectedRow); - } else { - treePath = new TreePath(treeTableModel.getRoot()); - } + //test if selectedrow is account or ledger log.debug(financialStatement.isHeader()); if (financialStatement.isHeader()) { @@ -390,7 +391,11 @@ public class FinancialStatementChartViewHandler implements ServiceListener { (FinancialStatementsChartEnum) value; ImportExport importExport = new ImportExport(view); importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT, - null, financialStatementsEnum.getDefaultFileUrl(), true); + null, null, true); + + FinancialStatementChartTreeTableModel treeTableModel = (FinancialStatementChartTreeTableModel) view.getTreeTable().getTreeTableModel(); + + treeTableModel.refreshTree(); } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm