Author: vsalaun Date: 2011-07-01 11:52:07 +0200 (Fri, 01 Jul 2011) New Revision: 3192 Url: http://chorem.org/repositories/revision/lima/3192 Log: #413 ajout automatique d'une ligne ?\195?\160 l'autre des pieces comptables si deja presente 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/FinancialTransactionViewHandler.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 2011-06-30 09:47:13 UTC (rev 3191) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2011-07-01 09:52:07 UTC (rev 3192) @@ -415,11 +415,14 @@ * @return int: indexOf new Entry * @throws LimaException */ - public int addEmptyEntry(Object value, String description, int row) throws LimaException { + public int addEmptyEntry(Object value, String voucher, String description, int row) throws LimaException { FinancialTransaction currentTransaction = null; Object currentRow = cacheDataList.get(row); Entry entry = new EntryImpl(); entry.setAmount(BigDecimal.ZERO); + if (voucher != null) { + entry.setVoucher(voucher); + } if (description != null) { entry.setDescription(description); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2011-06-30 09:47:13 UTC (rev 3191) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2011-07-01 09:52:07 UTC (rev 3192) @@ -146,9 +146,10 @@ if (indexSelectedRow != -1) { Object selectedValue = tableModel.getElementAt(indexSelectedRow); try { - //copy + paste the description + //copy + paste the voucher and the description + String voucher = (String) tableModel.getValueAt(indexSelectedRow, 2); String description = (String) tableModel.getValueAt(indexSelectedRow, 4); - int index = tableModel.addEmptyEntry(selectedValue, description, indexSelectedRow); + int index = tableModel.addEmptyEntry(selectedValue, voucher, description, indexSelectedRow); //select the new line ListSelectionModel selectionModel = table.getSelectionModel();