From dcosse@users.chorem.org Tue Apr 15 18:09:41 2014 From: dcosse@users.chorem.org To: lima-commits@list.chorem.org Subject: [Lima-commits] r3778 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb Date: Tue, 15 Apr 2014 18:09:41 +0200 Message-ID: <20140415160941.C8226181760@nuiton.codelutin.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5753704047493351605==" --===============5753704047493351605== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: dcosse Date: 2014-04-15 18:09:41 +0200 (Tue, 15 Apr 2014) New Revision: 3778 Url: http://forge.chorem.org/projects/lima/repository/revisions/3778 Log: fixes #1015 fix EBP compta import failure Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentSer= viceImpl.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/Docu= mentServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentSe= rviceImpl.java 2014-04-14 07:29:08 UTC (rev 3777) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentSe= rviceImpl.java 2014-04-15 16:09:41 UTC (rev 3778) @@ -111,7 +111,7 @@ =20 @Override public String createFinancialStatementsDocuments(Date beginDate, - Date endDate) throws Lima= Exception { + Date endDate) throws Li= maException { =20 List financialStatementAmounts =3D financialStatementService.financialStatementReport(beginDate= , endDate); @@ -252,7 +252,7 @@ //############## Ledger ############## @Override public String createLedgerDocuments(Date beginDate, - Date endDate) throws LimaException { + Date endDate) throws LimaException { =20 List list =3D new ArrayList(); String ledgerReport =3D constructHtmlHeader(t("lima-business.documen= t.ledger")); @@ -289,7 +289,7 @@ ledgerReport +=3D "\n"; =20 String [] columnsNames =3D {t("lima-business.document.ac= count"), t("lima-business.document.debit"), - t("lima-business.document.credit"), t("lima-business= .document.solde")}; + t("lima-business.document.credit"), t("lima-busi= ness.document.solde")}; ledgerReport +=3D constructTableHeader(columnsNames); ledgerReport +=3D "\n"; =20 @@ -337,7 +337,7 @@ =20 ledgerReport +=3D""; if (indexEntry =3D=3D 0) { - ledgerReport +=3D "\n"; return line; } - =20 + protected String constructTableLine(String[] cells) { String line =3D "\t\t\n"; for (String cell : cells) { --===============5753704047493351605==--
\n"; + ledgerReport +=3D "
\n"; String [] columnsEntry =3D {t("lima-business= .document.date"), t("lima-business.document.entrybook"= ), t("lima-business.document.voucher"), t("lima-business.document.descriptio= n"), t("lima-business.document.debit"), @@ -389,7 +389,7 @@ =20 @Override public String createEntryBooksDocuments(Date beginDate, - Date endDate) throws LimaException= { + Date endDate) throws LimaExcepti= on { String entryBookReport; SimpleDateFormat simpleDateFormat =3D new SimpleDateFormat("MMMMM yy= yy"); try { @@ -439,7 +439,7 @@ String label =3D Strings.isNullOrEmpty(closedPer= iodicEntryBook.getEntryBook().getLabel()) ? "-" :closedPeriodicEntryBook.getE= ntryBook().getLabel(); if (!journal.equals(label)) { entryBookReport +=3D constructSubTitleHtml(t= ("lima-business.document.entrybook") - + " : " + label, + + " : " + label, subTitleSecPart); journal =3D label; } else { @@ -488,7 +488,7 @@ =20 @Override public String createBalanceDocuments(Date beginDate, - Date endDate) throws LimaException { + Date endDate) throws LimaException { =20 BalanceTrial balanceTrial =3D reportService.generateBalanceTrial(beginDate, endDate, null,= false, true); @@ -566,7 +566,7 @@ =20 @Override public String createGeneralEntryBooksDocuments(Date beginDate, - Date endDate) throws LimaEx= ception { + Date endDate) throws Lima= Exception { =20 String entryBookReport; try { @@ -575,9 +575,9 @@ =20 if (beginDate !=3D null && endDate !=3D null) { String subTitle =3D t("lima-business.document.period1") + - simpleDateFormat.format(beginDate) + " " + - t("lima-business.document.period2") + - simpleDateFormat.format(endDate); + simpleDateFormat.format(beginDate) + " " + + t("lima-business.document.period2") + + simpleDateFormat.format(endDate); entryBookReport +=3D constructSubTitleHtml(subTitle); =20 FinancialPeriodDAO financialPeriodDAO =3D @@ -703,8 +703,8 @@ } } entryBookReport +=3D "\t\t\n" + - "\t
\n" + - "\n"; + "\t
\n" + + "\n"; } } catch (Exception ex) { throw new LimaException("Can't generate document", ex); @@ -720,12 +720,12 @@ String autocomplete) throws LimaException= { =20 String filePath =3D path + File.separator - + DocumentsEnum.VAT.getFileName() + ".pdf"; + + DocumentsEnum.VAT.getFileName() + ".pdf"; =20 String path =3D LimaConfig.getInstance().getReportsDir().getAbsolute= Path(); =20 String filePathDefault =3D path + File.separator - + DocumentsEnum.VAT.getFileName() + "_defau= lt.pdf"; + + DocumentsEnum.VAT.getFileName() + "_default.pdf"; =20 PDDocument doc; InputStream reportsStream; @@ -737,14 +737,14 @@ .getResourceAsStream("/reports/vat_form_fr.pdf"); if (reportsStream =3D=3D null) { throw new LimaException("Could not find such file " - + "/reports/vat_form_fr.pdf"); + + "/reports/vat_form_fr.pdf"); } } else { try { reportsStream =3D new FileInputStream(filePathDefault); } catch (FileNotFoundException eee) { throw new LimaException("Could not find such file " - + filePathDefault, eee); + + filePathDefault, eee); } } =20 @@ -804,7 +804,7 @@ =20 ReportsDatas results; =20 - if (beginDate !=3D null && endDate !=3D null && account !=3D nul= l) { + if (beginDate !=3D null && endDate !=3D null && accountFormat != =3D null) { =20 String subTitleFirstpart =3D t("lima.ui.fiscalperiod.fiscal= period") + " : " + simpleDateFormat.format(beginDate) + " - " + simpleDateFor= mat.format(endDate); String subTitleSecPart =3D t("lima.ui.financialtransaction.a= ccount") + " : " + accountFormat.getAccountNumber() + " - " + accountFormat.g= etLabel(); @@ -815,14 +815,14 @@ List entries =3D results.getListEntry(); =20 String[] columnNames =3D {t("lima.table.number"), t("lima.ta= ble.date"), t("lima.table.entrybook"), - t("lima.table.voucher"), t("lima.tab= le.description"), t("lima.table.letter"), - t("lima.table.debit"), t("lima.table= .credit")}; + t("lima.table.voucher"), t("lima.table.description")= , t("lima.table.letter"), + t("lima.table.debit"), t("lima.table.credit")}; =20 accountReport +=3D "\t\n"; =20 accountReport +=3D constructTableHeader(columnNames); accountReport +=3D "\t\t\n"; - =20 + boolean even =3D true; for(Entry entry : entries) { =20 @@ -838,17 +838,17 @@ =20 =20 String[] columnData =3D {(StringUtils.isBlank(accountNum= ber)?"":accountNumber), (StringUtils.isBlank(transactionDate)?"":transactionD= ate), - (StringUtils.isBlank(code)?"":co= de), (StringUtils.isBlank(voucher)?"":voucher), - (StringUtils.isBlank(description= )?"":description), (StringUtils.isBlank(lettering)?"":lettering), - (entry.getDebit() ? entry.getAmo= unt() : BigDecimal.ZERO).toString(), - (entry.getDebit() ? BigDecimal.Z= ERO : entry.getAmount()).toString()}; + (StringUtils.isBlank(code)?"":code), (StringUtil= s.isBlank(voucher)?"":voucher), + (StringUtils.isBlank(description)?"":description= ), (StringUtils.isBlank(lettering)?"":lettering), + (entry.getDebit() ? entry.getAmount() : BigDecim= al.ZERO).toString(), + (entry.getDebit() ? BigDecimal.ZERO : entry.getA= mount()).toString()}; =20 accountReport +=3D constructTableLine(columnData, even); even =3D !even; } =20 accountReport +=3D "\t\t\n\t
\n" + - "\n"; + "\n"; =20 } else { JOptionPane.showMessageDialog(null, t("lima.reports.account.= noaccount"), t("lima.reports.account.noaccounttitle"), JOptionPane.INFORMATIO= N_MESSAGE); @@ -868,13 +868,13 @@ =20 protected String constructHtmlHeader(String title) { String head =3D "\n" + - "\n" + - "\n" + - "\t\n" + - "\t" + title + "\n" + - "\n" + - "\n" + - "\t

" + title + "

\n"; + "\n" + + "\n" + + "\t\n" + + "\t" + title + "\n" + + "\n" + + "\n" + + "\t

" + title + "

\n"; return head; } =20 @@ -910,7 +910,7 @@ line +=3D "\t\t