r3628 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
Author: mallon Date: 2012-08-22 13:05:07 +0200 (Wed, 22 Aug 2012) New Revision: 3628 Url: http://chorem.org/repositories/revision/lima/3628 Log: refs #769 Correction sur l edition du grand livre et les sous-tableaux des entrees. Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.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-22 10:06:55 UTC (rev 3627) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-08-22 11:05:07 UTC (rev 3628) @@ -328,76 +328,6 @@ BigDecimal currentAmountCredit = new BigDecimal(0); String accountcarry = ""; - /*ledgerReport += "<table>" + - "<tr> " + - "<td>" + - "<table align=\"left\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-size:13px;\" >\n" + - "<tr>\n"; - - String boldItalicBegin = "<b>" + "<i>"; - String boldItalicEnd = "</i>" + "</b>"; - Identity identity = identityService.getIdentity(); - - String [] columnsNameSociety = {boldItalicBegin + identity.getName()+ boldItalicEnd}; - ledgerReport += constructColumnsHtml(columnsNameSociety, ""); - - ledgerReport += "<tr>\n"; - String [] columnsDescription = {"<i>" + identity.getDescription()+ "</i>"}; - ledgerReport += constructColumnsHtml(columnsDescription, ""); - - ledgerReport += "<tr>\n"; - String [] columnsAdressOne = {"<i>" + identity.getAddress() + "</i>"}; - ledgerReport += constructColumnsHtml(columnsAdressOne, ""); - - ledgerReport += "<tr>\n"; - String [] columnsAdressTwo = {"<i>" + identity.getAddress2() + "</i>"}; - ledgerReport += constructColumnsHtml(columnsAdressTwo, ""); - - ledgerReport += "<tr>\n"; - String [] columnsZipCode = {"<i>" + identity.getZipCode() + "</i>"}; - ledgerReport += constructColumnsHtml(columnsZipCode, ""); - - ledgerReport += "<tr>\n"; - String [] columnsCity = {"<i>" + identity.getCity()+ "</i>"}; - ledgerReport += constructColumnsHtml(columnsCity, ""); - - ledgerReport += "</table>\n" + - "</td>" + - "<td valign=\"middle\" align=\"center\" style=\"width:100%\">" + - "<p style=\"font-size:30px;\">" + _("lima-business.document.ledger") + "</p>" + - "</td>" + - "<td>" + - "<table align=\"right\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-size:13px;\" >\n"; - - ledgerReport += "<tr>\n"; - String [] columnsBusinessNumber = {boldItalicBegin + _("lima-business.document.businessnumber") + - boldItalicEnd, "<i>" + identity.getBusinessNumber()+ "</i>"}; - ledgerReport += constructColumnsHtml(columnsBusinessNumber, ""); - - ledgerReport += "<tr>\n"; - String [] columnsClassifCode = {boldItalicBegin + _("lima-business.document.classificationcode") + - boldItalicEnd, "<i>" + identity.getClassificationCode()+ "</i>"}; - ledgerReport += constructColumnsHtml(columnsClassifCode, ""); - - ledgerReport += "<tr>\n"; - String [] columnsVatNumber = {boldItalicBegin + _("lima-business.document.vatnumber") + boldItalicEnd, - "<i>" + identity.getVatNumber()+ "</i>", }; - ledgerReport += constructColumnsHtml(columnsVatNumber, ""); - - ledgerReport += "<tr>\n"; - String [] columnsPeriodOne = {boldItalicBegin + _("lima-business.document.period1") + boldItalicEnd, "<i>" - + _("lima-business.document.period1format", beginDate)+ "</i>"}; - ledgerReport += constructColumnsHtml(columnsPeriodOne, ""); - - ledgerReport += "<tr>\n"; - String [] columnsPeriodTwo = {boldItalicBegin + _("lima-business.document.period2") + boldItalicEnd, "<i>" - + _("lima-business.document.period2format", endDate)+ "</i>"}; - ledgerReport += constructColumnsHtml(columnsPeriodTwo, ""); - - ledgerReport += "</table>" + - "</td>" + - "</table>";*/ - List<Object> subList = list.subList(i, j); @@ -416,9 +346,15 @@ boldBegin + _("lima-business.document.credit") + boldEnd, boldBegin + _("lima-business.document.solde") + boldEnd}; ledgerReport += constructColumnsHtml(columnsNames, ""); + int indexEntry = -1; for (Object object : subList) { if (object instanceof ReportsDatas) { - + if (indexEntry != -1) { + indexEntry = -1; + ledgerReport += "</table>" + + "</td>" + + "</tr>"; + } ReportsDatas reportsDatas = (ReportsDatas) object; String accountS = ""; @@ -435,6 +371,7 @@ ledgerReport += constructColumnsHtml(columnsTable, ""); } else { + indexEntry++; Entry entry = (Entry) object; String entryBookCode = ""; @@ -450,21 +387,22 @@ amountCredit = entry.getAmount(); } - ledgerReport +="<tr><td>"; - ledgerReport += "<table align=\"right\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-size:13px;\" >\n" + + ledgerReport +="<tr>"; + if (indexEntry == 0) { + ledgerReport += "<td><table align=\"right\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-size:13px;\" >\n" + "<tr>\n"; - String [] columnsEntry = {boldBegin + _("lima-business.document.date")+ boldEnd, - boldBegin + _("lima-business.document.entrybook") + boldEnd, boldBegin + _("lima-business.document.voucher") + boldEnd, - boldBegin + _("lima-business.document.description") + boldEnd, boldBegin + _("lima-business.document.debit") + boldEnd, - boldBegin + _("lima-business.document.credit") + boldEnd, boldBegin + _("lima-business.document.solde") + boldEnd}; - ledgerReport += constructColumnsHtml(columnsEntry, ""); + String [] columnsEntry = {boldBegin + _("lima-business.document.date")+ boldEnd, + boldBegin + _("lima-business.document.entrybook") + boldEnd, boldBegin + _("lima-business.document.voucher") + boldEnd, + boldBegin + _("lima-business.document.description") + boldEnd, boldBegin + _("lima-business.document.debit") + boldEnd, + boldBegin + _("lima-business.document.credit") + boldEnd, boldBegin + _("lima-business.document.solde") + boldEnd}; + ledgerReport += constructColumnsHtml(columnsEntry, ""); + } String [] columnsTable = {_("lima-business.document.dateformat",entry.getFinancialTransaction().getTransactionDate()), entryBookCode, entry.getVoucher(), entry.getDescription(), amountDebit.toString(), amountCredit.toString(), amountDebit.subtract(amountCredit).toString()}; ledgerReport += constructColumnsHtml(columnsTable, ""); - ledgerReport += "</table>" + - "</td></tr>"; + ledgerReport += "</tr>"; } } @@ -1024,7 +962,7 @@ List<Entry> entries = results.getListEntry(); String[] columnNames = {_("lima.table.number"), _("lima.table.date"), _("lima.table.entrybook"), - _("lima.table.voucher"), _("lima.table.decription"), _("lima.table.letter"), + _("lima.table.voucher"), _("lima.table.description"), _("lima.table.letter"), _("lima.table.debit"), _("lima.table.credit")}; accountReport += "<body>\n" +
participants (1)
-
mallon@users.chorem.org