Author: mallon Date: 2012-07-06 16:26:12 +0200 (Fri, 06 Jul 2012) New Revision: 3500 Url: http://chorem.org/repositories/revision/lima/3500 Log: Remise ?\195?\160 z?\195?\169ro des d?\195?\169bits / cr?\195?\169dit / soldes lorsqu'aucune ligne n'est s?\195?\169lectionn?\195?\169e. Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-07-06 13:28:17 UTC (rev 3499) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-07-06 14:26:12 UTC (rev 3500) @@ -268,21 +268,11 @@ * */ @Override public List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean filtreLettre) throws LimaException { - List<FinancialTransaction> financialTransactions = null; - List<Entry> entries = new ArrayList<Entry>(); + List<Entry> entries; - /* try{ - FinancialTransactionDAO transactionDAO = getDaoHelper().getFinancialTransactionDAO(); - financialTransactions = transactionDAO.findAllByDates(beginDate, endDate); - }catch (Exception ex){ - throw new LimaException("Can't get financial transactions", ex); - }*/ - try { EntryDAO entryDAO = getDaoHelper().getEntryDAO(); - //for (FinancialTransaction financialTransaction : financialTransactions){ - entries = entryDAO.findAllEntryByAccountAndLettering(beginDate, endDate, account, filtreLettre); - // } + entries = entryDAO.findAllEntryByAccountAndLettering(beginDate, endDate, account, filtreLettre); } catch (Exception ex) { throw new LimaException("Can't get entries", ex); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-06 13:28:17 UTC (rev 3499) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-06 14:26:12 UTC (rev 3500) @@ -211,7 +211,6 @@ /**Managing components when n rows are selected * */ if (!isSelectionEmpty()){ - boolean debitSelected = selectedEntry.getDebit(); BigDecimal amountSelected = selectedEntry.getAmount(); @@ -225,13 +224,9 @@ if (debitVal == BigDecimal.ZERO){ BigDecimal creditVal = debitSelected ? BigDecimal.ZERO : amountSelected; - if (creditVal != BigDecimal.ZERO){ creditTotal = creditTotal.add(creditVal); soldeTotal = soldeTotal.subtract(creditVal); - }else{ - creditTotal = creditTotal.add(creditVal); - soldeTotal = soldeTotal.add(creditVal); } }else{ debitTotal = debitTotal.add(debitVal); @@ -261,6 +256,11 @@ setLettrer(true); } } + else{ + setDebit(BigDecimal.ZERO); + setCredit(BigDecimal.ZERO); + setSolde(BigDecimal.ZERO); + } } @Override