Author: mallon Date: 2012-08-21 16:16:49 +0200 (Tue, 21 Aug 2012) New Revision: 3626 Url: http://chorem.org/repositories/revision/lima/3626 Log: refs #769 Correction Bilan et resultat Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceReportsViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -27,12 +27,18 @@ import com.lowagie.text.BadElementException; import com.lowagie.text.Cell; +import com.lowagie.text.Chapter; +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; import com.lowagie.text.Element; import com.lowagie.text.Font; +import com.lowagie.text.PageSize; import com.lowagie.text.Paragraph; import com.lowagie.text.Phrase; import com.lowagie.text.Rectangle; import com.lowagie.text.Table; +import com.lowagie.text.html.HtmlWriter; +import com.lowagie.text.pdf.PdfWriter; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -75,6 +81,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.InputStream; import java.math.BigDecimal; import java.text.SimpleDateFormat; @@ -227,122 +234,226 @@ } @Override - public String createFinancialStatementsDocuments(Date beginDate, - Date endDate) throws LimaException { - String financialStatementReport = null; + public void createFinancialStatementsDocuments(Date beginDate, + Date endDate, + FormatsEnum format) throws LimaException { + Document document = new Document(PageSize.A4, 8, 8, 8, 8); + List<FinancialStatementAmounts> financialStatementAmounts = + financialStatementService.financialStatementReport(beginDate, endDate); + + Date newDate = new Date(); + String filePath = path + File.separator + DocumentsEnum.FINANCIALSTATEMENT.getFileName(); + try { + FileOutputStream fileOut = new FileOutputStream(filePath + format.getExtension()); - financialStatementReport = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" + - "<html>\n"; - financialStatementReport += constructHeadHtml(_("lima.reports.financialstatement")); - financialStatementReport += "<body>\n"; + switch (format) { + case HTML: + HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut); + break; + case PDF: + PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut); + break; + } + document.open(); + int nbpages = 1; - if (beginDate != null && endDate != null) { + Identity identity = identityService.getIdentity(); - List<FinancialStatementAmounts> financialStatementAmounts = - financialStatementService.financialStatementReport(beginDate, endDate); - //Split list by financialstatement type - List<List<FinancialStatementAmounts>> listList = - new ArrayList<List<FinancialStatementAmounts>>(); - Boolean first = true; - int min = 0; - int size = financialStatementAmounts.size(); - for (int i = 0; i < size; i++) { - FinancialStatementAmounts fStatementAmounts = - financialStatementAmounts.get(i); - if (fStatementAmounts.getLevel() == 1 && !fStatementAmounts.getSubAmount()) { - if (first) { - first = false; - } else { - listList.add(financialStatementAmounts.subList(min, i - 1)); - } - min = i; + //Split list by financialstatement type + List<List<FinancialStatementAmounts>> listList = + new ArrayList<List<FinancialStatementAmounts>>(); + Boolean first = true; + int min = 0; + int size = financialStatementAmounts.size(); + for (int i = 0; i < size; i++) { + FinancialStatementAmounts fStatementAmounts = + financialStatementAmounts.get(i); + if (fStatementAmounts.getLevel() == 1 && !fStatementAmounts.getSubAmount()) { + if (first) { + first = false; + } else { + listList.add(financialStatementAmounts.subList(min, i - 1)); } + min = i; } - listList.add(financialStatementAmounts.subList(min, size)); + } + listList.add(financialStatementAmounts.subList(min, size)); - String boldBegin = "<b>"; - String boldEnd = "</b>"; - //create pages - for (List<FinancialStatementAmounts> list : listList) { - String subTitle = list.get(0).getLabel(); - financialStatementReport += constructSubTitleHtml(boldBegin + subTitle + boldEnd, ""); - int i = 0; - int n = list.size(); - int max = n; - while (i < n) { - int j = i + max; - if (j > n) { - j = n; - } + //create pages + for (List<FinancialStatementAmounts> list : listList) { + String title = list.get(0).getLabel(); + int i = 0; + int n = list.size(); + int max = n; + // alloc nb rows max for pdf documents on one page + if (format == FormatsEnum.PDF) { + max = 35; + } + while (i < n) { + int j = i + max; + if (j > n) { + j = n; + } + List<FinancialStatementAmounts> subFinancialStatementAmounts = + list.subList(i, j); + //create page : header + table + footer + Table headerTable = createFinancialStatementsHeaderTable(); + Table table = createFinancialStatementsTable( + subFinancialStatementAmounts); + //new page + Chapter chapter = new Chapter(0); + //headerPage + chapter.add(createHeaderPage(title, identity, beginDate, endDate)); + //n° page + chapter.add(createNumberPage(nbpages, newDate)); + //headerTable + Paragraph paragraphHeaderTable = new Paragraph(); + paragraphHeaderTable.add(headerTable); + chapter.add(paragraphHeaderTable); + //table + Paragraph paragraphTable = new Paragraph(); + paragraphTable.add(table); + chapter.add(paragraphTable); + //add page + document.add(chapter); + i = i + max; + nbpages++; + } + } - financialStatementReport += "<table border=\"1\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\">\n" + - "<tr align=\"center\">\n"; + document.close(); - String columnNames [] = {_("lima-business.document.label"), _("lima-business.document.grossamount"), - _("lima-business.document.provisiondeprecationamount"), _("lima-business.document.netamount")}; - financialStatementReport += constructColumnsHtml(columnNames); + } catch (FileNotFoundException eeFNFE) { + log.error("Can't create pdf file", eeFNFE); + } catch (DocumentException eeDE) { + log.error("Can't create document", eeDE); + } + } - String tabLabel = ""; - String bigAmountString = "0"; - String provisionDeprecationAmountString = "0"; - String soldeString = "0"; - List<FinancialStatementAmounts> subFinancialStatementAmounts = list.subList(i, j); - for (FinancialStatementAmounts financialStatementAmount : subFinancialStatementAmounts) { + protected Table createFinancialStatementsHeaderTable() { + Table t = null; + try { + t = new Table(4, 1); + float[] widths = {0.4f, 0.2f, 0.2f, 0.2f}; + t.setWidths(widths); + t.setWidth(100f); + t.setPadding(3f); + //defaut cell + Cell cell = new Cell(); + cell.setBorder(Rectangle.LEFT); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + t.setDefaultCell(cell); + t.setOffset(8); + t.addCell(new Phrase(_("lima-business.document.label"), + boldFont)); + t.addCell(new Phrase(_("lima-business.document.grossamount"), + boldFont)); + t.addCell(new Phrase(_("lima-business.document.provisiondeprecationamount"), + boldFont)); + t.addCell(new Phrase(_("lima-business.document.netamount"), + boldFont)); - String label = financialStatementAmount.getLabel(); - int level = financialStatementAmount.getLevel(); - BigDecimal bigAmount = - financialStatementAmount.getGrossAmount(); - if (bigAmount == null) { - bigAmount = new BigDecimal(0); - } - BigDecimal provisionDeprecationAmount = - financialStatementAmount.getProvisionDeprecationAmount(); - if (provisionDeprecationAmount == null) { - provisionDeprecationAmount = new BigDecimal(0); - } + } catch (BadElementException eeBEE) { + log.error("Can't create table", eeBEE); + } + return t; - StringBuffer tab = new StringBuffer(); - for (int k = 0; k < level; k++) { - tab.append("\t"); - } + } - if (financialStatementAmount.getHeader()) { - tabLabel = boldBegin + tab + label + boldEnd; - } else { - tabLabel = tab + label; - } - if (bigAmount != BigDecimal.ZERO) { - bigAmountString = bigAmount.toString(); - } - if (provisionDeprecationAmount != BigDecimal.ZERO) { - provisionDeprecationAmountString = provisionDeprecationAmount.toString(); - } - BigDecimal solde = bigAmount; - solde = solde.subtract(provisionDeprecationAmount); - if (solde != BigDecimal.ZERO) { - soldeString = solde.toString(); - } - } + protected Table createFinancialStatementsTable(List<FinancialStatementAmounts> financialStatementAmounts) { + int nbrow = financialStatementAmounts.size(); + Table t = null; + try { + //define table + t = new Table(4, nbrow); + t.setWidth(100f); + float[] widths = {0.4f, 0.2f, 0.2f, 0.2f}; + t.setWidths(widths); + t.setPadding(1.5f); + t.setBorderWidth(1); + t.setOffset(0); + //define default cell + Cell cell = new Cell(); + cell.setBorder(Rectangle.LEFT); + cell.setHorizontalAlignment(Element.ALIGN_RIGHT); + t.setDefaultCell(cell); - String columnData [] = {(StringUtils.isBlank(tabLabel)?"": tabLabel), bigAmountString, - provisionDeprecationAmountString, soldeString}; - financialStatementReport += constructColumnsHtml(columnData); - i = i + max; - financialStatementReport += "</table>" + - "<p>"; + for (FinancialStatementAmounts financialStatementAmount : financialStatementAmounts) { + + String label = financialStatementAmount.getLabel(); + int level = financialStatementAmount.getLevel(); + BigDecimal grossAmount = + financialStatementAmount.getGrossAmount(); + if (grossAmount == null) { + grossAmount = new BigDecimal(0); + } + BigDecimal provisionDeprecationAmount = + financialStatementAmount.getProvisionDeprecationAmount(); + if (provisionDeprecationAmount == null) { + provisionDeprecationAmount = new BigDecimal(0); + } + + if (financialStatementAmount.getSubAmount() && level == 1) { + cell.setGrayFill(0.88f); + } else if (financialStatementAmount.getSubAmount()) { + cell.setGrayFill(0.94f); + } else { + cell.setGrayFill(1f); + } + if (label == null) { + t.addCell(""); + t.addCell(""); + t.addCell(""); + t.addCell(""); + } else { + //cell1 + StringBuffer tab = new StringBuffer(); + for (int i = 0; i < level; i++) { + tab.append("\t"); } + Phrase phrase; + if (financialStatementAmount.getHeader()) { + phrase = new Phrase(tab + label, boldFont); + } else { + phrase = new Phrase(tab + label, normalFont); + } + Cell c = new Cell(phrase); + c.setHorizontalAlignment(Element.ALIGN_LEFT); + t.addCell(c); + //cell2 + if (grossAmount != BigDecimal.ZERO) { + phrase = new Phrase(String.valueOf( + grossAmount), normalFont); + } else { + phrase = new Phrase(""); + } + t.addCell(phrase); + //cell 3 + if (provisionDeprecationAmount != BigDecimal.ZERO) { + phrase = new Phrase(String.valueOf( + provisionDeprecationAmount), normalFont); + } else { + phrase = new Phrase(""); + } + t.addCell(phrase); + //cell 4 + BigDecimal solde = grossAmount; + solde = solde.subtract(provisionDeprecationAmount); + if (solde != BigDecimal.ZERO) { + phrase = new Phrase(solde.toString(), normalFont); + } else { + phrase = new Phrase(""); + } + t.addCell(phrase); } } - financialStatementReport += "</body>" + - "</html>"; - } catch (Exception ex) { - log.error("Can't create document", ex); + } catch (BadElementException eeBEE) { + log.error("Can't create table", eeBEE); } - return financialStatementReport; + return t; } //############## Ledger ############## Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -223,13 +223,12 @@ Date selectedEndDate, FinancialStatementDatas result) throws LimaException { - List<FinancialStatement> financialStatements = - getChildrenFinancialStatement(financialStatement); + List<FinancialStatement> financialStatements = getChildrenFinancialStatement(financialStatement); BigDecimal grossAmount = new BigDecimal(0), - provisionDeprecationAmount = new BigDecimal(0); - List<FinancialStatementAmounts> subResult = - new ArrayList<FinancialStatementAmounts>(); + provisionDeprecationAmount = new BigDecimal(0); + List<FinancialStatementAmounts> subResult = new ArrayList<FinancialStatementAmounts>(); + for (FinancialStatement subFinancialStatement : financialStatements) { FinancialStatementAmounts financialStatementAmounts = financialStatementAmounts(subFinancialStatement, Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -164,7 +164,7 @@ String generalEntryBooksReport = null; String balanceReport = null; String ledgerReport = null; - String financialReport = null; + //String financialReport = null; //create docs try { @@ -195,8 +195,8 @@ } break; case FINANCIALSTATEMENT: - financialReport = documentService.createFinancialStatementsDocuments( - beginDateFormat, endDateFormat); + documentService.createFinancialStatementsDocuments( + beginDateFormat, endDateFormat, formatsEnum); break; case LEDGER: ledgerReport = documentService.createLedgerDocuments( @@ -226,7 +226,7 @@ resp.setContentType(formatsEnum.getMimeType()); OutputStream out = resp.getOutputStream(); if (accountReport != null || entryBooksReport != null || generalEntryBooksReport != null - || balanceReport != null || ledgerReport != null || financialReport != null) { + || balanceReport != null || ledgerReport != null /*|| financialReport != null*/) { String report = null; if (accountReport != null) { report = accountReport; @@ -238,9 +238,9 @@ report = balanceReport; } else if (ledgerReport != null) { report = ledgerReport; - } else { + } /*else { report = financialReport; - } + }*/ IOUtils.write(report, out, Charsets.UTF_8); } else { InputStream in = doc.openStream(); Modified: trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties =================================================================== --- trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2012-08-21 14:16:49 UTC (rev 3626) @@ -56,6 +56,8 @@ lima-business.document.period2format=%1$te/%1$tm/%1$tY lima-business.document.provisiondeprecationamount=Amortissements et provisions lima-business.document.society=Nom +lima-business.document.product=Produit +lima-business.document.charge=Charge lima-business.document.solde=Solde lima-business.document.soldecredit=Solde Créditeur lima-business.document.soldedebit=Solde Débiteur Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -38,7 +38,7 @@ public interface DocumentService { - String createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException; + void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException; String createLedgerDocuments(Date beginDate, Date endDate) throws LimaException; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -81,7 +81,7 @@ // init data models List<Account> account = accountService.getAllAccounts(); view.getAccountComboboxModel().setObjects(account); - List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllUnblockedFiscalPeriods(); + List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods(); List<FinancialPeriod> financialPeriod = financialPeriodService.getUnblockedFinancialPeriods(); view.getIntervalPanel().init(fiscalPeriod, financialPeriod); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceReportsViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceReportsViewHandler.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceReportsViewHandler.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -79,7 +79,7 @@ public void init() { // init data models - List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllBlockedFiscalPeriods(); + List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods(); List<FinancialPeriod> financialPeriod = financialPeriodService.getUnblockedFinancialPeriods(); view.getIntervalPanel().init(fiscalPeriod, financialPeriod); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -129,7 +129,7 @@ } /** - * Round the value to higher, and the number of decimal to 2; + * Split decimal with scale config * @return bigDecimal value * */ @Override @@ -144,10 +144,15 @@ int pointIndex = stringValue.indexOf("."); if (pointIndex != -1) { LimaConfig config = LimaContext.getContext().getConfig(); - int decimal = config.getScale() + pointIndex + 1; - String roundedStringValue = stringValue.substring(0, pointIndex) + - stringValue.substring(pointIndex, decimal); - cellEditorValue = new BigDecimal(roundedStringValue); + String actualDecimals = stringValue.substring(pointIndex, stringValue.length()-1); + if (config.getScale() > actualDecimals.length()) { + cellEditorValue = new BigDecimal(stringValue); + } else { + int decimalLength = config.getScale() + pointIndex + 1; + String roundedStringValue = stringValue.substring(0, pointIndex) + + stringValue.substring(pointIndex, decimalLength); + cellEditorValue = new BigDecimal(roundedStringValue); + } } else { cellEditorValue = new BigDecimal(stringValue); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -84,7 +84,7 @@ * Init data models and displayed objects. */ public void init() { - List<FiscalPeriod> blockedFiscalPeriods = fiscalPeriodService.getAllBlockedFiscalPeriods(); + List<FiscalPeriod> blockedFiscalPeriods = fiscalPeriodService.getAllFiscalPeriods(); List<FinancialPeriod> financialPeriod = financialPeriodService.getUnblockedFinancialPeriods(); view.getIntervalPanel().init(blockedFiscalPeriods, financialPeriod); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2012-08-21 14:16:49 UTC (rev 3626) @@ -39,13 +39,12 @@ ]]> </script> - <row weightx="1" weighty="0" anchor="center"> - <cell fill='both'> + <row> + <cell> <IntervalPanel id="intervalPanel"/> </cell> <cell> - <JButton text="lima.common.ok" - onActionPerformed="getHandler().createDocument()"/> + <JButton text="lima.common.ok" onActionPerformed="getHandler().createDocument()"/> </cell> </row> </Table> \ No newline at end of file Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -82,7 +82,7 @@ public void init() { // init data models - List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllBlockedFiscalPeriods(); + List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods(); List<FinancialPeriod> financialPeriod = financialPeriodService.getUnblockedFinancialPeriods(); view.getIntervalPanel().init(fiscalPeriod, financialPeriod); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -94,7 +94,7 @@ public void init() { // init data models - List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllUnblockedFiscalPeriods(); + List<FiscalPeriod> fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods(); List<FinancialPeriod> financialPeriod = financialPeriodService.getUnblockedFinancialPeriods(); view.getIntervalPanel().init(fiscalPeriod, financialPeriod); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java 2012-08-21 13:25:54 UTC (rev 3625) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java 2012-08-21 14:16:49 UTC (rev 3626) @@ -70,7 +70,7 @@ * Init data models and displayed objects. */ public void init() { - List<FiscalPeriod> blockedFiscalPeriods = fiscalPeriodService.getAllBlockedFiscalPeriods(); + List<FiscalPeriod> blockedFiscalPeriods = fiscalPeriodService.getAllFiscalPeriods(); List<FinancialPeriod> financialPeriod = financialPeriodService.getUnblockedFinancialPeriods(); view.getIntervalPanel().init(blockedFiscalPeriods, financialPeriod); }