Author: echatellier Date: 2012-06-07 10:04:04 +0200 (Thu, 07 Jun 2012) New Revision: 3452 Url: http://chorem.org/repositories/revision/lima/3452 Log: Amelioration du rapport journal general Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 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-06-06 15:32:14 UTC (rev 3451) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-06-07 08:04:04 UTC (rev 3452) @@ -715,9 +715,6 @@ return t; } - //############## EntryBooks ############## - - @Override public void createEntryBooksDocuments(Date beginDate, Date endDate, @@ -779,39 +776,24 @@ String title = _("lima-business.document.entrybooktitle", closedPeriodicEntryBook.getEntryBook().getLabel(), closedPeriodicEntryBook.getFinancialPeriod().getBeginDate()); - //list = list.subList(1, list.size()); - int i = 0; - int n = entries.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<Entry> subEntries = - entries.subList(i, j); - //create page - Table table = createEntryBooksTable(subEntries, debit, credit); - //new page - Chapter chapter = new Chapter(0); - //headerPage - chapter.add(createHeaderPage(title, identity, - beginDate, endDate)); - //n° page - chapter.add(createNumberPage(nbpages, newDate)); - //table - Paragraph paragraphTable = new Paragraph(); - paragraphTable.add(table); - chapter.add(paragraphTable); - //add page - document.add(chapter); - i = i + max; - nbpages++; - } + + //create page + Table table = createEntryBooksTable(entries, debit, credit); + //new page + Chapter chapter = new Chapter(0); + //headerPage + chapter.add(createHeaderPage(title, identity, + beginDate, endDate)); + //n° page + chapter.add(createNumberPage(nbpages, newDate)); + //table + Paragraph paragraphTable = new Paragraph(); + paragraphTable.add(table); + chapter.add(paragraphTable); + //add page + document.add(chapter); + + nbpages++; } document.close(); @@ -1203,45 +1185,28 @@ //create pages - 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<GeneralEntryBooksDatas> subList = - list.subList(i, j); - //create page : header + table + footer - Table headerTable = createGeneralEntryBooksHeaderTable(); - Table table = createGeneralEntryBooksTable(subList); - //new page - Chapter chapter = new Chapter(0); - //headerPage - chapter.add(createHeaderPage( - DocumentsEnum.GENERAL_ENTRYBOOK.getDescription(), - 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++; - } + Table headerTable = createGeneralEntryBooksHeaderTable(); + Table table = createGeneralEntryBooksTable(list); + //new page + Chapter chapter = new Chapter(0); + //headerPage + chapter.add(createHeaderPage( + DocumentsEnum.GENERAL_ENTRYBOOK.getDescription(), + 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); + nbpages++; document.close(); @@ -1250,7 +1215,7 @@ } } - public Table createGeneralEntryBooksHeaderTable() { + protected Table createGeneralEntryBooksHeaderTable() { Table t = null; try { t = new Table(5, 1); @@ -1314,8 +1279,7 @@ phrase = new Phrase(_("lima-business.document.amounts"), boldFont); } else { - phrase = new Phrase(_("lima-business.document.amounts") - + " " + generalEntryBooksDatas.getPeriod(), + phrase = new Phrase(_("lima-business.document.amountsperiod", generalEntryBooksDatas.getPeriod()), boldFont); } Cell cell2 = new Cell(phrase); Modified: trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties =================================================================== --- trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2012-06-06 15:32:14 UTC (rev 3451) +++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2012-06-07 08:04:04 UTC (rev 3452) @@ -19,6 +19,7 @@ lima-business.defaultaccountingrules.missingentrybook=Can't block financialperiod / missing EntryBook in transactions lima-business.document.accountnumber=Account N° lima-business.document.amounts=Amounts +lima-business.document.amountsperiod=Amounts %1$tB %1$tY lima-business.document.balance=Balance lima-business.document.businessnumber=Business N° lima-business.document.carryback=Carry Back 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-06-06 15:32:14 UTC (rev 3451) +++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2012-06-07 08:04:04 UTC (rev 3452) @@ -19,6 +19,7 @@ lima-business.defaultaccountingrules.missingentrybook=Impossible de bloquer la période financière / il manque un journal dans une transaction (%1$te/%1$tm/%1$tY) lima-business.document.accountnumber=N° Compte lima-business.document.amounts=Totaux +lima-business.document.amountsperiod=Totaux %1$tB %1$tY lima-business.document.balance=Balance lima-business.document.businessnumber=N° Siret lima-business.document.carryback=Report