This is an automated email from the git hooks/post-receive script. New commit to branch feature/newReportBuilder in repository lima. See http://git.chorem.org/lima.git commit 8138d5b0ebff1c6296cdad4320fcb50b7843c1e2 Author: dcosse <japbiw74> Date: Thu Jan 22 18:12:42 2015 +0100 refs #769 services for Leger report --- .../chorem/lima/business/LimaServiceConfig.java | 40 ++++ .../lima/business/ejb/ReportServiceImpl.java | 1 - .../ejb/report/BalanceReportServiceImpl.java | 2 +- .../report/GeneralEntryBookReportServiceImpl.java | 3 +- .../ejb/report/LedgerReportServiceImpl.java | 201 ++++++++++----------- .../ProvisionalEntryBookReportServiceImpl.java | 2 +- .../resources/i18n/lima-business_fr_FR.properties | 1 + lima-callao/src/main/xmi/accounting-model.zargo | Bin 55585 -> 56859 bytes lima-web/src/main/assembly/bin.xml | 35 ++++ .../chorem/lima/web/action/DocumentService.java | 137 -------------- .../chorem/lima/web/service/HttpServerService.java | 3 +- 11 files changed, 179 insertions(+), 246 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java b/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java index ef75c48..aeb870c 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java +++ b/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java @@ -376,6 +376,43 @@ public class LimaServiceConfig { config.setOption(ServiceConfigOption.GENERAL_ENTRY_BOOK_ENTRY_REPORT_MODEL_PATH.key, path); config.saveForUser(); } + + public String getGeneralLedgerDocumentReportModelPath() { + String result = config.getOption(ServiceConfigOption. + GENERAL_LEDGER_DOCUMENT_REPORT_MODEL_PATH.getKey()); + return result; + } + + public void setGeneralLedgerDocumentReportModelPath(String path) { + config.setOption(ServiceConfigOption. + GENERAL_LEDGER_DOCUMENT_REPORT_MODEL_PATH.key, path); + config.saveForUser(); + } + + public String getGeneralLedgerModelPath() { + String result = config.getOption(ServiceConfigOption. + GENERAL_LEDGER_MODEL_PATH.getKey()); + return result; + } + + public void setGeneralLedgerModelPath(String path) { + config.setOption(ServiceConfigOption. + GENERAL_LEDGER_MODEL_PATH.key, path); + config.saveForUser(); + } + + public String getGeneralLedgerEntryModelPath() { + String result = config.getOption(ServiceConfigOption. + GENERAL_LEDGER_ENTRY_MODEL_PATH.getKey()); + return result; + } + + public void setGeneralLedgerEntryModelPath(String path) { + config.setOption(ServiceConfigOption. + GENERAL_LEDGER_ENTRY_MODEL_PATH.key, path); + config.saveForUser(); + } + // ** FIN REPORT PART ** @@ -413,6 +450,9 @@ public class LimaServiceConfig { ENTRY_BOOK_FINANCIAL_PERIOD_REPORT_MODEL_PATH("lima.config.documentReport.entrybook.financialPeriodModelPath", n("lima.config.documentReport.entrybook.financialPeriodModelPath.description"), ROOT_PATH + "/lima-web/src/main/jasperreports/entryBook/FinancialPeriodReport.jrxml", String.class, false, false), ENTRY_BOOK_TRANSACTION_REPORT_MODEL_PATH("lima.config.documentReport.entrybook.transactionReportModelPath", n("lima.config.documentReport.entrybook.transactionReportModelPath.description"), ROOT_PATH + "/lima-web/src/main/jasperreports/entryBook/TransactionReport.jrxml", String.class, false, false), + GENERAL_LEDGER_DOCUMENT_REPORT_MODEL_PATH("lima.config.documentReport.generalLedger.documentReportModelPath", n("lima.config.documentReport.generalLedger.documentReportModelPath.description"), ROOT_PATH + "/lima-web/src/main/jasperreports/generalLedger/DocumentReport.jrxml", String.class, false, false), + GENERAL_LEDGER_MODEL_PATH("lima.config.documentReport.generalLedger.generalLedgerModelPath", n("lima.config.documentReport.generalLedger.generalLedgerModelPath.description"), ROOT_PATH + "/lima-web/src/main/jasperreports/generalLedger/generalLedgerReport.jrxml", String.class, false, false), + GENERAL_LEDGER_ENTRY_MODEL_PATH("lima.config.documentReport.generalLedger.generalLedgerEntryModelPath", n("lima.config.documentReport.generalLedger.generalLedgerEntryModelPath.description"), ROOT_PATH + "/lima-web/src/main/jasperreports/generalLedger/generalLedgerEntryReport.jrxml", String.class, false, false), SCALE("lima.scale", n("lima.config.scale.description"), "2", String.class, false, false), CURRENCY("lima.config.currency", "", "false", Boolean.class, false, false), diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java index de3d142..94459e6 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java @@ -303,7 +303,6 @@ public class ReportServiceImpl extends AbstractLimaService implements ReportServ List<Account> accounts; //Remove Spaces - // TODO DCossé 12/06/14 selectedAccounts is allways NULL String result = StringUtils.deleteWhitespace(selectedAccounts); //if no filter account if (result == null || result.equals("")) { diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java index a8cccf1..c02a85a 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java @@ -99,7 +99,7 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal documentReport.setFormatter(bigDecimalFormat); Identity identity = identityService.getIdentity(); - documentReport.setCompanyName(StringUtils.isNotBlank(identity.getName()) ? identity.getName() : ""); + documentReport.setCompanyName(identity.getName()); // general info about balance report documentReport.setTitle(TITLE); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java index 0d0cd36..442aaac 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java @@ -4,7 +4,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaTechnicalException; @@ -82,7 +81,7 @@ public class GeneralEntryBookReportServiceImpl extends AbstractLimaService imple if (beginDate != null && endDate != null) { Identity identity = identityService.getIdentity(); - documentReport.setCompanyName(StringUtils.isNotBlank(identity.getName()) ? identity.getName() : ""); + documentReport.setCompanyName(identity.getName()); // general infos about balance report documentReport.setTitle(TITLE); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/LedgerReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/LedgerReportServiceImpl.java index 425bbe9..a7cbe4e 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/LedgerReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/LedgerReportServiceImpl.java @@ -1,17 +1,26 @@ package org.chorem.lima.business.ejb.report; +import com.google.common.base.Preconditions; +import org.apache.commons.lang3.StringUtils; import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.beans.DocumentReport; +import org.chorem.lima.beans.DocumentReportImpl; +import org.chorem.lima.beans.GeneralLedger; +import org.chorem.lima.beans.GeneralLedgerEntry; +import org.chorem.lima.beans.GeneralLedgerEntryImpl; +import org.chorem.lima.beans.GeneralLedgerImpl; import org.chorem.lima.beans.ReportsDatas; +import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.api.IdentityService; import org.chorem.lima.business.api.ReportService; -import org.chorem.lima.business.api.report.GeneralEntryBookReportService; import org.chorem.lima.business.api.report.LedgerReportService; import org.chorem.lima.business.ejb.AbstractLimaService; import org.chorem.lima.business.utils.EntryComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.Identity; import javax.ejb.EJB; import javax.ejb.Remote; @@ -37,108 +46,96 @@ public class LedgerReportServiceImpl extends AbstractLimaService implements Ledg @EJB protected ReportService reportService; + @EJB + protected IdentityService identityService; + + protected static final String TITLE = t("lima-business.document.ledger"); + @Override public DocumentReport getLedgerDocumentReport(Date beginDate, Date endDate, String currency, DecimalFormat decimalFormat) { - return null; -// List<Object> list = new ArrayList<Object>(); -// -// if (beginDate != null && endDate != null) { -// try { -// -// BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, null, true); -// if (balanceTrial.getReportsDatas() != null) { -// for (ReportsDatas reportsDatas : balanceTrial.getReportsDatas()) { -// list.add(reportsDatas); -// List<Entry> entries = reportsDatas.getListEntry(); -// if (entries != null) { -// Collections.sort(entries, new EntryComparator()); -// list.addAll(entries); -// } -// } -// } -// -// //create pages -// int i = 0; -// int n = list.size(); -// -// boolean even = true; -// BigDecimal currentAmountDebit =BigDecimal.ZERO; -// BigDecimal currentAmountCredit =BigDecimal.ZERO; -// -// while (i < n) { -// -// int indexEntry = -1; -// -// for (Object object : list) { -// if (object instanceof ReportsDatas) { -// -//// ReportsDatas reportsDatas = (ReportsDatas) object; -//// -//// String accountS = ""; -//// Account account = reportsDatas.getAccount(); -//// if (account != null) { -//// accountS = account.getAccountNumber() + "\t" + account.getLabel(); -//// } -//// BigDecimal amountCredit = reportsDatas.getAmountCredit(); -//// BigDecimal amountDebit = reportsDatas.getAmountDebit(); -//// -//// String [] columnsTable = {accountS, -//// amountDebit.toString(), amountCredit.toString(), -//// amountDebit.subtract(amountCredit).toString()}; -// -// } else { -// indexEntry++; -// Entry entry = (Entry) object; -// -// String entryBookCode = ""; -// EntryBook entryBook = entry.getFinancialTransaction().getEntryBook(); -// if (entryBook != null) { -// entryBookCode = entryBook.getCode(); -// } -// BigDecimal amountDebit = BigDecimal.ZERO, -// amountCredit = BigDecimal.ZERO; -// if (entry.isDebit()) { -// amountDebit = entry.getAmount(); -// } else { -// amountCredit = entry.getAmount(); -// } -// -// String [] columnsTable = {t("lima-business.document.dateformat",entry.getFinancialTransaction().getTransactionDate()), -// entryBookCode, entry.getVoucher(), entry.getDescription(), -// amountDebit.toString(), amountCredit.toString(), amountDebit.subtract(amountCredit).toString()}; -// ledgerReport += constructTableLine(columnsTable, even); -// even = !even; -// } -// } -// -// // close inner -// ledgerReport += "</tbody></table>" + -// "</td>" + -// "</tr>"; -// -// for (Object objectList : list) { -// if (objectList instanceof Entry) { -// Entry entry = (Entry) objectList; -// if (entry.isDebit()) { -// currentAmountDebit = currentAmountDebit.add(entry.getAmount()); -// } else { -// currentAmountCredit = currentAmountCredit.add(entry.getAmount()); -// } -// } -// } -// -// i = i + n; -// } -// //final amounts -// String [] columnsTable = { boldBegin + t("lima-business.document.amounts") + boldEnd, -// boldBegin + currentAmountDebit.toString() + boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, -// boldBegin + currentAmountDebit.subtract(currentAmountCredit).toString() + boldEnd}; -// ledgerReport += constructTableLine(columnsTable, even); -// -// -// } catch (Exception ex) { -// throw new LimaTechnicalException("Can't create document", ex); -// } -// } + String generalLedgerReportModelPath = LimaServiceConfig.getInstance().getGeneralLedgerModelPath(); + String generalLedgerEntryModelPath = LimaServiceConfig.getInstance().getGeneralLedgerEntryModelPath(); + + Preconditions.checkArgument(StringUtils.isNoneBlank(generalLedgerReportModelPath)); + Preconditions.checkArgument(StringUtils.isNoneBlank(generalLedgerEntryModelPath)); + + DocumentReport result = new DocumentReportImpl(); + result.setFormatter(decimalFormat); + result.setCurrency(currency); + //result.setFromAccount(); + //result.setToAccount(); + result.setFromDate(beginDate); + result.setToDate(endDate); + result.setSubReportPath(""); + result.setTitle(TITLE); + + Identity identity = identityService.getIdentity(); + result.setCompanyName(identity.getName()); + result.setSubReportPath(generalLedgerReportModelPath); + + + if (beginDate != null && endDate != null) { + try { + + BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, null, true); + if (balanceTrial.getReportsDatas() != null) { + for (ReportsDatas reportsDatas : balanceTrial.getReportsDatas()) { + + List<Entry> entries = reportsDatas.getListEntry(); + if (entries != null) { + Account account = reportsDatas.getAccount(); + + if (account != null) { + GeneralLedger generalLedger = new GeneralLedgerImpl(); + generalLedger.setFormatter(decimalFormat); + generalLedger.setAccountNumber(account.getAccountNumber()); + generalLedger.setLabel(account.getLabel()); + BigDecimal amountCredit = reportsDatas.getAmountCredit(); + BigDecimal amountDebit = reportsDatas.getAmountDebit(); + generalLedger.setDebit(amountDebit); + generalLedger.setCredit(amountCredit); + generalLedger.setSolde(amountDebit.subtract(amountCredit)); + generalLedger.setSubReportPath(generalLedgerEntryModelPath); + + result.addGeneralLedgers(generalLedger); + + Collections.sort(entries, new EntryComparator()); + + for (Entry entry : entries) { + String entryBookCode = ""; + EntryBook entryBook = entry.getFinancialTransaction().getEntryBook(); + if (entryBook != null) { + entryBookCode = entryBook.getCode(); + } + BigDecimal entryAmountDebit = BigDecimal.ZERO, entryAmountCredit = BigDecimal.ZERO; + + if (entry.isDebit()) { + entryAmountDebit = entry.getAmount(); + } else { + entryAmountCredit = entry.getAmount(); + } + + GeneralLedgerEntry generalLedgerEntry = new GeneralLedgerEntryImpl(); + generalLedgerEntry.setFormatter(decimalFormat); + generalLedgerEntry.setDate(entry.getFinancialTransaction().getTransactionDate()); + generalLedgerEntry.setEntrybook(entryBookCode); + generalLedgerEntry.setVoucher(entry.getVoucher()); + generalLedgerEntry.setDescription(entry.getDescription()); + generalLedgerEntry.setDebit(entryAmountDebit); + generalLedgerEntry.setCredit(entryAmountCredit); + generalLedgerEntry.setSolde(entryAmountDebit.subtract(entryAmountCredit)); + + generalLedger.addEntries(generalLedgerEntry); + } + } + + } + } + } + } catch (Exception ex) { + throw new LimaTechnicalException("Can't create document", ex); + } + } + return result; } } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java index d21faa1..f96b261 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java @@ -81,7 +81,7 @@ public class ProvisionalEntryBookReportServiceImpl implements ProvisionalEntryBo if (beginDate != null && endDate != null) { Identity identity = identityService.getIdentity(); - documentReport.setCompanyName(StringUtils.isNotBlank(identity.getName()) ? identity.getName() : ""); + documentReport.setCompanyName(identity.getName()); // general infos about balance report documentReport.setTitle(TITLE); diff --git a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties index 8a3a976..2e901ed 100644 --- a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties +++ b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties @@ -139,6 +139,7 @@ lima.config.documentReport.generalEntrybook.generalEntryBookEntryModelPath.descr lima.config.documentReport.generalEntrybook.generalEntryBookModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'GeneralEntryBook' lima.config.documentReport.generalLedger.documentReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'DocumentReport' lima.config.documentReport.generalLedger.generalLedgerModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'generalLedger' +lima.config.documentReport.generalLedger.generalLedgerEntryModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'generalLedgerEntry' lima.config.httpport.description=Port HTTP lima.config.reports.dir.description=Dossier des rapports lima.config.reportvatpdfurl.description=Chemin du raport diff --git a/lima-callao/src/main/xmi/accounting-model.zargo b/lima-callao/src/main/xmi/accounting-model.zargo index ca852d6..3e18915 100644 Binary files a/lima-callao/src/main/xmi/accounting-model.zargo and b/lima-callao/src/main/xmi/accounting-model.zargo differ diff --git a/lima-web/src/main/assembly/bin.xml b/lima-web/src/main/assembly/bin.xml index 90d5813..936c074 100644 --- a/lima-web/src/main/assembly/bin.xml +++ b/lima-web/src/main/assembly/bin.xml @@ -63,5 +63,40 @@ <include>*.pdf</include> </includes> </fileSet> + <fileSet> + <directory>src/main/jasperreports/accounts</directory> + <outputDirectory>jasperreports</outputDirectory> + <includes> + <include>*.jrxml</include> + </includes> + </fileSet> + <fileSet> + <directory>src/main/jasperreports/balance</directory> + <outputDirectory>jasperreports</outputDirectory> + <includes> + <include>*.jrxml</include> + </includes> + </fileSet> </fileSets> + <fileSet> + <directory>src/main/jasperreports/entryBook</directory> + <outputDirectory>jasperreports</outputDirectory> + <includes> + <include>*.jrxml</include> + </includes> + </fileSet> + <fileSet> + <directory>src/main/jasperreports/generalEntryBook</directory> + <outputDirectory>jasperreports</outputDirectory> + <includes> + <include>*.jrxml</include> + </includes> + </fileSet> + <fileSet> + <directory>src/main/jasperreports/ledger</directory> + <outputDirectory>jasperreports</outputDirectory> + <includes> + <include>*.jrxml</include> + </includes> + </fileSet> </assembly> diff --git a/lima-web/src/main/java/org/chorem/lima/web/action/DocumentService.java b/lima-web/src/main/java/org/chorem/lima/web/action/DocumentService.java index dfcefdd..4db1fe4 100644 --- a/lima-web/src/main/java/org/chorem/lima/web/action/DocumentService.java +++ b/lima-web/src/main/java/org/chorem/lima/web/action/DocumentService.java @@ -261,143 +261,6 @@ public class DocumentService { return financialReport; } - //############## Ledger ############## - public String createLedgerDocuments(Date beginDate, - Date endDate) { - - List<Object> list = new ArrayList<Object>(); - String ledgerReport = constructHtmlHeader(t("lima-business.document.ledger")); - - if (beginDate != null && endDate != null) { - try { - String boldBegin = "<b>"; - String boldEnd = "</b>"; - - BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, null, true); - if (balanceTrial.getReportsDatas() != null) { - for (ReportsDatas reportsDatas : balanceTrial.getReportsDatas()) { - list.add(reportsDatas); - List<Entry> entries = reportsDatas.getListEntry(); - if (entries != null) { - Collections.sort(entries, new EntryComparator()); - list.addAll(entries); - } - } - } - - //create pages - int i = 0; - int n = list.size(); - - boolean even = true; - BigDecimal currentAmountDebit =BigDecimal.ZERO; - BigDecimal currentAmountCredit =BigDecimal.ZERO; - - while (i < n) { - - ledgerReport += constructHeaderTitle(t("lima-business.document.ledger"), beginDate, endDate); - - ledgerReport += "<table align=\"left\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-size:13px;\" >\n"; - - String [] columnsNames = {t("lima-business.document.account"), t("lima-business.document.debit"), - t("lima-business.document.credit"), t("lima-business.document.solde")}; - ledgerReport += constructTableHeader(columnsNames); - ledgerReport += "<tbody>\n"; - - int indexEntry = -1; - - for (Object object : list) { - if (object instanceof ReportsDatas) { - if (indexEntry != -1) { - indexEntry = -1; - ledgerReport += "</tbody></table>" + - "</td>" + - "</tr>"; - } - ReportsDatas reportsDatas = (ReportsDatas) object; - - String accountS = ""; - Account account = reportsDatas.getAccount(); - if (account != null) { - accountS = account.getAccountNumber() + "\t" + account.getLabel(); - } - BigDecimal amountCredit = reportsDatas.getAmountCredit(); - BigDecimal amountDebit = reportsDatas.getAmountDebit(); - - String [] columnsTable = {accountS, - amountDebit.toString(), amountCredit.toString(), - amountDebit.subtract(amountCredit).toString()}; - ledgerReport += constructTableHeader(columnsTable); - - } else { - indexEntry++; - Entry entry = (Entry) object; - - String entryBookCode = ""; - EntryBook entryBook = entry.getFinancialTransaction().getEntryBook(); - if (entryBook != null) { - entryBookCode = entryBook.getCode(); - } - BigDecimal amountDebit = BigDecimal.ZERO, - amountCredit = BigDecimal.ZERO; - if (entry.isDebit()) { - amountDebit = entry.getAmount(); - } else { - amountCredit = entry.getAmount(); - } - - ledgerReport +="<tr>"; - if (indexEntry == 0) { - ledgerReport += "<td><table align=\"right\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-size:13px;\" >\n"; - String [] columnsEntry = {t("lima-business.document.date"), - t("lima-business.document.entrybook"), t("lima-business.document.voucher"), - t("lima-business.document.description"), t("lima-business.document.debit"), - t("lima-business.document.credit"), t("lima-business.document.solde")}; - ledgerReport += constructTableHeader(columnsEntry); - ledgerReport += "<tbody>"; - } - - String [] columnsTable = {t("lima-business.document.dateformat",entry.getFinancialTransaction().getTransactionDate()), - entryBookCode, entry.getVoucher(), entry.getDescription(), - amountDebit.toString(), amountCredit.toString(), amountDebit.subtract(amountCredit).toString()}; - ledgerReport += constructTableLine(columnsTable, even); - even = !even; - } - } - - // close inner - ledgerReport += "</tbody></table>" + - "</td>" + - "</tr>"; - - for (Object objectList : list) { - if (objectList instanceof Entry) { - Entry entry = (Entry) objectList; - if (entry.isDebit()) { - currentAmountDebit = currentAmountDebit.add(entry.getAmount()); - } else { - currentAmountCredit = currentAmountCredit.add(entry.getAmount()); - } - } - } - - i = i + n; - } - //final amounts - String [] columnsTable = { boldBegin + t("lima-business.document.amounts") + boldEnd, - boldBegin + currentAmountDebit.toString() + boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, - boldBegin + currentAmountDebit.subtract(currentAmountCredit).toString() + boldEnd}; - ledgerReport += constructTableLine(columnsTable, even); - - - ledgerReport += "</tbody></table></body>\n</html>"; - } catch (Exception ex) { - throw new LimaTechnicalException("Can't create document", ex); - } - } - return ledgerReport; - } - //############## VAT ############## // public void createVatDocuments(Date beginDate, // Date endDate, diff --git a/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java b/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java index 451b0ed..fd97351 100644 --- a/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java +++ b/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java @@ -192,8 +192,7 @@ public class HttpServerService { beginDateFormat, endDateFormat); break; case LEDGER: - ledgerReport = documentService.createLedgerDocuments( - beginDateFormat, endDateFormat); + documentService.createLedgerDocuments(beginDateFormat, endDateFormat, "€"); break; case VAT: if (log.isDebugEnabled()) { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.