branch feature/newReportBuilder updated (c98fe93 -> 862b042)
This is an automated email from the git hooks/post-receive script. New change to branch feature/newReportBuilder in repository lima. See http://git.chorem.org/lima.git from c98fe93 refs #769 ajout d'un fichier new 862b042 refs #769 génération des rapports pour journaux The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 862b042b1f5913ab2a29cf73a4dd906a916e25b0 Author: dcosse <japbiw74> Date: Wed Nov 19 18:49:17 2014 +0100 refs #769 génération des rapports pour journaux Summary of changes: .../api/ClosedPeriodicEntryBookService.java | 2 + .../chorem/lima/business/api/EntryBookService.java | 7 + .../org/chorem/lima/business/api/EntryService.java | 15 ++ .../report/ProvisionalEntryBookReportService.java | 22 ++ .../ejb/ClosedPeriodicEntryBookServiceImpl.java | 7 + .../lima/business/ejb/EntryBookServiceImpl.java | 16 ++ .../chorem/lima/business/ejb/EntryServiceImpl.java | 11 +- .../report/GeneralEntryBookReportServiceImpl.java | 2 +- .../ProvisionalEntryBookReportServiceImpl.java | 171 +++++++++++++ .../java/org/chorem/lima/entity/EntryTopiaDao.java | 11 + lima-callao/src/main/xmi/accounting-model.zargo | Bin 51731 -> 51710 bytes .../generalEntryBook/EntryBookPeriodReport.jrxml | 6 +- .../provisionalEntryBook/EntryBookMainReport.jrxml | 267 +++++++++++++++++++++ .../provisionalEntryBook/EntryBookReport.jrxml | 150 ++++++++++++ .../FinancialPeriodReport.jrxml | 140 +++++++++++ .../provisionalEntryBook/Transaction.jrxml | 122 ++++++++++ .../chorem/lima/web/action/DocumentService.java | 103 +------- .../lima/web/action/balance/ReportBuilder.java | 3 + .../chorem/lima/web/service/HttpServerService.java | 8 +- 19 files changed, 960 insertions(+), 103 deletions(-) create mode 100644 lima-business-api/src/main/java/org/chorem/lima/business/api/report/ProvisionalEntryBookReportService.java create mode 100644 lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java create mode 100644 lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookMainReport.jrxml create mode 100644 lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookReport.jrxml create mode 100644 lima-web/src/main/jasperreports/provisionalEntryBook/FinancialPeriodReport.jrxml create mode 100644 lima-web/src/main/jasperreports/provisionalEntryBook/Transaction.jrxml -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 862b042b1f5913ab2a29cf73a4dd906a916e25b0 Author: dcosse <japbiw74> Date: Wed Nov 19 18:49:17 2014 +0100 refs #769 génération des rapports pour journaux --- .../api/ClosedPeriodicEntryBookService.java | 2 + .../chorem/lima/business/api/EntryBookService.java | 7 + .../org/chorem/lima/business/api/EntryService.java | 15 ++ .../report/ProvisionalEntryBookReportService.java | 22 ++ .../ejb/ClosedPeriodicEntryBookServiceImpl.java | 7 + .../lima/business/ejb/EntryBookServiceImpl.java | 16 ++ .../chorem/lima/business/ejb/EntryServiceImpl.java | 11 +- .../report/GeneralEntryBookReportServiceImpl.java | 2 +- .../ProvisionalEntryBookReportServiceImpl.java | 171 +++++++++++++ .../java/org/chorem/lima/entity/EntryTopiaDao.java | 11 + lima-callao/src/main/xmi/accounting-model.zargo | Bin 51731 -> 51710 bytes .../generalEntryBook/EntryBookPeriodReport.jrxml | 6 +- .../provisionalEntryBook/EntryBookMainReport.jrxml | 267 +++++++++++++++++++++ .../provisionalEntryBook/EntryBookReport.jrxml | 150 ++++++++++++ .../FinancialPeriodReport.jrxml | 140 +++++++++++ .../provisionalEntryBook/Transaction.jrxml | 122 ++++++++++ .../chorem/lima/web/action/DocumentService.java | 103 +------- .../lima/web/action/balance/ReportBuilder.java | 3 + .../chorem/lima/web/service/HttpServerService.java | 8 +- 19 files changed, 960 insertions(+), 103 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java index 64bbed9..5a06347 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java @@ -37,4 +37,6 @@ public interface ClosedPeriodicEntryBookService { ClosedPeriodicEntryBook getByEntryBookAndFinancialPeriod(EntryBook entryBook, FinancialPeriod financialPeriod); List<ClosedPeriodicEntryBook> getAllByDates(Date beginDate, Date endDate); + + List<ClosedPeriodicEntryBook> getAllByEntryBookAndDates(EntryBook entryBook, Date beginDate, Date endDate); } diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java index e663eab..4552ade 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java @@ -96,4 +96,11 @@ public interface EntryBookService { * @throws org.chorem.lima.business.exceptions.UsedEntryBookException */ void removeEntryBook(EntryBook entryBook) throws UsedEntryBookException; + + /** + * Find all Entry book with code the collection of codes given in parameter + * @param entryBookCodes collection of entry book codes + * @return All looked for entry books + */ + List<EntryBook> findAllEntryBookByEntryBookCodes(List<String> entryBookCodes); } diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java index 1925c8b..a13442e 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java @@ -24,7 +24,9 @@ package org.chorem.lima.business.api; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; +import java.util.Date; import java.util.List; /** @@ -34,7 +36,20 @@ public interface EntryService { Entry createEntry(Entry entry); + /** + * Return Entry of financial transaction related to the given ClosedPeriodicEntryBook + * @param closedPeriodicEntryBook The ClosedPeriodicEntryBook + * @return All Entry related to the ClosedPeriodicEntryBook + */ List<Entry> findAllEntryByDateForEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook); + /** + * Return values of financial transaction related to the given ClosedPeriodicEntryBook + * @param closedPeriodicEntryBook The ClosedPeriodicEntryBook from where financial transaction are returned + * @return list of tables of 0: boolean (true:credit), 1: amount + */ List<Object[]> findDebitCreditOfTransaction(ClosedPeriodicEntryBook closedPeriodicEntryBook); + + + List<Entry> findAllEntriesByDatesForEntryBook(EntryBook entryBook, Date beginDate, Date endDate); } diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/report/ProvisionalEntryBookReportService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/report/ProvisionalEntryBookReportService.java new file mode 100644 index 0000000..58049bd --- /dev/null +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/report/ProvisionalEntryBookReportService.java @@ -0,0 +1,22 @@ +package org.chorem.lima.business.api.report; + +import org.chorem.lima.beans.DocumentReport; + +import java.util.Date; +import java.util.List; + +/** + * Created by davidcosse on 19/11/14. + */ +public interface ProvisionalEntryBookReportService { + + /** + * + * @param beginDate period from + * @param endDate period to + * @param entryBookCodes selected entry books if null all are selected + * @param currency current currency + * @return + */ + DocumentReport getProvisionalEntryBookDocumentReport(Date beginDate, Date endDate, List<String> entryBookCodes, String currency); +} diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java index 30a7cb6..19230bf 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java @@ -59,4 +59,11 @@ public class ClosedPeriodicEntryBookServiceImpl extends AbstractLimaService impl return result; } + @Override + public List<ClosedPeriodicEntryBook> getAllByEntryBookAndDates(EntryBook entryBook, Date beginDate, Date endDate) { + ClosedPeriodicEntryBookTopiaDao closedPeriodicEntryBookTopiaDao = getDaoHelper().getClosedPeriodicEntryBookDao(); + List<ClosedPeriodicEntryBook> result = + closedPeriodicEntryBookTopiaDao.findAllByEntryBookAndDates(entryBook, beginDate, endDate); + return result; + } } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java index 9d929e3..3425ccc 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java @@ -22,6 +22,8 @@ package org.chorem.lima.business.ejb; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; import org.chorem.lima.business.AccountingRules; import org.chorem.lima.business.LimaServiceConfig; import org.chorem.lima.business.api.EntryBookService; @@ -32,6 +34,7 @@ import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookTopiaDao; +import org.chorem.lima.entity.EntryTopiaDao; import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialPeriodTopiaDao; import org.nuiton.util.beans.Binder; @@ -187,4 +190,17 @@ public class EntryBookServiceImpl extends AbstractLimaService implements EntryBo return entryBook; } + + @Override + public List<EntryBook> findAllEntryBookByEntryBookCodes(List<String> entryBookCodes) { + List<EntryBook> result; + //if no filter account + if (entryBookCodes != null) { + EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao(); + result = entryBookTopiaDao.forCodeIn(entryBookCodes).findAll(); + } else { + result = Lists.newArrayListWithExpectedSize(0); + } + return result; + } } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java index aac45fb..742b4b0 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java @@ -25,11 +25,13 @@ package org.chorem.lima.business.ejb; import org.chorem.lima.business.api.EntryService; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryTopiaDao; import javax.ejb.Remote; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; +import java.util.Date; import java.util.List; /** @@ -67,6 +69,13 @@ public class EntryServiceImpl extends AbstractLimaService implements EntryServic return result; } - + @Override + public List<Entry> findAllEntriesByDatesForEntryBook(EntryBook entryBook, Date beginDate, Date endDate) { + EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); + List<Entry> result = entryTopiaDao.getAllEntriesByDatesForEntryBook(entryBook, + beginDate, + endDate); + return result; + } } 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 f70f5c7..40c8ea3 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 @@ -158,7 +158,7 @@ public class GeneralEntryBookReportServiceImpl extends AbstractLimaService imple if (subAmountCredit.compareTo(BigDecimal.ZERO) != 0 && subAmountDebit.compareTo(BigDecimal.ZERO) != 0) { EntryBookPeriodReport entryBookPeriodReport = new EntryBookPeriodReportImpl(); - entryBookPeriodReport.setPeriode(financialPeriod.getBeginDate()); + entryBookPeriodReport.setPeriod(financialPeriod.getBeginDate()); entryBookPeriodReport.setSubReportPath(GENERAL_ENTRY_BOOK_ENTRY_REPORT_PATH); entryBookPeriodReport.setSoldeDebit(subAmountDebit.compareTo(BigDecimal.ZERO) == 0 ? "" : subAmountDebit.toPlainString()); entryBookPeriodReport.setSoldeCredit(subAmountCredit.compareTo(BigDecimal.ZERO) == 0 ? "" : subAmountCredit.toPlainString()); 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 new file mode 100644 index 0000000..c389969 --- /dev/null +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java @@ -0,0 +1,171 @@ +package org.chorem.lima.business.ejb.report; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaTechnicalException; +import org.chorem.lima.beans.DocumentReport; +import org.chorem.lima.beans.DocumentReportImpl; +import org.chorem.lima.beans.EntryBookReport; +import org.chorem.lima.beans.EntryBookReportImpl; +import org.chorem.lima.beans.FinancialPeriodReport; +import org.chorem.lima.beans.FinancialPeriodReportImpl; +import org.chorem.lima.beans.Transaction; +import org.chorem.lima.beans.TransactionImpl; +import org.chorem.lima.business.api.ClosedPeriodicEntryBookService; +import org.chorem.lima.business.api.EntryBookService; +import org.chorem.lima.business.api.EntryService; +import org.chorem.lima.business.api.FinancialPeriodService; +import org.chorem.lima.business.api.FinancialTransactionService; +import org.chorem.lima.business.api.IdentityService; +import org.chorem.lima.business.api.report.ProvisionalEntryBookReportService; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FinancialPeriod; +import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.entity.Identity; + +import javax.ejb.EJB; +import javax.ejb.Remote; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import java.io.File; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * Created by davidcosse on 19/11/14. + */ +@Stateless +@Remote(ProvisionalEntryBookReportService.class) +@TransactionAttribute +public class ProvisionalEntryBookReportServiceImpl implements ProvisionalEntryBookReportService { + protected static final Log log = LogFactory.getLog(GeneralEntryBookReportServiceImpl.class); + + @EJB + protected FinancialPeriodService financialPeriodService; + + @EJB + protected ClosedPeriodicEntryBookService closedPeriodicEntryBookService; + + @EJB + protected EntryService entryService; + + @EJB + protected EntryBookService entryBookService; + + @EJB + protected IdentityService identityService; + + @EJB + protected FinancialTransactionService financialTransactionService; + + protected static String ROOT_PATH = new File("").getAbsolutePath(); + protected static String ENTRY_BOOK_REPORT_PATH = ROOT_PATH + "/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookReport.jrxml"; + protected static String FINANCIAL_PERIOD_REPORT_PATH = ROOT_PATH + "/lima-web/src/main/jasperreports/provisionalEntryBook/FinancialPeriodReport.jrxml"; + protected static String TRANSACTION_REPORT_PATH = ROOT_PATH + "/lima-web/src/main/jasperreports/provisionalEntryBook/Transaction.jrxml"; + protected static final String TITLE = "Récapitulatif par compte"; + + @Override + public DocumentReport getProvisionalEntryBookDocumentReport(Date beginDate, Date endDate, List<String> entryBookCodes, String currency) { + DocumentReport documentReport = new DocumentReportImpl(); + try { + + if (beginDate != null && endDate != null) { + Identity identity = identityService.getIdentity(); + documentReport.setCompanyName(StringUtils.isNotBlank(identity.getName()) ? identity.getName() : ""); + + // general infos about balance report + documentReport.setTitle(TITLE); + documentReport.setCurrency(currency); + documentReport.setFromDate(beginDate); + documentReport.setToDate(endDate); + documentReport.setSubReportPath(ENTRY_BOOK_REPORT_PATH); + + List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriods(beginDate, endDate); + + List<EntryBook> entryBooks; + + // if not any entry book has been selected then default is all. + if (entryBookCodes != null) { + entryBooks = entryBookService.findAllEntryBookByEntryBookCodes(entryBookCodes); + } else { + entryBooks = entryBookService.getAllEntryBooks(); + } + + for(EntryBook entryBook:entryBooks) { + + + EntryBookReport entryBookReport = new EntryBookReportImpl(); + entryBookReport.setLibelle(entryBook.getLabel()); + entryBookReport.setCode(entryBook.getCode()); + entryBookReport.setSubReportPath(FINANCIAL_PERIOD_REPORT_PATH); + + BigDecimal entryBookSoldeDebit = BigDecimal.ZERO; + BigDecimal entryBookSoldeCredit = BigDecimal.ZERO; + + // for each FinancialPeriod an EntryBookPeriodReport is created + for (FinancialPeriod financialPeriod : financialPeriods) { + + FinancialPeriodReport financialPeriodReport = new FinancialPeriodReportImpl(); + financialPeriodReport.setSubReportPath(TRANSACTION_REPORT_PATH); + financialPeriodReport.setPeriod(financialPeriod.getBeginDate()); + + BigDecimal financialPeriodDebit = BigDecimal.ZERO; + BigDecimal financialPeriodCredit = BigDecimal.ZERO; + + BigDecimal debit; + BigDecimal credit; + List<Entry> entries = entryService.findAllEntriesByDatesForEntryBook(entryBook, financialPeriod.getBeginDate(), financialPeriod.getEndDate()); + for (Entry entry : entries) { + if (entry.isDebit()) { + debit = entry.getAmount(); + credit = BigDecimal.ZERO; + } else { + debit = BigDecimal.ZERO; + credit = entry.getAmount(); + } + if (debit.compareTo(BigDecimal.ZERO) != 0 || credit.compareTo(BigDecimal.ZERO) != 0) { + Transaction transaction = new TransactionImpl(); + transaction.setTransactionDate(entry.getFinancialTransaction().getTransactionDate()); + transaction.setAccount(entry.getAccount().getAccountNumber() + " - " + entry.getAccount().getLabel()); + transaction.setLibelle(entry.getDescription()); + transaction.setVoucher(entry.getVoucher()); + transaction.setDebit(debit.compareTo(BigDecimal.ZERO) == 0 ? "" : debit.toPlainString()); + transaction.setCredit(credit.compareTo(BigDecimal.ZERO) == 0 ? "" : credit.toPlainString()); + + financialPeriodDebit = financialPeriodDebit.add(debit); + financialPeriodCredit = financialPeriodCredit.add(credit); + + financialPeriodReport.addTransaction(transaction); + } + } + + + if (financialPeriodDebit.compareTo(BigDecimal.ZERO) != 0 || financialPeriodCredit.compareTo(BigDecimal.ZERO) != 0) { + financialPeriodReport.setSoldeDebit(financialPeriodDebit.compareTo(BigDecimal.ZERO) == 0 ? "" : financialPeriodDebit.toPlainString()); + financialPeriodReport.setSoldeCredit(financialPeriodCredit.compareTo(BigDecimal.ZERO) == 0 ? "" : financialPeriodCredit.toPlainString()); + entryBookReport.addFinancialPeriodReport(financialPeriodReport); + entryBookSoldeDebit = entryBookSoldeDebit.add(financialPeriodDebit); + entryBookSoldeCredit = entryBookSoldeCredit.add(financialPeriodCredit); + } + } + + if (entryBookSoldeDebit.compareTo(BigDecimal.ZERO) != 0 || entryBookSoldeCredit.compareTo(BigDecimal.ZERO) != 0) { + entryBookReport.setSoldeDebit(entryBookSoldeDebit.compareTo(BigDecimal.ZERO) == 0 ? "" : entryBookSoldeDebit.toPlainString()); + entryBookReport.setSoldeCredit(entryBookSoldeCredit.compareTo(BigDecimal.ZERO) == 0 ? "" : entryBookSoldeCredit.toPlainString()); + documentReport.addEntryBookReport(entryBookReport); + } + } + + + } + } catch (Exception ex) { + log.error("Can't create document", ex); + throw new LimaTechnicalException("Can't create document", ex); + } + return documentReport; + } +} diff --git a/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java b/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java index 68f3eb6..d5c7bdc 100644 --- a/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java +++ b/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java @@ -255,6 +255,17 @@ public class EntryTopiaDao extends AbstractEntryTopiaDao<Entry> { return result; } + public List<Entry> getAllEntriesByDatesForEntryBook(EntryBook entryBook, Date beginDate, Date endDate) { + + HqlAndParametersBuilder<Entry> builder = newHqlAndParametersBuilder(); + builder.addGreaterOrEquals(PROPERTY_TRANSACTION_DATE, beginDate); + builder.addLowerOrEquals(PROPERTY_TRANSACTION_DATE, endDate); + builder.addEquals(PROPERTY_ENTRY_BOOK, entryBook); + + List<Entry> result = findAll(builder.getHql(), builder.getHqlParameters()); + return result; + } + /** * get all entries where some field are not filled in. * diff --git a/lima-callao/src/main/xmi/accounting-model.zargo b/lima-callao/src/main/xmi/accounting-model.zargo index b019fe8..e910080 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/jasperreports/generalEntryBook/EntryBookPeriodReport.jrxml b/lima-web/src/main/jasperreports/generalEntryBook/EntryBookPeriodReport.jrxml index 87a3984..fb262e5 100644 --- a/lima-web/src/main/jasperreports/generalEntryBook/EntryBookPeriodReport.jrxml +++ b/lima-web/src/main/jasperreports/generalEntryBook/EntryBookPeriodReport.jrxml @@ -14,7 +14,7 @@ <field name="soldeCredit" class="java.lang.String"/> <field name="generalEntryBookEntry" class="java.util.List"/> <field name="subReportPath" class="java.lang.String"/> - <field name="periode" class="java.util.Date"/> + <field name="period" class="java.util.Date"/> <variable name="generalEntryBookEntry" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"> <variableExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource((java.util.List)$F{generalEntryBookEntry})]]></variableExpression> </variable> @@ -51,7 +51,7 @@ <font size="8" isBold="true" isItalic="true"/> <paragraph lineSpacingSize="0.0" leftIndent="40"/> </textElement> - <textFieldExpression><![CDATA["Mois de " + new SimpleDateFormat("MMMM yyyy").format($F{periode})]]></textFieldExpression> + <textFieldExpression><![CDATA["Mois de " + new SimpleDateFormat("MMMM yyyy").format($F{period})]]></textFieldExpression> </textField> </frame> </band> @@ -94,7 +94,7 @@ <font size="8" isBold="true" isItalic="true"/> <paragraph lineSpacingSize="0.0" leftIndent="40"/> </textElement> - <textFieldExpression><![CDATA["Sous-total " + new SimpleDateFormat("MMMM yyyy").format($F{periode})]]></textFieldExpression> + <textFieldExpression><![CDATA["Sous-total " + new SimpleDateFormat("MMMM yyyy").format($F{period})]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement style="Default" x="434" y="0" width="72" height="10" forecolor="#736343" uuid="53ba669a-6626-4e70-bbf0-fb243908a20e"/> diff --git a/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookMainReport.jrxml b/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookMainReport.jrxml new file mode 100644 index 0000000..34a0763 --- /dev/null +++ b/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookMainReport.jrxml @@ -0,0 +1,267 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 --> +<!-- 2014-11-19T16:08:09 --> +<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="BalanceReport" pageWidth="595" pageHeight="842" whenNoDataType="BlankPage" columnWidth="575" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" isSummaryNewPage="true" isSummaryWithPageHeaderAndFooter="true" isFloa [...] + <property name="com.jaspersoft.studio.unit." value="pixel"/> + <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> + <style name="Default" isDefault="true" fontName="Arial" fontSize="8"/> + <style name="Bold" fontName="Arial" fontSize="8"/> + <style name="Oblique" fontName="Monospaced" fontSize="8"/> + <style name="Column header" forecolor="#D0B48E" backcolor="#F2EBDF" fontName="Arial" fontSize="12" isBold="true"/> + <queryString> + <![CDATA[]]> + </queryString> + <field name="fromDate" class="java.util.Date"/> + <field name="toDate" class="java.util.Date"/> + <field name="currency" class="java.lang.String"/> + <field name="entryBookReport" class="java.util.List"/> + <field name="subReportPath" class="java.lang.String"/> + <field name="companyName" class="java.lang.String"/> + <field name="title" class="java.lang.String"/> + <field name="soldeDebit" class="java.lang.String"/> + <field name="soldeCredit" class="java.lang.String"/> + <variable name="entryBookPeriodReport" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"> + <variableExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource((java.util.List)$F{entryBookReport})]]></variableExpression> + </variable> + <group name="entryBookPeriodReport"/> + <background> + <band splitType="Stretch"/> + </background> + <title> + <band height="41" splitType="Stretch"> + <frame> + <reportElement style="Default" mode="Opaque" x="0" y="1" width="578" height="40" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="1aba49d4-0acc-4925-8731-13c1cc1a90f4"/> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + </box> + <textField isBlankWhenNull="true"> + <reportElement style="Default" x="0" y="0" width="578" height="20" forecolor="#736343" uuid="9ee9d5f1-6e74-4526-83a4-3b386f2733a8"/> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="14" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$F{title}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="true"> + <reportElement style="Default" x="444" y="0" width="134" height="20" forecolor="#736343" uuid="a60d5d40-69ac-4c50-a33a-67c26cce05f3"/> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font size="8" isBold="false"/> + <paragraph rightIndent="5"/> + </textElement> + <textFieldExpression><![CDATA["Edition du: " + new SimpleDateFormat("dd/MM/yyyy à HH:mm").format(new java.util.Date())]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="true"> + <reportElement style="Default" x="210" y="20" width="80" height="20" forecolor="#736343" uuid="37d0a47c-0197-4f09-8358-823b39a2a42a"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA["Du " + new SimpleDateFormat("dd/MM/yyyy").format($F{fromDate})]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="true"> + <reportElement style="Default" x="290" y="20" width="80" height="20" forecolor="#736343" uuid="5fc4df4a-5930-4ccd-b450-cf7aac6be57b"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <textElement verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[" au " + new SimpleDateFormat("dd/MM/yyyy").format($F{toDate})]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="Default" x="0" y="0" width="190" height="20" forecolor="#736343" uuid="5aa3ceb9-e407-42da-bdc3-097875bdd5f5"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <textElement verticalAlignment="Middle" rotation="None"> + <font size="10" isBold="true"/> + <paragraph leftIndent="5"/> + </textElement> + <textFieldExpression><![CDATA[$F{companyName}]]></textFieldExpression> + </textField> + </frame> + </band> + </title> + <pageHeader> + <band height="25" splitType="Stretch"> + <textField isBlankWhenNull="true"> + <reportElement style="Oblique" x="444" y="9" width="134" height="16" forecolor="#000000" uuid="abcb18cb-7d0e-4eb8-a9f5-aca4baffa9ae"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font size="8"/> + </textElement> + <textFieldExpression><![CDATA["Devise: " + $F{currency}]]></textFieldExpression> + </textField> + </band> + </pageHeader> + <columnHeader> + <band height="20"> + <frame> + <reportElement style="Column header" mode="Opaque" x="0" y="0" width="578" height="20" backcolor="#FDCA97" uuid="6c2c2b44-eebf-41d3-8b56-47d4a20a4b24"> + <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> + </reportElement> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <staticText> + <reportElement x="0" y="0" width="80" height="20" forecolor="#804000" uuid="63da28a1-a793-4bf5-81d4-6a4d6fc1e4df"> + <property name="local_mesure_unitwidth" value="pixel"/> + </reportElement> + <box> + <rightPen lineWidth="0.6"/> + </box> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="8" isBold="true"/> + </textElement> + <text><![CDATA[Date]]></text> + </staticText> + <staticText> + <reportElement x="80" y="0" width="80" height="20" forecolor="#804000" uuid="da44668c-4f62-4f75-abaf-cb941b73bfcb"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6"/> + <leftPen lineWidth="0.6"/> + <bottomPen lineWidth="0.6"/> + <rightPen lineWidth="0.6"/> + </box> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="8" isBold="true"/> + </textElement> + <text><![CDATA[N° Compte]]></text> + </staticText> + <staticText> + <reportElement x="160" y="0" width="40" height="20" forecolor="#804000" uuid="da44668c-4f62-4f75-abaf-cb941b73bfcb"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6"/> + <leftPen lineWidth="0.6"/> + <bottomPen lineWidth="0.6"/> + <rightPen lineWidth="0.6"/> + </box> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="8" isBold="true"/> + </textElement> + <text><![CDATA[Pièce]]></text> + </staticText> + <staticText> + <reportElement x="200" y="0" width="234" height="20" forecolor="#804000" uuid="da44668c-4f62-4f75-abaf-cb941b73bfcb"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6"/> + <leftPen lineWidth="0.6"/> + <bottomPen lineWidth="0.6"/> + <rightPen lineWidth="0.6"/> + </box> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="8" isBold="true"/> + </textElement> + <text><![CDATA[Intitulé]]></text> + </staticText> + <staticText> + <reportElement x="434" y="0" width="144" height="10" forecolor="#804000" uuid="1bc6ab8b-d490-46a2-9a10-8f4c4f219889"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="8" isBold="true"/> + </textElement> + <text><![CDATA[Total Période]]></text> + </staticText> + <staticText> + <reportElement x="434" y="10" width="72" height="10" forecolor="#804000" uuid="b6ea8597-d637-47d1-9a39-7c99101594e9"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6" lineColor="#804000"/> + <leftPen lineWidth="0.6" lineColor="#804000"/> + <bottomPen lineWidth="0.6" lineColor="#804000"/> + <rightPen lineWidth="0.6" lineColor="#804000"/> + </box> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="8" isBold="true"/> + </textElement> + <text><![CDATA[Débit]]></text> + </staticText> + <staticText> + <reportElement x="506" y="10" width="72" height="10" forecolor="#804000" uuid="c4f9f592-7052-4b66-abc2-f04cc5f3972c"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <box> + <topPen lineColor="#804000"/> + <leftPen lineColor="#804000"/> + <bottomPen lineColor="#804000"/> + <rightPen lineWidth="0.6" lineColor="#804000"/> + </box> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="8" isBold="true"/> + </textElement> + <text><![CDATA[Crédit]]></text> + </staticText> + </frame> + </band> + </columnHeader> + <detail> + <band height="20" splitType="Stretch"> + <subreport isUsingCache="false" runToBottom="false"> + <reportElement key="subreport-5" positionType="Float" mode="Transparent" x="0" y="0" width="578" height="20" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF" uuid="d7fbefd9-03b1-4eaf-b7c6-fb46c737190a"/> + <dataSourceExpression><![CDATA[$V{entryBookPeriodReport}]]></dataSourceExpression> + <subreportExpression><![CDATA[JasperCompileManager.compileReport($F{subReportPath})]]></subreportExpression> + </subreport> + </band> + </detail> + <pageFooter> + <band height="10" splitType="Stretch"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> + <textField isBlankWhenNull="false"> + <reportElement x="0" y="0" width="288" height="10" uuid="7efdc24b-643b-4927-89e5-30edca53124f"/> + <textElement textAlignment="Right"> + <paragraph lineSpacingSize="0.0"/> + </textElement> + <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + <textField evaluationTime="Report"> + <reportElement x="288" y="0" width="287" height="10" uuid="78cfa3db-28e7-420e-b2e4-441f37387159"/> + <textElement textAlignment="Left"> + <paragraph lineSpacingSize="0.0"/> + </textElement> + <textFieldExpression><![CDATA[" / " + $V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + </band> + </pageFooter> +</jasperReport> diff --git a/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookReport.jrxml b/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookReport.jrxml new file mode 100644 index 0000000..a6bfcc2 --- /dev/null +++ b/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookReport.jrxml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 --> +<!-- 2014-11-19T18:12:39 --> +<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="BalanceClassesReport" pageWidth="578" pageHeight="41" whenNoDataType="BlankPage" columnWidth="578" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenResourceMissingType="Empty" isIgnorePagination="true" uuid="75ff [...] + <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> + <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> + <property name="com.jaspersoft.studio.unit." value="pixel"/> + <style name="Default" isDefault="true" fontName="Arial"/> + <style name="Default oblique" fontName="Monospaced"/> + <queryString> + <![CDATA[]]> + </queryString> + <field name="soldeDebit" class="java.lang.String"/> + <field name="soldeCredit" class="java.lang.String"/> + <field name="financialPeriodReport" class="java.util.List"/> + <field name="subReportPath" class="java.lang.String"/> + <field name="code" class="java.lang.String"/> + <field name="libelle" class="java.lang.String"/> + <variable name="generalEntryBookEntry" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"> + <variableExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource((java.util.List)$F{financialPeriodReport})]]></variableExpression> + </variable> + <pageHeader> + <band height="10"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <frame> + <reportElement style="Default" mode="Opaque" x="0" y="0" width="578" height="10" forecolor="#FEEEDE" backcolor="#FEEEDE" uuid="b362ba5e-b960-4aff-8c28-d8288ee352a1"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <property name="local_mesure_unity" value="pixel"/> + <property name="com.jaspersoft.studio.unit.y" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + </box> + <textField pattern="" isBlankWhenNull="true"> + <reportElement x="0" y="0" width="578" height="10" forecolor="#736343" uuid="1472eda4-3df8-47ae-aba7-0aae2d2bedae"> + <property name="local_mesure_unity" value="pixel"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="8" isBold="true" isItalic="true"/> + <paragraph lineSpacingSize="0.0" leftIndent="40"/> + </textElement> + <textFieldExpression><![CDATA["Journal " + $F{code} + " - " + $F{libelle}]]></textFieldExpression> + </textField> + </frame> + </band> + </pageHeader> + <detail> + <band height="10" splitType="Stretch"> + <subreport isUsingCache="false" runToBottom="false"> + <reportElement key="subreport-5" positionType="Float" mode="Transparent" x="0" y="0" width="578" height="10" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF" uuid="d7fbefd9-03b1-4eaf-b7c6-fb46c737190a"/> + <dataSourceExpression><![CDATA[$V{generalEntryBookEntry}]]></dataSourceExpression> + <subreportExpression><![CDATA[JasperCompileManager.compileReport($F{subReportPath})]]></subreportExpression> + </subreport> + </band> + </detail> + <columnFooter> + <band height="1"> + <line> + <reportElement style="Default" x="0" y="0" width="578" height="1" forecolor="#FDCA97" uuid="ca761e3c-0dba-448f-a60d-afc241c74411"/> + </line> + </band> + </columnFooter> + <lastPageFooter> + <band height="20"> + <frame> + <reportElement style="Default" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="578" height="20" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="c324a13a-f844-4fd2-85ab-ff5defb2aa54"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <property name="local_mesure_unity" value="pixel"/> + <property name="com.jaspersoft.studio.unit.y" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + </box> + <textField isBlankWhenNull="true"> + <reportElement x="0" y="0" width="434" height="20" forecolor="#736343" uuid="a1d135c1-fcc7-4906-9600-2a032d70cbb9"> + <property name="local_mesure_unity" value="pixel"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="12" isBold="true" isItalic="true"/> + <paragraph lineSpacingSize="0.0" leftIndent="40"/> + </textElement> + <textFieldExpression><![CDATA["Total du Journal " + $F{code}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="Default" x="434" y="0" width="72" height="20" forecolor="#736343" uuid="b54a600a-5470-49c8-b35f-0891243f6607"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="Courier 10 Pitch" size="12" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{soldeDebit}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="Default" x="506" y="0" width="72" height="20" forecolor="#736343" uuid="6f442c54-3926-45c0-8d76-e4b837dfaaa6"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="Courier 10 Pitch" size="12" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{soldeCredit}]]></textFieldExpression> + </textField> + </frame> + </band> + </lastPageFooter> +</jasperReport> diff --git a/lima-web/src/main/jasperreports/provisionalEntryBook/FinancialPeriodReport.jrxml b/lima-web/src/main/jasperreports/provisionalEntryBook/FinancialPeriodReport.jrxml new file mode 100644 index 0000000..85dda2d --- /dev/null +++ b/lima-web/src/main/jasperreports/provisionalEntryBook/FinancialPeriodReport.jrxml @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 --> +<!-- 2014-11-19T18:45:23 --> +<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="BalanceClassesReport" pageWidth="578" pageHeight="21" whenNoDataType="BlankPage" columnWidth="578" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenResourceMissingType="Empty" isIgnorePagination="true" uuid="75ff [...] + <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> + <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> + <property name="com.jaspersoft.studio.unit." value="pixel"/> + <style name="Default" isDefault="true" fontName="Arial"/> + <style name="Default oblique" fontName="Monospaced"/> + <queryString> + <![CDATA[]]> + </queryString> + <field name="soldeDebit" class="java.lang.String"/> + <field name="soldeCredit" class="java.lang.String"/> + <field name="transaction" class="java.util.List"/> + <field name="subReportPath" class="java.lang.String"/> + <field name="period" class="java.util.Date"/> + <field name="libelle" class="java.lang.String"/> + <variable name="generalEntryBookEntry" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"> + <variableExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource((java.util.List)$F{transaction})]]></variableExpression> + </variable> + <pageHeader> + <band height="10"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <frame> + <reportElement style="Default" mode="Opaque" x="0" y="0" width="578" height="10" forecolor="#FEEEDE" backcolor="#FEEEDE" uuid="b362ba5e-b960-4aff-8c28-d8288ee352a1"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <property name="local_mesure_unity" value="pixel"/> + <property name="com.jaspersoft.studio.unit.y" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + </box> + <textField pattern="" isBlankWhenNull="true"> + <reportElement x="0" y="0" width="578" height="10" forecolor="#736343" uuid="1472eda4-3df8-47ae-aba7-0aae2d2bedae"> + <property name="local_mesure_unity" value="pixel"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="8" isBold="true" isItalic="true"/> + <paragraph lineSpacingSize="0.0" leftIndent="40"/> + </textElement> + <textFieldExpression><![CDATA[new SimpleDateFormat("MMMM yyyy").format($F{period})]]></textFieldExpression> + </textField> + </frame> + </band> + </pageHeader> + <detail> + <band height="10" splitType="Stretch"> + <subreport isUsingCache="false" runToBottom="false"> + <reportElement key="subreport-5" positionType="Float" mode="Transparent" x="0" y="0" width="578" height="10" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF" uuid="d7fbefd9-03b1-4eaf-b7c6-fb46c737190a"/> + <dataSourceExpression><![CDATA[$V{generalEntryBookEntry}]]></dataSourceExpression> + <subreportExpression><![CDATA[JasperCompileManager.compileReport($F{subReportPath})]]></subreportExpression> + </subreport> + </band> + <band height="10" splitType="Stretch"> + <frame> + <reportElement style="Default" mode="Opaque" x="0" y="0" width="578" height="10" forecolor="#FEEEDE" backcolor="#FEEEDE" uuid="571d1774-22c4-4ab4-901b-7470c74f0405"> + <property name="local_mesure_unitheight" value="pixel"/> + <property name="com.jaspersoft.studio.unit.height" value="px"/> + <property name="local_mesure_unity" value="pixel"/> + <property name="com.jaspersoft.studio.unit.y" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#FDCA97"/> + </box> + <textField isBlankWhenNull="true"> + <reportElement x="0" y="0" width="434" height="10" forecolor="#736343" uuid="dc68030b-597d-47b5-8be9-eecfdde17f5e"> + <property name="local_mesure_unity" value="pixel"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="8" isBold="true" isItalic="true"/> + <paragraph lineSpacingSize="0.0" leftIndent="40"/> + </textElement> + <textFieldExpression><![CDATA["Sous-total pour " + new SimpleDateFormat("MMMM yyyy").format($F{period})]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="Default" x="434" y="0" width="72" height="10" forecolor="#736343" uuid="53ba669a-6626-4e70-bbf0-fb243908a20e"/> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="Courier 10 Pitch" size="8" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{soldeDebit}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="Default" x="506" y="0" width="72" height="10" forecolor="#736343" uuid="edb8a8c1-ac7a-44cb-9de6-b231b00f966f"/> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + </box> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="Courier 10 Pitch" size="8" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{soldeCredit}]]></textFieldExpression> + </textField> + </frame> + </band> + </detail> + <columnFooter> + <band height="1"> + <line> + <reportElement style="Default" x="0" y="0" width="578" height="1" forecolor="#FDCA97" uuid="ca761e3c-0dba-448f-a60d-afc241c74411"/> + </line> + </band> + </columnFooter> +</jasperReport> diff --git a/lima-web/src/main/jasperreports/provisionalEntryBook/Transaction.jrxml b/lima-web/src/main/jasperreports/provisionalEntryBook/Transaction.jrxml new file mode 100644 index 0000000..a488181 --- /dev/null +++ b/lima-web/src/main/jasperreports/provisionalEntryBook/Transaction.jrxml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created with Jaspersoft Studio version 5.6.2.final using JasperReports Library version 5.6.1 --> +<!-- 2014-11-19T17:35:13 --> +<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="BalanceClassesReport" pageWidth="578" pageHeight="21" columnWidth="578" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="75ff86c6-c370-4f0b-a2d3-e17324a465bb"> + <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> + <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> + <property name="com.jaspersoft.studio.unit." value="pixel"/> + <style name="Default" isDefault="true" fontName="Arial"/> + <style name="Default oblique" fontName="Monospaced"/> + <queryString> + <![CDATA[]]> + </queryString> + <field name="libelle" class="java.lang.String"/> + <field name="debit" class="java.lang.String"/> + <field name="credit" class="java.lang.String"/> + <field name="transactionDate" class="java.util.Date"/> + <field name="account" class="java.lang.String"/> + <field name="voucher" class="java.lang.String"/> + <detail> + <band height="10" splitType="Stretch"> + <textField pattern="" isBlankWhenNull="true"> + <reportElement x="0" y="0" width="80" height="10" uuid="c5f32333-c77a-45f8-9bec-c8d61e15d85a"> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="8"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[ new SimpleDateFormat("dd/MM/yyyy à HH:mm").format($F{transactionDate})]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement x="80" y="0" width="80" height="10" uuid="c5f32333-c77a-45f8-9bec-c8d61e15d85a"> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="8"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{account}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement x="160" y="0" width="40" height="10" uuid="c5f32333-c77a-45f8-9bec-c8d61e15d85a"> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="8"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{voucher}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement x="200" y="0" width="234" height="10" uuid="0bcc6e5d-b2ee-474f-8e66-475933d55a16"> + <property name="local_mesure_unity" value="pixel"/> + <property name="local_mesure_unitwidth" value="pixel"/> + <property name="com.jaspersoft.studio.unit.width" value="px"/> + <property name="local_mesure_unitx" value="pixel"/> + <property name="com.jaspersoft.studio.unit.x" value="px"/> + </reportElement> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="8"/> + <paragraph leftIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{libelle}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement x="434" y="0" width="72" height="10" uuid="53ba669a-6626-4e70-bbf0-fb243908a20e"/> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="Courier 10 Pitch" size="8"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{debit}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement x="506" y="0" width="72" height="10" uuid="edb8a8c1-ac7a-44cb-9de6-b231b00f966f"/> + <box> + <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="Courier 10 Pitch" size="8"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[$F{credit}]]></textFieldExpression> + </textField> + </band> + </detail> +</jasperReport> 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 c4786a4..086b52d 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 @@ -22,7 +22,6 @@ package org.chorem.lima.web.action; -import com.google.common.base.Strings; import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -45,9 +44,9 @@ import org.chorem.lima.business.api.ReportService; import org.chorem.lima.business.api.VatStatementService; import org.chorem.lima.business.api.report.BalanceReportService; import org.chorem.lima.business.api.report.GeneralEntryBookReportService; +import org.chorem.lima.business.api.report.ProvisionalEntryBookReportService; import org.chorem.lima.business.utils.EntryComparator; import org.chorem.lima.entity.Account; -import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.Identity; @@ -87,6 +86,8 @@ public class DocumentService { protected GeneralEntryBookReportService generalEntryBookReportService; + protected ProvisionalEntryBookReportService provisionalEntryBookReportService; + protected ClosedPeriodicEntryBookService closedPeriodicEntryBookService; protected FinancialPeriodService financialPeriodService; @@ -101,6 +102,7 @@ public class DocumentService { protected final String BALANCE_FILE_PATH = path + File.separator + DocumentsEnum.BALANCE.getFileName() + ".pdf"; protected final String GENERAL_ENTRY_BOOK_REPORT_PDF_FILE_PATH = path + File.separator + DocumentsEnum.GENERAL_ENTRY_BOOK.getFileName() + ".pdf"; + protected final String ENTRY_BOOKS_REPORT_PDF_FILE_PATH = path + File.separator + DocumentsEnum.ENTRY_BOOKS.getFileName() + ".pdf"; public DocumentService() { identityService = LimaServiceFactory.getService(IdentityService.class); @@ -114,6 +116,7 @@ public class DocumentService { balanceReportService = LimaServiceFactory.getService(BalanceReportService.class); generalEntryBookReportService = LimaServiceFactory.getService(GeneralEntryBookReportService.class); + provisionalEntryBookReportService = LimaServiceFactory.getService(ProvisionalEntryBookReportService.class); reportBuilder = new ReportBuilder(); @@ -396,96 +399,6 @@ public class DocumentService { return ledgerReport; } - public String createEntryBooksDocuments(Date beginDate, - Date endDate) { - String entryBookReport; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMMMM yyyy"); - try { - entryBookReport = constructHtmlHeader(t("lima-business.document.entrybooks")); - - if (beginDate != null && endDate != null) { - - //Split list by financialstatement type - List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList = - closedPeriodicEntryBookService.getAllByDates(beginDate, endDate); - - String journal = ""; - for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) { - - // TODO echatellier 20120509, was not about only - // balanced transaction here, normal ? - List<Entry> entries = entryService.findAllEntryByDateForEntryBook(closedPeriodicEntryBook); - - if (entries.size() > 0) { - List<Object[]> results = entryService.findDebitCreditOfTransaction(closedPeriodicEntryBook); - BigDecimal debit = BigDecimal.ZERO; - BigDecimal credit = BigDecimal.ZERO; - int nbAmount = results.size(); - if (nbAmount == 2) { - debit = (BigDecimal) results.get(0)[1]; - credit = (BigDecimal) results.get(1)[1]; - } - if (nbAmount == 1) { - if ((Boolean) results.get(0)[0]) { - debit = (BigDecimal) results.get(0)[1]; - } else { - credit = (BigDecimal) results.get(0)[1]; - } - } - - String subTitleSecPart = t("lima-business.document.date") + " : " + - simpleDateFormat.format(closedPeriodicEntryBook.getFinancialPeriod().getBeginDate()); - if (closedPeriodicEntryBook.getEntryBook() != null) { - String label = Strings.isNullOrEmpty(closedPeriodicEntryBook.getEntryBook().getLabel()) ? "-" :closedPeriodicEntryBook.getEntryBook().getLabel(); - if (!journal.equals(label)) { - entryBookReport += constructSubTitleHtml(t("lima-business.document.entrybook") - + " : " + label, - subTitleSecPart); - journal = label; - } else { - entryBookReport += constructSubTitleHtml("", subTitleSecPart); - } - } - - entryBookReport += "<table border=\"1\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\">\n" + - "<tr align=\"center\">\n"; - - String [] columnNames = {t("lima-business.document.date"), t("lima-business.document.accountnumber"), - t("lima-business.document.voucher"), t("lima-business.document.description"), - t("lima-business.document.debit"), - t("lima-business.document.credit")}; - - entryBookReport += constructTableHeader(columnNames); - - for (Entry entry : entries) { - String numaccount = null; - if (entry.getAccount() != null) { - numaccount = entry.getAccount().getAccountNumber(); - } - String [] columnData = {t("lima-business.document.dateformat", entry.getFinancialTransaction().getTransactionDate()), - (StringUtils.isBlank(numaccount)?"":numaccount), (StringUtils.isBlank(entry.getVoucher())?"":entry.getVoucher()), - (StringUtils.isBlank(entry.getDescription())?"":entry.getDescription()), - (entry.isDebit() ? entry.getAmount() : BigDecimal.ZERO).toString(), - (entry.isDebit() ? BigDecimal.ZERO : entry.getAmount()).toString()}; - - entryBookReport += constructTableHeader(columnData); - } - String [] columnDataTotal = {"", "", "", t("lima-business.document.amounts"), debit.toString(), credit.toString()}; - entryBookReport += constructTableHeader(columnDataTotal); - entryBookReport += "</table></p>\n"; - } - } - entryBookReport += "</body>\n</html>"; - } - } catch (Exception ex) { - throw new LimaTechnicalException("Can't create document", ex); - } - - return entryBookReport; - } - - - //############## VAT ############## public void createVatDocuments(Date beginDate, Date endDate, @@ -776,4 +689,10 @@ public class DocumentService { reportBuilder.generatePDFReport(org.chorem.lima.business.utils.DocumentsEnum.GENERAL_ENTRYBOOK, GENERAL_ENTRY_BOOK_REPORT_PDF_FILE_PATH, Lists.newArrayList(report)); return report; } + + public DocumentReport createEntryBooksDocuments(Date beginDate, Date endDate, List<String> entryBookCodes, String currency) { + DocumentReport report = provisionalEntryBookReportService.getProvisionalEntryBookDocumentReport(beginDate, endDate, entryBookCodes, currency); + reportBuilder.generatePDFReport(org.chorem.lima.business.utils.DocumentsEnum.ENTRYBOOKS, ENTRY_BOOKS_REPORT_PDF_FILE_PATH, Lists.newArrayList(report)); + return report; + } } diff --git a/lima-web/src/main/java/org/chorem/lima/web/action/balance/ReportBuilder.java b/lima-web/src/main/java/org/chorem/lima/web/action/balance/ReportBuilder.java index 53bc62a..b0d571d 100644 --- a/lima-web/src/main/java/org/chorem/lima/web/action/balance/ReportBuilder.java +++ b/lima-web/src/main/java/org/chorem/lima/web/action/balance/ReportBuilder.java @@ -50,6 +50,7 @@ public class ReportBuilder { protected JasperReport balanceReport; protected JasperReport generalEntryBookReport; + protected JasperReport provisionalEntryBookReport; protected Map<DocumentsEnum, JasperReport> reportsByDocumentType; public ReportBuilder() { @@ -59,10 +60,12 @@ public class ReportBuilder { // TODO DCossé 06/11/14 find it from properties balanceReport= JasperCompileManager.compileReport(rootPath + "/lima-web/src/main/jasperreports/balance/BalanceReport.jrxml"); generalEntryBookReport = JasperCompileManager.compileReport(rootPath + "/lima-web/src/main/jasperreports/generalEntryBook/EntryBookMainReport.jrxml"); + provisionalEntryBookReport = JasperCompileManager.compileReport(rootPath + "/lima-web/src/main/jasperreports/provisionalEntryBook/EntryBookMainReport.jrxml"); reportsByDocumentType = Maps.newHashMap(); reportsByDocumentType.put(DocumentsEnum.BALANCE, balanceReport); reportsByDocumentType.put(DocumentsEnum.GENERAL_ENTRYBOOK, generalEntryBookReport); + reportsByDocumentType.put(DocumentsEnum.ENTRYBOOKS, provisionalEntryBookReport); } catch (JRException e) { throw new LimaTechnicalException(e); } 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 eb509a8..936972d 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 @@ -172,8 +172,7 @@ public class HttpServerService { beginDateFormat, endDateFormat, account); break; case ENTRYBOOKS: - entryBooksReport = documentService.createEntryBooksDocuments( - beginDateFormat, endDateFormat); + documentService.createEntryBooksDocuments(beginDateFormat, endDateFormat, null, "€"); if (log.isDebugEnabled()) { log.debug("EntryBookReport :" + entryBooksReport); } @@ -203,15 +202,12 @@ public class HttpServerService { log.error("Can't parse date", eeePE); } - if ( (accountReport != null || entryBooksReport != null - || ledgerReport != null || financialReport != null)) { + if ( (accountReport != null || ledgerReport != null || financialReport != null)) { String report; resp.setContentType(".html"); OutputStream out = resp.getOutputStream(); if (accountReport != null) { report = accountReport; - } else if (entryBooksReport != null) { - report = entryBooksReport; } else if (ledgerReport != null) { report = ledgerReport; } else { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm