Author: echatellier Date: 2012-05-15 15:02:06 +0200 (Tue, 15 May 2012) New Revision: 3423 Url: http://chorem.org/repositories/revision/lima/3423 Log: Autorisation de la modification du journal. Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2012-05-15 12:48:56 UTC (rev 3422) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2012-05-15 13:02:06 UTC (rev 3423) @@ -310,7 +310,12 @@ currentFinancialTransaction.setTransactionDate((Date) value); break; case 1: - if (currentFinancialTransaction.getEntry() != null) { + // FIXME echatellier 20120515 je ne comprend pas pourquoi + // il n'est pas possible de changer le journal si la transaction + // a des entrées + // update : autorisation si le journal est null au moins + if (currentFinancialTransaction.getEntry() != null + && currentFinancialTransaction.getEntryBook() != null) { // not authorized to change the value return; } @@ -410,7 +415,11 @@ // FIXME echatellier 20120413 une modification des dates fait que l'ordre // devient faux int trIndex = indexOf(currentFinancialTransaction); - fireTableRowsUpdated(trIndex, trIndex + currentFinancialTransaction.getEntry().size()); + int endIndex = trIndex; + if (currentFinancialTransaction.getEntry() != null) { + endIndex += currentFinancialTransaction.getEntry().size(); + } + fireTableRowsUpdated(trIndex, endIndex); } catch (LimaException ex) { throw new LimaRuntimeException("Can't propagate data modification to service", ex);