This is an automated email from the git hooks/post-receive script. New commit to branch feature/1158-Corriger-le-comportement-d-ajout-de-transaction in repository lima. See http://git.chorem.org/lima.git commit ce75d9536716f8bee8179994cf34f874634beeae Author: dcosse <cosse@codelutin.com> Date: Wed Jan 20 18:40:32 2016 +0100 refs #1158 Il est de nouveau possible de créer une transaction sur une periode ou un exercice non clos --- .../FinancialTransactionViewHandler.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java index 027dff2..e3b02d4 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java @@ -328,6 +328,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo if ( event.getStateChange() == ItemEvent.SELECTED ) { updateFinancialTransactions(); computePeriodStatusText(); + setAddEntryAllowed(); } } @@ -340,6 +341,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo if ( event.getStateChange() == ItemEvent.SELECTED ) { updateFinancialTransactions(); computePeriodStatusText(); + setAddEntryAllowed(); } } @@ -371,10 +373,20 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo if (financialPeriod != null && entryBook != null) { ClosedPeriodicEntryBook closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, financialPeriod); result = closedPeriodicEntryBook.isLocked(); + if (log.isDebugEnabled()) { + log.debug("Locked:" + result); + } } return result; } + public boolean getIsTableLock() { + FinancialPeriod financialPeriod = (FinancialPeriod) view.getFinancialPeriodComboBox().getSelectedItem(); + EntryBook entryBook = (EntryBook) view.getEntryBookComboBox().getSelectedItem(); + boolean isLock = isTableLock(financialPeriod, entryBook); + return isLock; + } + public void selectionChanged() { FinancialTransactionTable table = view.getFinancialTransactionTable(); FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); @@ -1089,7 +1101,8 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo } protected void setAddEntryAllowed() { - view.setAddEntryAllowed(view.getFinancialTransactionTable().isEditable() && view.getEntryBookComboBoxModel().getSelectedItem() != null); + boolean isTableLock = getIsTableLock(); + view.setAddEntryAllowed(!isTableLock); } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.