Author: dcosse Date: 2014-05-06 11:22:03 +0200 (Tue, 06 May 2014) New Revision: 3781 Url: http://forge.chorem.org/projects/lima/repository/revisions/3781 Log: fixes #1016 ajout des imports/export des journaux. Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2014-05-05 16:28:39 UTC (rev 3780) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2014-05-06 09:22:03 UTC (rev 3781) @@ -135,11 +135,7 @@ entryBook = financialTransaction.getEntryBook(); - if (entryBook != null) { - entrybookCode = entryBook.getCode(); - } else { - entrybookCode = ""; - } + entrybookCode = entryBook == null ? "" : entryBook.getCode(); for (Entry entry : financialTransaction.getEntry()) { account = entry.getAccount(); @@ -163,7 +159,7 @@ nextLine[0] = date; nextLine[1] = entrybookCode; nextLine[2] = accountNumber; - nextLine[3] = entry.getDescription(); + nextLine[3] = StringUtils.remove(entry.getDescription(), ","); nextLine[4] = entry.getVoucher(); nextLine[5] = debit; nextLine[6] = credit; @@ -205,6 +201,8 @@ CSVWriter.DEFAULT_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER); //export accounts + //Numero,Intitule,Type,bLetManuel,bLetAuto,bLetAppro,bCentPhysique,bCentJournal,bCentGLivre,bGeleDebit,bGeleCredit,bNoEchAna,TypeRel,Categorie,CodeTVA,TypeTVA,Lettrage,Encours,Seuil,Remise,Escompte,Devise,RIB0NomBanque,RIB0AdrBanque,RIB0Agence,RIB0Guichet,RIB0Compte,RIB0CleRIB,RIB1NomBanque,RIB1AdrBanque,RIB1Agence,RIB1Guichet,RIB1Compte,RIB1CleRIB,RIB2NomBanque,RIB2AdrBanque,RIB2Agence,RIB2Guichet,RIB2Compte,RIB2CleRIB,AdresseCivilite,AdresseRaiSoc,AdresseAdresse,AdresseCodePostal,AdresseVille,AdressePays,NII,Contact0Interloc,Contact0Fonction,Contact0TelNumTel,Contact0TelNumFax,Contact0Infos,Contact1Interloc,Contact1Fonction,Contact1TelNumTel,Contact1TelNumFax,Contact1Infos,Contact2Interloc,Contact2Fonction,Contact2TelNumTel,Contact2TelNumFax,Contact2Infos,Contact3Interloc,Contact3Fonction,Contact3TelNumTel,Contact3TelNumFax,Contact3Infos,Contact4Interloc,Contact4Fonction,Contact4TelNumTel,Contact4TelNumFax,Contact4Infos,CodeRegle,NbJours,TypeJours,Limite,Grille1,Grille2,Grille3,SectGeo,SectAct,ObjCA,TailleCA,NbEmpl,Commercial,JoursMois,CptTva,CptCharge,bDecouvertAutorise,MntDecouvertAutorise,EMailTiers,WebSiteTiers,NatAchat,NatVente,NatDepense,NatRecette,NumCptBqCH,NumClearing,NumIBAN,LetPart,TypeAchatTVA,IBAN0Pays,IBAN0Controle,IBAN0Contenu,IBAN1Pays,IBAN1Controle,IBAN1Contenu,IBAN2Pays,IBAN2Controle,IBAN2Contenu,BIC0Banque,BIC0Pays,BIC0Localisation,BIC0Branche,BIC1Banque,BIC1Pays,BIC1Localisation,BIC1Branche,BIC2Banque,BIC2Pays,BIC2Localisation,BIC2Branche,LibBIC0,LibBIC1,LibBIC2 + String[] nextLine = new String[2]; // Add the header line nextLine[0] = "Numero"; @@ -263,7 +261,7 @@ if (entryBooks != null && !entryBooks.isEmpty()) { for (EntryBook entryBook:entryBooks) { nextLine[0] = entryBook.getCode(); - nextLine[1] = entryBook.getLabel(); + nextLine[1] = StringUtils.remove(entryBook.getLabel(), ","); // Ajoute la ligne au fichier csvWriter.writeNext(nextLine); } @@ -387,11 +385,7 @@ financialStatement.getHeaderAmount()); FinancialStatement masterFinancialStatement = financialStatement.getMasterFinancialStatement(); - String masterFinancialStatementString = ""; - if (masterFinancialStatement != null) { - masterFinancialStatementString = - masterFinancialStatement.getLabel(); - } + String masterFinancialStatementString = masterFinancialStatement == null ? "" : StringUtils.remove(masterFinancialStatement.getLabel(), ";"); nextLine[9] = masterFinancialStatementString; FinancialStatementWayEnum financialStatementWayEnum = financialStatement.getWay(); String financialStatementWay = ""; @@ -522,7 +516,7 @@ for (EntryBook entryBook : listEntryBook) { nextLine[0] = ImportExportEntityEnum.ENTRYBOOK.getLabel(); nextLine[1] = entryBook.getCode(); - nextLine[2] = entryBook.getLabel(); + nextLine[2] = StringUtils.remove(entryBook.getLabel(), ";"); // Ajoute la ligne au fichier csvWriter.writeNext(nextLine); } @@ -577,7 +571,7 @@ for (Account account : listAccount) { nextLine[0] = ImportExportEntityEnum.ACCOUNT.getLabel(); nextLine[1] = account.getAccountNumber(); - nextLine[2] = account.getLabel(); + nextLine[2] = StringUtils.remove(account.getLabel(), ";"); nextLine[3] = account.getThirdParty(); // Ajoute la ligne au fichier Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2014-05-05 16:28:39 UTC (rev 3780) +++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2014-05-06 09:22:03 UTC (rev 3781) @@ -35,9 +35,9 @@ CSV_VAT_EXPORT(false, true), CSV_VAT_IMPORT(true, true), CSV_ENTRIES_IMPORT(true, true), PDF_VAT_EXPORT(false, true), PDF_VAT_IMPORT(true, true), - EBP_ACCOUNTCHARTS_EXPORT(false, true), EBP_ENTRIES_EXPORT(false, true), + EBP_ACCOUNTCHARTS_EXPORT(false, false), EBP_ENTRIES_EXPORT(false, false), EBP_ACCOUNTCHARTS_IMPORT(true, true), EBP_ENTRIES_IMPORT(true, true), - EBP_ENTRYBOOKS_IMPORT(true, true),EBP_ENTRYBOOKS_EXPORT(false, true); + EBP_ENTRYBOOKS_IMPORT(true, true),EBP_ENTRYBOOKS_EXPORT(false, false); private final Boolean importMode; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-05-05 16:28:39 UTC (rev 3780) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-05-06 09:22:03 UTC (rev 3781) @@ -312,7 +312,7 @@ chooser.setApproveButtonText(approveButtonText); } else { approveButtonText = t("lima.ui.importexport.export"); - chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setDialogTitle(approveButtonText); chooser.setApproveButtonText(approveButtonText); }