From dcosse@users.chorem.org Fri Feb 14 19:06:21 2014 From: dcosse@users.chorem.org To: lima-commits@list.chorem.org Subject: [Lima-commits] r3746 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-swing/src/main/java/org/chorem/lima/ui/importexport Date: Fri, 14 Feb 2014 19:06:21 +0100 Message-ID: <20140214180621.7A1E6183851@nuiton.codelutin.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1523717558555028138==" --===============1523717558555028138== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: dcosse Date: 2014-02-14 19:06:21 +0100 (Fri, 14 Feb 2014) New Revision: 3746 Url: http://chorem.org/projects/lima/repository/revisions/3746 Log: refs #970 work in progress Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentSer= viceImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExpor= t.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-02-14 14:59:24 UTC (rev 3745) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentSe= rviceImpl.java 2014-02-14 18:06:21 UTC (rev 3746) @@ -25,6 +25,7 @@ =20 package org.chorem.lima.business.ejb; =20 +import com.google.common.base.Strings; import com.lowagie.text.Font; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -45,6 +46,7 @@ import org.chorem.lima.business.api.VatStatementService; import org.chorem.lima.business.utils.DocumentsEnum; import org.chorem.lima.business.utils.EntryComparator; +import org.chorem.lima.business.utils.FormatsEnum; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountDAO; import org.chorem.lima.entity.ClosedPeriodicEntryBook; @@ -145,112 +147,108 @@ =20 //create pages for (List list : listList) { - String title =3D list.get(0).getLabel(); - int i =3D 0; - int n =3D list.size(); - printedType ++; - while (i < n) { - int j =3D i + n; - if (j > n) { - j =3D n; - } - List subFinancialStatementAmo= unts =3D - list.subList(i, j); + if (!list.isEmpty()){ + String title =3D list.get(0).getLabel(); + int i =3D 0; + int n =3D list.size(); + printedType ++; + while (i < n) { =20 - financialReport +=3D constructHeaderTitle(title, beginDa= te, endDate); + financialReport +=3D constructHeaderTitle(title, beg= inDate, endDate); =20 - String boldBegin =3D ""; - String boldEnd =3D ""; - financialReport +=3D "\n" + - "\n"; + String boldBegin =3D ""; + String boldEnd =3D ""; + financialReport +=3D "
\n" + + "\n"; =20 - if (printedType =3D=3D 0) { - String[] columnHeaderTable =3D {boldBegin+_("lima-bu= siness.document.label")+boldEnd, boldBegin+_("lima-business.document.grossamo= unt")+boldEnd, - boldBegin+_("lima-business.document.provisio= ndeprecationamount")+boldEnd, boldBegin+_("lima-business.document.netamount")= +boldEnd}; - financialReport +=3D constructTableLine(columnHeader= Table); - } else if (printedType =3D=3D 1) { - String[] columnHeaderTable =3D {boldBegin+_("lima-bu= siness.document.label")+boldEnd, boldBegin+_("lima-business.document.amount")= +boldEnd}; - financialReport +=3D constructTableLine(columnHeader= Table); - } else { - String[] columnHeaderTable =3D {boldBegin+_("lima-bu= siness.document.label")+boldEnd, boldBegin+_("lima-business.document.amount")= +boldEnd}; - financialReport +=3D constructTableLine(columnHeader= Table); - } - - for (FinancialStatementAmounts financialStatementAmount = : subFinancialStatementAmounts) { - - String label =3D financialStatementAmount.getLabel(); - int level =3D financialStatementAmount.getLevel(); - BigDecimal grossAmount =3D - financialStatementAmount.getGrossAmount(); - if (grossAmount =3D=3D null) { - grossAmount =3D new BigDecimal(0); - } - BigDecimal provisionDeprecationAmount =3D - financialStatementAmount.getProvisionDepreca= tionAmount(); - if (provisionDeprecationAmount =3D=3D null) { - provisionDeprecationAmount =3D new BigDecimal(0); - } - - String fontColor =3D ""; - if (financialStatementAmount.getSubAmount() && level= =3D=3D 1) { - fontColor =3D "#CCCCCC"; - } else if (financialStatementAmount.getSubAmount()) { - fontColor =3D "#C0C0C0"; + if (printedType =3D=3D 0) { + String[] columnHeaderTable =3D {boldBegin+_("lim= a-business.document.label")+boldEnd, boldBegin+_("lima-business.document.gros= samount")+boldEnd, + boldBegin+_("lima-business.document.prov= isiondeprecationamount")+boldEnd, boldBegin+_("lima-business.document.netamou= nt")+boldEnd}; + financialReport +=3D constructTableLine(columnHe= aderTable); + } else if (printedType =3D=3D 1) { + String[] columnHeaderTable =3D {boldBegin+_("lim= a-business.document.label")+boldEnd, boldBegin+_("lima-business.document.amou= nt")+boldEnd}; + financialReport +=3D constructTableLine(columnHe= aderTable); } else { - fontColor =3D "#999999"; + String[] columnHeaderTable =3D {boldBegin+_("lim= a-business.document.label")+boldEnd, boldBegin+_("lima-business.document.amou= nt")+boldEnd}; + financialReport +=3D constructTableLine(columnHe= aderTable); } - if (label =3D=3D null) { - if (printedType =3D=3D 0) { - String [] emptyColumn =3D {"","","",""}; - financialReport +=3D constructTableLine(empt= yColumn); - } else { - String [] emptyColumn =3D {"", ""}; - financialReport +=3D constructTableLine(empt= yColumn); + + for (FinancialStatementAmounts financialStatementAmo= unt : list) { + + String label =3D financialStatementAmount.getLab= el(); + int level =3D financialStatementAmount.getLevel(= ); + BigDecimal grossAmount =3D + financialStatementAmount.getGrossAmount(= ); + if (grossAmount =3D=3D null) { + grossAmount =3D new BigDecimal(0); } - } else { - //cell1 - StringBuilder tab =3D new StringBuilder(); - for (int k =3D 0; k < level; k++) { - tab.append("\t"); + BigDecimal provisionDeprecationAmount =3D + financialStatementAmount.getProvisionDep= recationAmount(); + if (provisionDeprecationAmount =3D=3D null) { + provisionDeprecationAmount =3D new BigDecima= l(0); } - //Phrase phrase; - String tabLabel =3D ""; - if (financialStatementAmount.getHeader()) { - tabLabel =3D boldBegin + tab + label + boldE= nd; + + String fontColor =3D ""; + if (financialStatementAmount.getSubAmount() && l= evel =3D=3D 1) { + fontColor =3D "#CCCCCC"; + } else if (financialStatementAmount.getSubAmount= ()) { + fontColor =3D "#C0C0C0"; } else { - tabLabel =3D tab + label; + fontColor =3D "#999999"; } - //cell2 - String grossAmountStr =3D ""; - if (!grossAmount.equals(BigDecimal.ZERO)) { - grossAmountStr =3D grossAmount.toString(); - } + if (label =3D=3D null) { + if (printedType =3D=3D 0) { + String [] emptyColumn =3D {"","","",""}; + financialReport +=3D constructTableLine(= emptyColumn); + } else { + String [] emptyColumn =3D {"", ""}; + financialReport +=3D constructTableLine(= emptyColumn); + } + } else { + //cell1 + StringBuilder tab =3D new StringBuilder(); + for (int k =3D 0; k < level; k++) { + tab.append("\t"); + } + //Phrase phrase; + String tabLabel =3D ""; + if (financialStatementAmount.getHeader()) { + tabLabel =3D boldBegin + tab + label + b= oldEnd; + } else { + tabLabel =3D tab + label; + } + //cell2 + String grossAmountStr =3D ""; + if (!grossAmount.equals(BigDecimal.ZERO)) { + grossAmountStr =3D grossAmount.toString(= ); + } =20 - //cell 3 - String provisionDeprecationAmountStr =3D ""; - if (!provisionDeprecationAmount.equals(BigDecima= l.ZERO)) { - provisionDeprecationAmountStr =3D provisionD= eprecationAmount.toString(); - } + //cell 3 + String provisionDeprecationAmountStr =3D ""; + if (!provisionDeprecationAmount.equals(BigDe= cimal.ZERO)) { + provisionDeprecationAmountStr =3D provis= ionDeprecationAmount.toString(); + } =20 - //cell 4 - BigDecimal solde =3D grossAmount; - solde =3D solde.subtract(provisionDeprecationAmo= unt); - String soldeStr =3D ""; - if (!solde.equals(BigDecimal.ZERO)) { - soldeStr =3D solde.toString(); - } + //cell 4 + BigDecimal solde =3D grossAmount; + solde =3D solde.subtract(provisionDeprecatio= nAmount); + String soldeStr =3D ""; + if (!solde.equals(BigDecimal.ZERO)) { + soldeStr =3D solde.toString(); + } =20 - if (printedType =3D=3D 0) { - String [] columns =3D {tabLabel, grossAmount= Str, provisionDeprecationAmountStr, soldeStr}; - financialReport +=3D constructTableLine(colu= mns); - } else /*if (printedType =3D=3D 1)*/ { - String [] columns =3D {tabLabel, soldeStr}; - financialReport +=3D constructTableLine(colu= mns); + if (printedType =3D=3D 0) { + String [] columns =3D {tabLabel, grossAm= ountStr, provisionDeprecationAmountStr, soldeStr}; + financialReport +=3D constructTableLine(= columns); + } else /*if (printedType =3D=3D 1)*/ { + String [] columns =3D {tabLabel, soldeSt= r}; + financialReport +=3D constructTableLine(= columns); + } } } + i =3D i + n; + financialReport +=3D "
"; } - i =3D i + n; - financialReport +=3D ""; } } financialReport +=3D "" + @@ -263,8 +261,6 @@ } =20 //############## Ledger ############## - - @Override public String createLedgerDocuments(Date beginDate, Date endDate) throws LimaException { @@ -292,31 +288,15 @@ //create pages int i =3D 0; int n =3D list.size(); - int max =3D n; =20 + boolean even =3D true; + BigDecimal currentAmountDebit =3D new BigDecimal(0); + BigDecimal currentAmountCredit =3D new BigDecimal(0); + while (i < n) { - int j =3D i + max; - if (j > n) { - j =3D n; - } =20 ledgerReport +=3D constructHeaderTitle(_("lima-business.= document.ledger"), beginDate, endDate); =20 - BigDecimal currentAmountDebit =3D new BigDecimal(0); - BigDecimal currentAmountCredit =3D new BigDecimal(0); - String accountcarry =3D ""; - - List subList =3D list.subList(i, j); - - - //backward amounts - if (n > max ) { - String [] columnsCarryBack =3D {boldBegin + accountc= arry + boldEnd, boldBegin + _("lima-business.document.carryback") + boldEnd, - boldBegin + currentAmountDebit.toString() + = boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, - boldBegin + currentAmountDebit.subtract(curr= entAmountCredit).toString() + boldEnd}; - ledgerReport +=3D constructTableLine(columnsCarryBac= k); - } - ledgerReport +=3D "\n"; =20 String [] columnsNames =3D {_("lima-business.document.ac= count"), _("lima-business.document.debit"), @@ -325,8 +305,8 @@ ledgerReport +=3D "\n"; =20 int indexEntry =3D -1; - boolean even =3D true; - for (Object object : subList) { + + for (Object object : list) { if (object instanceof ReportsDatas) { if (indexEntry !=3D -1) { indexEntry =3D -1; @@ -385,43 +365,30 @@ } } =20 - for (Object objectList : subList) { - if (objectList instanceof Entry) { - Entry entry =3D (Entry) objectList; - if (entry.getDebit()) { - currentAmountDebit =3D currentAmountDebi= t.add(entry.getAmount()); - } else { - currentAmountCredit =3D currentAmountCre= dit.add(entry.getAmount()); - } + for (Object objectList : list) { + if (objectList instanceof Entry) { + Entry entry =3D (Entry) objectList; + if (entry.getDebit()) { + currentAmountDebit =3D currentAmountDebit.ad= d(entry.getAmount()); } else { - ReportsDatas reportsDatas =3D (ReportsDatas)= objectList; - Account account =3D reportsDatas.getAccount(= ); - if (account !=3D null) { - accountcarry =3D account.getAccountNumbe= r() - + " " + account.getLabel= () + " "; - } + currentAmountCredit =3D currentAmountCredit.= add(entry.getAmount()); } + } else { + ReportsDatas reportsDatas =3D (ReportsDatas) obj= ectList; } - //forward amounts - if (n > max && i <=3D n - max) { - String [] columnsTable =3D {"", boldBegin + _("l= ima-business.document.carryforward") + boldEnd, - boldBegin + currentAmountDebit.toString(= ) + boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, - boldBegin + currentAmountDebit.subtract(= currentAmountCredit).toString() + boldEnd}; - ledgerReport +=3D constructTableLine(columnsTabl= e, even); - even =3D !even; - } - //final amounts - if (i >=3D n - max) { - String [] columnsTable =3D { boldBegin + _("lima= -business.document.amounts") + boldEnd, - boldBegin + currentAmountDebit.toString(= ) + boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, - boldBegin + currentAmountDebit.subtract(= currentAmountCredit).toString() + boldEnd}; - ledgerReport +=3D constructTableLine(columnsTabl= e, even); - even =3D !even; - } - i =3D i + max; + } + + i =3D i + n; } + //final amounts + String [] columnsTable =3D { boldBegin + _("lima-business.do= cument.amounts") + boldEnd, + boldBegin + currentAmountDebit.toString() + boldEnd,= boldBegin + currentAmountCredit.toString() + boldEnd, + boldBegin + currentAmountDebit.subtract(currentAmoun= tCredit).toString() + boldEnd}; + ledgerReport +=3D constructTableLine(columnsTable, even); + + ledgerReport +=3D "
\n"; - }catch (Exception ex) { + } catch (Exception ex) { log.error("Can't create document", ex); } } @@ -476,13 +443,16 @@ =20 String subTitleSecPart =3D _("lima-business.document= .date") + " : " + simpleDateFormat.format(closedPeriodicEntryB= ook.getFinancialPeriod().getBeginDate()); - if (!journal.equals(closedPeriodicEntryBook.getEntry= Book().getLabel())) { - entryBookReport +=3D constructSubTitleHtml(_("li= ma-business.document.entrybook") - + " : " + closedPeriodicEntryBook.getEnt= ryBook().getLabel(), - subTitleSecPart); - journal =3D closedPeriodicEntryBook.getEntryBook= ().getLabel(); - } else { - entryBookReport +=3D constructSubTitleHtml("", s= ubTitleSecPart); + if (closedPeriodicEntryBook.getEntryBook() !=3D null= ) { + String label =3D Strings.isNullOrEmpty(closedPer= iodicEntryBook.getEntryBook().getLabel()) =3D=3D true ? "-" :closedPeriodicEn= tryBook.getEntryBook().getLabel(); + if (!journal.equals(label)) { + entryBookReport +=3D constructSubTitleHtml(_= ("lima-business.document.entrybook") + + " : " + label, + subTitleSecPart); + journal =3D label; + } else { + entryBookReport +=3D constructSubTitleHtml("= ", subTitleSecPart); + } } =20 entryBookReport +=3D "\n" + @@ -546,12 +516,8 @@ int i =3D 0; int n =3D list.size(); =20 + boolean even =3D true; while (i < n) { - int j =3D i + n; - if (j > n) { - j =3D n; - } - List subList =3D list.subList(i, j); =20 balanceReport +=3D constructHeaderTitle(_("lima-business= .document.balance"), beginDate, endDate); =20 @@ -563,18 +529,7 @@ balanceReport +=3D constructTableHeader(columnsNames); balanceReport +=3D "\t\t\n"; =20 - if (n > n) { - String boldBegin =3D ""; - String boldEnd =3D ""; - String [] columnsBalanceAmount =3D {"", boldBegin + = _("lima-business.document.carryback") + boldEnd, - boldBegin + currentAmountDebit.toString() + = boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, - boldBegin + currentSoldeDebit.toString() + b= oldEnd,boldBegin + currentSoldeCredit.toString() + boldEnd}; - balanceReport +=3D constructTableLine(columnsBalance= Amount); - balanceReport +=3D "
\n"; - } - - boolean even =3D true; - for (ReportsDatas reportsDatas : subList) { + for (ReportsDatas reportsDatas : list) { String soldeDebit =3D String.valueOf(reportsDatas.ge= tSoldeDebit() ? reportsDatas.getAmountSolde() : 0); String soldeCredit =3D String.valueOf(reportsDatas.g= etSoldeDebit() ? 0 : reportsDatas.getAmountSolde()); =20 @@ -583,9 +538,7 @@ soldeDebit, soldeCredit}; balanceReport +=3D constructTableLine(columnsBalance= Amount, even); even =3D !even; - } =20 - for (ReportsDatas reportsDatas : subList) { currentAmountDebit =3D currentAmountDebit.add(report= sDatas.getAmountDebit()); currentAmountCredit =3D currentAmountCredit.add(repo= rtsDatas.getAmountCredit()); if (reportsDatas.getSoldeDebit()) { @@ -595,30 +548,18 @@ } } =20 - if (n > n && i <=3D n - n) { - String boldBegin =3D ""; - String boldEnd =3D ""; - String [] columnsBalanceAmount =3D {"", boldBegin + = _("lima-business.document.carryforward") + boldEnd, - boldBegin + currentAmountDebit.toString() + = boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, - boldBegin + currentSoldeDebit.toString() + b= oldEnd,boldBegin + currentSoldeCredit.toString() + boldEnd}; - balanceReport +=3D constructTableLine(columnsBalance= Amount, even); - even =3D !even; - balanceReport +=3D "\n"; - } - - //final amounts - if (i >=3D n - n) { - String boldBegin =3D ""; - String boldEnd =3D ""; - String [] columnsBalanceAmount =3D {"", boldBegin + = _("lima-business.document.amounts") + boldEnd, - boldBegin + currentAmountDebit.toString() + = boldEnd, boldBegin + currentAmountCredit.toString() + boldEnd, - boldBegin + currentSoldeDebit.toString() + b= oldEnd,boldBegin + currentSoldeCredit.toString() + boldEnd}; - balanceReport +=3D constructTableLine(columnsBalance= Amount, even); - even =3D !even; - balanceReport +=3D "\n"; - } i =3D i + n; } + //final amounts + String boldBegin =3D ""; + String boldEnd =3D ""; + String [] columnsBalanceAmount =3D {"", boldBegin + _("lima-= business.document.amounts") + boldEnd, + boldBegin + currentAmountDebit.toString() + boldEnd,= boldBegin + currentAmountCredit.toString() + boldEnd, + boldBegin + currentSoldeDebit.toString() + boldEnd,b= oldBegin + currentSoldeCredit.toString() + boldEnd}; + balanceReport +=3D constructTableLine(columnsBalanceAmount, = even); + balanceReport +=3D "\n"; + + balanceReport +=3D "\n"; } catch (Exception ex) { log.error("Can't create document", ex); @@ -742,7 +683,7 @@ if (!entryBookCode.equals(generalEntryBooksDataI= nList.getCode())) { entryBookCode =3D generalEntryBooksDataInLis= t.getCode(); code =3D entryBookCode; - description =3D generalEntryBooksDataInList.= getDescription(); + description =3D Strings.isNullOrEmpty(genera= lEntryBooksDataInList.getDescription()) =3D=3D true ? "" : generalEntryBooksD= ataInList.getDescription(); } else { code =3D ""; description =3D ""; @@ -1004,41 +945,43 @@ String boldItalicBegin =3D "" + ""; String boldItalicEnd =3D "" + ""; =20 - String [] columnsNameSociety =3D {boldItalicBegin + _("lima-business= .document.society") + boldItalicEnd, - "" + (StringUtils.isNotEmpty(identity.getName()) ? identi= ty.getName() : " - ") + "", }; - headerTitle +=3D constructTableLine(columnsNameSociety); + if (identity !=3D null) { + String [] columnsNameSociety =3D {boldItalicBegin + _("lima-busi= ness.document.society") + boldItalicEnd, + "" + (StringUtils.isNotEmpty(identity.getName()) ? id= entity.getName() : " - ") + "", }; + headerTitle +=3D constructTableLine(columnsNameSociety); =20 - String [] columnsDescription =3D {boldItalicBegin + _("lima-business= .document.description") + boldItalicEnd, - "" + (StringUtils.isNotEmpty(identity.getDescription()) ?= identity.getDescription() : " - ") + "", }; - headerTitle +=3D constructTableLine(columnsDescription); + String [] columnsDescription =3D {boldItalicBegin + _("lima-busi= ness.document.description") + boldItalicEnd, + "" + (StringUtils.isNotEmpty(identity.getDescription(= )) ? identity.getDescription() : " - ") + "", }; + headerTitle +=3D constructTableLine(columnsDescription); =20 - String [] columnsAdressOne =3D {boldItalicBegin + _("lima-business.d= ocument.adress") + boldItalicEnd, - "" + (StringUtils.isNotEmpty(identity.getAddress()) ? ide= ntity.getAddress() : " - ") + "", }; - headerTitle +=3D constructTableLine(columnsAdressOne); + String [] columnsAdressOne =3D {boldItalicBegin + _("lima-busine= ss.document.adress") + boldItalicEnd, + "" + (StringUtils.isNotEmpty(identity.getAddress()) ?= identity.getAddress() : " - ") + "", }; + headerTitle +=3D constructTableLine(columnsAdressOne); =20 - String [] columnsAdressTwo =3D {boldItalicBegin + _("lima-business.d= ocument.adresssuite") + boldItalicEnd, - "" + (StringUtils.isNotEmpty(identity.getAddress2()) ? id= entity.getAddress2() : " - ") + "", }; - headerTitle +=3D constructTableLine(columnsAdressTwo); + String [] columnsAdressTwo =3D {boldItalicBegin + _("lima-busine= ss.document.adresssuite") + boldItalicEnd, + "" + (StringUtils.isNotEmpty(identity.getAddress2()) = ? identity.getAddress2() : " - ") + "", }; + headerTitle +=3D constructTableLine(columnsAdressTwo); =20 - String [] columnsZipCode =3D {boldItalicBegin + _("lima-business.doc= ument.zipcode") + boldItalicEnd, - "" + (StringUtils.isNotEmpty(identity.getZipCode()) ? ide= ntity.getZipCode() : " - ") + "", }; - headerTitle +=3D constructTableLine(columnsZipCode); + String [] columnsZipCode =3D {boldItalicBegin + _("lima-business= .document.zipcode") + boldItalicEnd, + "" + (StringUtils.isNotEmpty(identity.getZipCode()) ?= identity.getZipCode() : " - ") + "", }; + headerTitle +=3D constructTableLine(columnsZipCode); =20 - String [] columnsCity =3D {boldItalicBegin + _("lima-business.docume= nt.city") + boldItalicEnd, - "" + (StringUtils.isNotEmpty(identity.getCity()) ? identi= ty.getCity() : " - ") + "", }; - headerTitle +=3D constructTableLine(columnsCity); + String [] columnsCity =3D {boldItalicBegin + _("lima-business.do= cument.city") + boldItalicEnd, + "" + (StringUtils.isNotEmpty(identity.getCity()) ? id= entity.getCity() : " - ") + "", }; + headerTitle +=3D constructTableLine(columnsCity); =20 - String [] columnsBusinessNumber =3D {boldItalicBegin + _("lima-busin= ess.document.businessnumber") + - boldItalicEnd, "" + (StringUtils.isNotEmpty(identity.getB= usinessNumber()) ? identity.getBusinessNumber() : " - ") + ""}; - headerTitle +=3D constructTableLine(columnsBusinessNumber); + String [] columnsBusinessNumber =3D {boldItalicBegin + _("lima-b= usiness.document.businessnumber") + + boldItalicEnd, "" + (StringUtils.isNotEmpty(identity.= getBusinessNumber()) ? identity.getBusinessNumber() : " - ") + ""}; + headerTitle +=3D constructTableLine(columnsBusinessNumber); =20 - String [] columnsClassifCode =3D {boldItalicBegin + _("lima-business= .document.classificationcode") + - boldItalicEnd, "" + (StringUtils.isNotEmpty(identity.getC= lassificationCode()) ? identity.getClassificationCode() : " - ") + ""}; - headerTitle +=3D constructTableLine(columnsClassifCode); + String [] columnsClassifCode =3D {boldItalicBegin + _("lima-busi= ness.document.classificationcode") + + boldItalicEnd, "" + (StringUtils.isNotEmpty(identity.= getClassificationCode()) ? identity.getClassificationCode() : " - ") + ""= }; + headerTitle +=3D constructTableLine(columnsClassifCode); =20 - String [] columnsVatNumber =3D {boldItalicBegin + _("lima-business.d= ocument.vatnumber") + boldItalicEnd, - "" + (StringUtils.isNotEmpty(identity.getVatNumber()) ? i= dentity.getVatNumber() : " - ") + "", }; - headerTitle +=3D constructTableLine(columnsVatNumber); + String [] columnsVatNumber =3D {boldItalicBegin + _("lima-busine= ss.document.vatnumber") + boldItalicEnd, + "" + (StringUtils.isNotEmpty(identity.getVatNumber())= ? identity.getVatNumber() : " - ") + "", }; + headerTitle +=3D constructTableLine(columnsVatNumber); + } =20 String [] columnsPeriodOne =3D {boldItalicBegin + _("lima-business.d= ocument.period1") + boldItalicEnd, "" + _("lima-business.document.period1format", beginDate)+ ""}; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/Impo= rtExport.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-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExpo= rt.java 2014-02-14 14:59:24 UTC (rev 3745) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExpo= rt.java 2014-02-14 18:06:21 UTC (rev 3746) @@ -216,7 +216,7 @@ // display result dialog if (verboseMode) { String result =3D get(); - if (result.equals(null)) { + if (Strings.isNullOrEmpty(null)) { JOptionPane.showMessageDialog(viewComponent,= _("lima.ui.importexport.importerror"), _("lima.ui.importexport.importtitle"= ), JOptionPane.ERROR_MESSAGE); =20 --===============1523717558555028138==--