branch develop updated (9316918 -> 8b4e7bb)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git from 9316918 refs #1314 passage en java 1.8 new 328cd94 refs #1174 création de transaction pour chaque changement de date puis de pièce comptable (déplacement de branche) new 8f3fbd5 refs #1174 ajout d'une exception pour gérer le cas ou l'on essaye de supprimer un compte qui 'existe pas new 49a9e45 refs #1174 Correction sur affichage des résultats d'import dans le cas ou il n'y a pas eu d'erreur new 15ca0fe refs #1174 l'exception sur la non existance d'un compte dont la suppression est demandée ne doit pas être levé au niveau des règles métier new 2cd8ecd refs #1174 suppression de l'exception de la signature de la méthode new 45cac9a refs #1174 Rollback Changes, les résultats ne sont pas satifaisant au regard de la balance de référence new 5be94d4 refs #1174 Ne pas réencapsuler une exception Lima dans une autre new c568873 Merge branch 'feature/1174-Import_EBP_Transactions' into develop new 706f22a refs #1369 Mise à jour des intitulés pour l'import des journaux new 6edeb52 refs #1369 Ajout de la possibilité d'importer des journaux CSV et EBP new c1b90ef Merge branch 'feature/1369-demarage-initial' into develop new a55ff1b refs #686 pas de redémarrage de automatique de lima mais un dialogue demandant à l'utilisateur de redémmarrer new 8b4e7bb refs #1314 mise à jour du mavenpom The 13 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 8b4e7bbb34e21b4f8906796ede98cba67036029f Author: David Cossé <cosse@codelutin.com> Date: Fri Dec 16 16:24:34 2016 +0100 refs #1314 mise à jour du mavenpom commit a55ff1beca70f02ad63d0d446a950745e587ff1a Author: David Cossé <cosse@codelutin.com> Date: Fri Dec 16 16:21:18 2016 +0100 refs #686 pas de redémarrage de automatique de lima mais un dialogue demandant à l'utilisateur de redémmarrer commit c1b90ef2c0dc9c0683cdd05648f72be42fbc8427 Merge: c568873 6edeb52 Author: David Cossé <cosse@codelutin.com> Date: Fri Sep 23 16:18:07 2016 +0200 Merge branch 'feature/1369-demarage-initial' into develop commit 6edeb52faca651e06e013b3b9f2da3c51cdb41cf Author: David Cossé <cosse@codelutin.com> Date: Fri Sep 23 16:14:17 2016 +0200 refs #1369 Ajout de la possibilité d'importer des journaux CSV et EBP commit 706f22a8b9d5e56eceeb050c7f2f3f797d5c8c32 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 21:17:19 2016 +0200 refs #1369 Mise à jour des intitulés pour l'import des journaux commit c56887327963da702adef64eff7cba04dc17dc90 Merge: 9316918 5be94d4 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 17:16:53 2016 +0200 Merge branch 'feature/1174-Import_EBP_Transactions' into develop commit 5be94d47acfb55bc7db134811699b2a6b7a29882 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 17:16:37 2016 +0200 refs #1174 Ne pas réencapsuler une exception Lima dans une autre commit 45cac9a26f1bddfae8f8a910b2917d30628a83f6 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 15:20:44 2016 +0200 refs #1174 Rollback Changes, les résultats ne sont pas satifaisant au regard de la balance de référence commit 2cd8ecd3774bcd6cd5d7d72694e18ec1c4a29076 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 15:18:56 2016 +0200 refs #1174 suppression de l'exception de la signature de la méthode commit 15ca0fe9bfa6aebb5586680dc805e4f6a9fbf92d Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 15:16:31 2016 +0200 refs #1174 l'exception sur la non existance d'un compte dont la suppression est demandée ne doit pas être levé au niveau des règles métier commit 49a9e4543b9f0e5179c4838d225f854cb23ceaba Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 13:38:54 2016 +0200 refs #1174 Correction sur affichage des résultats d'import dans le cas ou il n'y a pas eu d'erreur commit 8f3fbd5dfa2219ed181c487786dbd780fb396f79 Author: David Cossé <cosse@codelutin.com> Date: Fri Jul 8 10:33:23 2016 +0200 refs #1174 ajout d'une exception pour gérer le cas ou l'on essaye de supprimer un compte qui 'existe pas commit 328cd94b08837a89fdbe295a80d25c4785efcff2 Author: dcosse <japbiw74> Date: Wed Feb 25 22:37:58 2015 +0100 refs #1174 création de transaction pour chaque changement de date puis de pièce comptable (déplacement de branche) Summary of changes: .../org/chorem/lima/business/ImportResult.java | 5 +- .../business/exceptions/UnexistingAccount.java | 26 ++++- .../org/chorem/lima/business/AccountingRules.java | 3 +- .../accountingrules/DefaultAccountingRules.java | 6 +- .../lima/business/ejb/AccountServiceImpl.java | 4 + .../lima/business/ejb/ImportServiceImpl.java | 23 +++-- .../resources/i18n/lima-business_en_GB.properties | 34 ++++--- .../resources/i18n/lima-business_fr_FR.properties | 51 +++++++--- .../org/chorem/lima/business/AbstractLimaTest.java | 110 ++++++++++++++++++--- .../lima/business/AccountServiceImplTest.java | 8 +- .../lima/business/EntryBookServiceImplTest.java | 6 +- .../business/FinancialPeriodServiceImplTest.java | 6 +- .../FinancialTransactionServiceImplTest.java | 6 +- .../lima/business/FiscalPeriodServiceImplTest.java | 4 +- .../lima/business/ImportExportServiceTest.java | 68 +++++++------ .../lima/business/ReportServiceImplTest.java | 8 +- .../lima/entity/FinancialTransactionDAOTest.java | 8 +- .../org/chorem/lima/enums/EntryBooksChartEnum.java | 25 ++++- .../java/org/chorem/lima/ui/MainViewHandler.java | 54 +++------- .../lima/ui/entrybook/EntryBookImportForm.css | 22 +++-- .../lima/ui/entrybook/EntryBookImportForm.jaxx | 14 ++- .../lima/ui/entrybook/EntryBookViewHandler.java | 19 +++- .../chorem/lima/ui/importexport/ImportExport.java | 6 +- .../lima/ui/opening/CreateEntryBookPanel.css | 16 ++- .../lima/ui/opening/CreateEntryBookPanel.jaxx | 20 +++- .../chorem/lima/ui/opening/OpeningViewHandler.java | 41 ++++++-- .../resources/i18n/lima-swing_en_GB.properties | 66 ++----------- .../resources/i18n/lima-swing_fr_FR.properties | 68 ++----------- pom.xml | 2 +- src/site/resources/screens/lima_open_entrybook.png | Bin 21208 -> 26349 bytes src/site/rst/assistant.rst | 3 +- src/site/rst/importexport.rst | 20 +++- 32 files changed, 442 insertions(+), 310 deletions(-) -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 328cd94b08837a89fdbe295a80d25c4785efcff2 Author: dcosse <japbiw74> Date: Wed Feb 25 22:37:58 2015 +0100 refs #1174 création de transaction pour chaque changement de date puis de pièce comptable (déplacement de branche) --- .../org/chorem/lima/business/ImportResult.java | 5 +- .../accountingrules/DefaultAccountingRules.java | 6 +- .../lima/business/ejb/AccountServiceImpl.java | 4 + .../lima/business/ejb/ImportServiceImpl.java | 93 ++++++++++++----- .../resources/i18n/lima-business_en_GB.properties | 34 ++++--- .../resources/i18n/lima-business_fr_FR.properties | 51 +++++++--- .../org/chorem/lima/business/AbstractLimaTest.java | 110 ++++++++++++++++++--- .../lima/business/AccountServiceImplTest.java | 8 +- .../lima/business/EntryBookServiceImplTest.java | 6 +- .../business/FinancialPeriodServiceImplTest.java | 6 +- .../FinancialTransactionServiceImplTest.java | 6 +- .../lima/business/FiscalPeriodServiceImplTest.java | 4 +- .../lima/business/ImportExportServiceTest.java | 88 +++++++++-------- .../lima/business/ReportServiceImplTest.java | 8 +- .../lima/entity/FinancialTransactionDAOTest.java | 8 +- .../resources/i18n/lima-swing_en_GB.properties | 3 + .../resources/i18n/lima-swing_fr_FR.properties | 3 + 17 files changed, 305 insertions(+), 138 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java b/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java index 8cec320..4d0a7b3 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java @@ -22,10 +22,10 @@ package org.chorem.lima.business; * #L% */ +import com.google.common.collect.Maps; import org.chorem.lima.business.exceptions.LimaException; import java.io.Serializable; -import java.util.HashMap; import java.util.Map; /** @@ -50,6 +50,7 @@ public class ImportResult implements Serializable{ nbUpdated = 0; nbIgnored = 0; lineIndex = 2;// line 1 s header + allExceptions = Maps.newHashMap(); this.fromSource = fromSource; } @@ -81,14 +82,12 @@ public class ImportResult implements Serializable{ } public void addException(LimaException e) { - allExceptions = allExceptions == null ? new HashMap<Integer, LimaException>() : allExceptions; allExceptions.put(this.lineIndex, e); nbIgnored++; lineIndex++; } public void addInitException(LimaException e) { - allExceptions = allExceptions == null ? new HashMap<Integer, LimaException>() : allExceptions; allExceptions.put(1, e); nbIgnored++; lineIndex++; diff --git a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java index 410bf2b..9c2fafb 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java +++ b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java @@ -41,7 +41,6 @@ import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksExce import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; import org.chorem.lima.business.exceptions.UnbalancedEntriesException; import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; -import org.chorem.lima.business.exceptions.UnexistingAccount; import org.chorem.lima.business.exceptions.UnfilledEntriesException; import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.business.exceptions.UsedEntryBookException; @@ -176,13 +175,10 @@ public class DefaultAccountingRules implements AccountingRules { * Recursive function */ @Override - public void removeAccountRules(Account account) throws UsedAccountException, UnexistingAccount { + public void removeAccountRules(Account account) throws UsedAccountException { EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); // Check if account have entries - if (!account.isPersisted()) { - throw new UnexistingAccount(account.getAccountNumber(), "Unsaved Account, this account can not be removed"); - } if (entryTopiaDao.forAccountEquals(account).exists()) { throw new UsedAccountException(account.getAccountNumber()); } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java index 63add0f..7a7cfdd 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java @@ -193,6 +193,10 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe @Override public void removeAccount(Account account) throws UsedAccountException, UnexistingAccount { + if (!account.isPersisted()) { + throw new UnexistingAccount(account.getAccountNumber(), "Unsaved Account, this account can not be removed"); + } + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); // Check rules for account if have entries diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java index 173f4e3..11feab7 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java @@ -23,6 +23,7 @@ package org.chorem.lima.business.ejb; */ import com.google.common.base.Function; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; @@ -60,7 +61,6 @@ import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatementExcepti import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException; import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.exceptions.ImportEbpException; import org.chorem.lima.business.exceptions.ImportFileException; import org.chorem.lima.business.exceptions.InvalidAccountNumberException; import org.chorem.lima.business.exceptions.LimaException; @@ -939,12 +939,14 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ // if entry date have fiscalperiod open if (dateEcr.compareTo(fiscalPeriodsBiginDate) < 0 || dateEcr.compareTo(fiscalPeriodsEndingDate) > 0) { - importResult.addException(new ImportEbpException(t("lima-business.import.entriesoutofdatesrange", dateEcr))); + importResult.addException(new ImportFileException(t("lima.import.error.entriesOutOfDatesRange", dateEcr))); + importResult.increaseIgnored(); result = false; } // if account not exist not export -> exception else if (account == null) { - importResult.addException(new ImportEbpException(t("lima-business.import.ebpmissingaccount", targetedAccount))); + importResult.addException(new ImportFileException(t("lima.import.error.invalidAccountNumber", targetedAccount))); + importResult.increaseIgnored(); result =false; } return result; @@ -984,9 +986,9 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ // the entry is validate (checking for valide FiscalPeriod and existing Account associated to it) // if valid entry // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created - Date fiscalPeriodsBiginDate = fiscalPeriods.get(0).getBeginDate(); + Date fiscalPeriodsBeginDate = fiscalPeriods.get(0).getBeginDate(); Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate(); - Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate); + Map<EntryBook, Map<Date, Set<FinancialTransaction>>> entryBookFinancialTransactionsByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBeginDate, fiscalPeriodsEndingDate); for (EntryEBP entryEBP : entryEBPs) { Date dateEcr = entryEBP.getDatEcr(); @@ -994,7 +996,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ // account loading Account account = indexedAccounts.get(entryEBP.getCompte()); - if (!validEntry(result, dateEcr, fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) { + if (!validEntry(result, dateEcr, fiscalPeriodsBeginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) { continue; } // create entry @@ -1005,7 +1007,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ try { // find financial transactions for entry period and entrybook - addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr); + addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionsByDate, dateEcr); } catch (LockedFinancialPeriodException | LockedEntryBookException | AlreadyExistEntryBookException | AfterLastFiscalPeriodException | BeforeFirstFiscalPeriodException e) { result.addException(e); @@ -1049,34 +1051,68 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ return entry; } - protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException, AlreadyExistEntryBookException, AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException { + protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, Set<FinancialTransaction>>> entryBookFinancialTransactionsByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException, AlreadyExistEntryBookException, AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException { EntryBook entryBook = getEntryBook(indexedEntryBooks, entryBookCode); - Map<Date, FinancialTransaction> financialTransactionsByDate = entryBookFinancialTransactionByDate.get(entryBook); + Map<Date, Set<FinancialTransaction>> financialTransactionsByDate = entryBookFinancialTransactionsByDate.get(entryBook); if (financialTransactionsByDate == null) { financialTransactionsByDate = new HashMap<>(); - entryBookFinancialTransactionByDate.put(entryBook, financialTransactionsByDate); + entryBookFinancialTransactionsByDate.put(entryBook, financialTransactionsByDate); } - // create transaction - FinancialTransaction financialTransaction = financialTransactionsByDate.get(dateEcr); - if (financialTransaction == null - || !(dateEcr.equals(financialTransaction - .getTransactionDate()) && entryBook + // find financial transaction for this required date and required voucher. + Set<FinancialTransaction> financialTransactionsForDate = financialTransactionsByDate.get(dateEcr); + if (financialTransactionsForDate == null) { + financialTransactionsForDate = Sets.newHashSet(); + financialTransactionsByDate.put(dateEcr, financialTransactionsForDate); + } + + String voucher = entry.getVoucher(); + + // look for an existing one + FinancialTransaction financialTransactionForDateAndVoucher = getFinancialTransactionForVoucher(financialTransactionsForDate, voucher); + + // if none exist a new one is created + if (financialTransactionForDateAndVoucher == null + || !(dateEcr.equals(financialTransactionForDateAndVoucher.getTransactionDate()) && entryBook .getCode().equals( - financialTransaction.getEntryBook() + financialTransactionForDateAndVoucher.getEntryBook() .getCode()))) { // create financial transaction - financialTransaction = financialTransactionService.createNewFinancialTransaction(); - financialTransaction.setEntryBook(entryBook); - financialTransaction.setTransactionDate(dateEcr); - financialTransaction = financialTransactionService.createFinancialTransaction(financialTransaction); - financialTransactionsByDate.put(financialTransaction.getTransactionDate(), financialTransaction); + financialTransactionForDateAndVoucher = financialTransactionService.createNewFinancialTransaction(); + financialTransactionForDateAndVoucher.setEntryBook(entryBook); + financialTransactionForDateAndVoucher.setTransactionDate(dateEcr); + financialTransactionForDateAndVoucher = financialTransactionService.createFinancialTransaction(financialTransactionForDateAndVoucher); + financialTransactionsForDate.add(financialTransactionForDateAndVoucher); } - financialTransaction.addEntry(entry); + + // add entry to financial transaction + financialTransactionForDateAndVoucher.addEntry(entry); financialTransactionService.createEntry(entry); } + private FinancialTransaction getFinancialTransactionForVoucher(Set<FinancialTransaction> financialTransactions, String voucher) { + FinancialTransaction financialTransactionForEntry = null; + if (financialTransactions != null) { + for (FinancialTransaction financialTransaction : financialTransactions) { + Collection<Entry> entries = financialTransaction.getEntry(); + if (entries != null && entries.iterator().hasNext()) { + Entry firstEntry = entries.iterator().next(); + if (firstEntry.getVoucher().contentEquals(voucher)) { + financialTransactionForEntry = financialTransaction; + break; + } + } else { + entries = Lists.newArrayList(); + financialTransaction.setEntry(entries); + financialTransactionForEntry = financialTransaction; + break; + } + } + } + return financialTransactionForEntry; + } + protected EntryBook getEntryBook(Map<String, EntryBook> indexedEntryBooks, String entryBookCode) throws AlreadyExistEntryBookException { EntryBook entryBook; // entryBook loading @@ -1094,19 +1130,24 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ return entryBook; } - protected Map<EntryBook, Map<Date, FinancialTransaction>> getEntryBookFinancialTransactionOrderedByDate(Date fiscalPeriodsBiginDate, Date fiscalPeriodsEndingDate) { - Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = new HashMap<>(); + protected Map<EntryBook, Map<Date, Set<FinancialTransaction>>> getEntryBookFinancialTransactionOrderedByDate(Date fiscalPeriodsBiginDate, Date fiscalPeriodsEndingDate) { + Map<EntryBook, Map<Date, Set<FinancialTransaction>>> entryBookFinancialTransactionByDate = new HashMap<>(); List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate); for (FinancialTransaction ft : financialTransactions) { EntryBook eb = ft.getEntryBook(); - Map<Date, FinancialTransaction> entryBooksFTs = entryBookFinancialTransactionByDate.get(eb); + Map<Date, Set<FinancialTransaction>> entryBooksFTs = entryBookFinancialTransactionByDate.get(eb); if (entryBooksFTs == null) { entryBooksFTs = new HashMap<>(); entryBookFinancialTransactionByDate.put(eb, entryBooksFTs); } // maybe not unique financial transaction for one date. // is there a way to know wich one to take ? - entryBooksFTs.put(ft.getTransactionDate(), ft); + Set<FinancialTransaction> financialTransactionsForEntryBook = entryBooksFTs.get(ft.getTransactionDate()); + if (financialTransactionsForEntryBook == null) { + financialTransactionsForEntryBook = Sets.newHashSet(); + } + financialTransactionsForEntryBook.add(ft); + entryBooksFTs.put(ft.getTransactionDate(), financialTransactionsForEntryBook); } return entryBookFinancialTransactionByDate; } diff --git a/lima-business/src/main/resources/i18n/lima-business_en_GB.properties b/lima-business/src/main/resources/i18n/lima-business_en_GB.properties index 89e4c1a..62a13bd 100644 --- a/lima-business/src/main/resources/i18n/lima-business_en_GB.properties +++ b/lima-business/src/main/resources/i18n/lima-business_en_GB.properties @@ -134,24 +134,32 @@ lima.config.scale.label= lima.config.serveraddress.description=Server Address lima.config.thousandSeparator.description= lima.config.thousandSeparator.label= -lima.configFileName.description=Descriontion -lima.financialtransaction.account=Account -lima.fiscalperiod.fiscalperiod=Fiscal period +lima.configFileName.description= +lima.financialtransaction.account= +lima.fiscalperiod.fiscalperiod= lima.host.address.description= lima.host.ejb.port.description= lima.host.http.address.description= lima.host.http.port.description= -lima.importexport.import.alreadyExistFinancialStatement=Same financial statement exists -lima.lettering.accountRegularization=Regulatory account +lima.import.error.entriesOutOfDatesRange= +lima.import.error.invalidAccountNumber= +lima.importexport.import.alreadyExistFinancialStatement= +lima.lettering.accountRegularization= lima.report.fromDateToDate= lima.reports.account.noAccount=Any account present lima.reports.account.noAccountTitle=Any account present -lima.reports.accounts=Accounts -lima.table.credit=Credit -lima.table.date=Date -lima.table.debit=Debit -lima.table.description=Description +lima.reports.account.noaccount= +lima.reports.account.noaccounttitle= +lima.reports.accounts= +lima.services.application.version= +lima.table.credit= +lima.table.date= +lima.table.debit= +lima.table.decription= +lima.table.description= lima.table.entryBook=Entry book -lima.table.letter=Letter -lima.table.number=Account number -lima.table.voucher=Voucher +lima.table.entrybook= +lima.table.letter= +lima.table.number= +lima.table.voucher= +llima.importexport.import.alreadyExistFinancialStatement= diff --git a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties index 17c85be..6496672 100644 --- a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties +++ b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties @@ -100,6 +100,24 @@ lima-business.import.ebpmissingaccount=Échec \: Compte %s inexistant. \nCréer lima-business.import.entries.error.lockedEntryBook= lima-business.import.entries.error.lockedFinancialPeriod= lima-business.import.entriesoutofdatesrange=Attention \: Cette entrée %s ne fait partie d'aucune période ouverte. Entrée non importée. +lima-business.import.entryadded=Succès \: Entrée %s %s ajoutée \n +lima-business.import.entrybookalreadyexist=Échec \: Le journal %s exist déjà \!\n +lima-business.import.entrybooknotexist=Attention \: Le journal %s inexistant a été créé \!\n +lima-business.import.financialstatementadded=Succès \: Mouvement %s ajoutée \n +lima-business.import.financialstatementalnomaster=u00C9chec \: Le mouvement %s possède le master \: %s inexistant \n +lima-business.import.financialstatementalreadyexist=u00C9chec \: Le mouvement %s exist déjà \!\n +lima-business.import.fiscalperiodadded=Succès \: Exercice %s - %s ajoutée \! \n +lima-business.import.fiscalperiodalreadyexist=u00C9chec \: L'exerice %s - %s existe déjà \!\n +lima-business.import.fiscalperiodscloseperiodicentrybooks= +lima-business.import.identityadded=Succès \: Identité %s ajoutée \! \n +lima-business.import.lineformatmismatch=Le format de la ligne est incorrect. +lima-business.import.noaccount=Erreur \: Ce fichier ne contient aucun compte. +lima-business.import.nofiscalperiodopen=u00C9chec \: Aucun exercice ouvert \! \n +lima-business.import.transactionadded=Succès \: Transaction, %s, %s, ajoutée\n +lima-business.import.vatstatementadded=Succès \: Plan de TVA %s ajoutée \n +lima-business.import.vatstatementalnomaster=u00C9chec \: Le plan %s possède le master \: %s inexsitant \n +lima-business.import.vatstatementalreadyexist=u00C9chec \: Le plan %s exist déjà \!\n +lima.account.error.invalidAccountNumber= lima.config.configFileName.description=Nom du fichier de configuration de Lima lima.config.currency.description= lima.config.currency.label= @@ -138,21 +156,30 @@ lima.config.scale.label= lima.config.thousandSeparator.description= lima.config.thousandSeparator.label= lima.configFileName.description= -lima.financialtransaction.account=compte -lima.fiscalperiod.fiscalperiod=Période fiscale +lima.financialtransaction.account= +lima.fiscalperiod.fiscalperiod= lima.host.address.description=Addresse serveur lima.host.ejb.port.description=Port pour connexion du client au serveur lima.host.http.address.description= lima.host.http.port.description=Port du serveur web de Lima -lima.importexport.import.alreadyExistFinancialStatement=Transaction financière exitante -lima.lettering.accountRegularization=Compte de régulation +lima.import.error.entriesOutOfDatesRange= +lima.import.error.invalidAccountNumber= +lima.importexport.import.alreadyExistFinancialStatement= +lima.lettering.accountRegularization= lima.reports.account.noAccount=Aucun compte présent -lima.reports.accounts=Comptes -lima.table.credit=Credit -lima.table.date=Date -lima.table.debit=Débit -lima.table.description=Description +lima.reports.account.noaccount= +lima.reports.account.noaccounttitle= +lima.reports.accounts= +lima.services.application.version= +lima.table.credit= +lima.table.date= +lima.table.debit= +lima.table.decription= +lima.table.description= lima.table.entryBook=Journal -lima.table.letter=Lettre -lima.table.number=Numéro de compte -lima.table.voucher=Pièce comptable +lima.table.entrybook= +lima.table.letter= +lima.table.number= +lima.table.voucher= +lima.ui.importexport.import.exceptions.reason=Reason\:% +llima.importexport.import.alreadyExistFinancialStatement= diff --git a/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java b/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java index bbfeb59..118646d 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java @@ -38,10 +38,6 @@ import org.chorem.lima.business.api.IdentityService; import org.chorem.lima.business.api.ImportService; import org.chorem.lima.business.api.ReportService; import org.chorem.lima.business.api.VatStatementService; -import org.chorem.lima.business.exceptions.AlreadyExistAccountException; -import org.chorem.lima.business.exceptions.InvalidAccountNumberException; -import org.chorem.lima.business.exceptions.NotAllowedLabelException; -import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; import org.chorem.lima.entity.Entry; @@ -205,7 +201,7 @@ public abstract class AbstractLimaTest { * @throws org.chorem.lima.business.exceptions.InvalidAccountNumberException * @throws org.chorem.lima.business.exceptions.NotNumberAccountNumberException */ - protected void createAccounts() throws AlreadyExistAccountException, NotAllowedLabelException, InvalidAccountNumberException, NotNumberAccountNumberException { + protected void initTestWithAccounts() throws Exception { // creation d'un plan compatble de test Account classFinancier = new AccountImpl(); @@ -250,7 +246,7 @@ public abstract class AbstractLimaTest { * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ - protected void createEntryBooks() throws Exception { + protected void initTestWithEntryBooks() throws Exception { // creation d'un journal EntryBook journalDesVentes = new EntryBookImpl(); journalDesVentes.setLabel("Journal des ventes"); @@ -275,8 +271,7 @@ public abstract class AbstractLimaTest { * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ - protected void createFiscalPeriod() throws Exception { - + protected void initTestWithFiscalPeriod() throws Exception { // creation d'un exercice fiscal FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); fiscalPeriod.setBeginDate(df.parse("January 1, 2012")); @@ -288,15 +283,100 @@ public abstract class AbstractLimaTest { * Create FinancialTransaction with 2 entries * @throws Exception */ - protected void createFinancialTransaction() throws Exception { + protected void initTestWithFinancialTransaction() throws Exception { + + Account accountVmpVae = accountService.getAccountByNumber("511"); + EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); + + FinancialTransaction transaction1 = new FinancialTransactionImpl(); + transaction1.setTransactionDate(df.parse("April 4, 2012")); + transaction1.setEntryBook(journalDesVentes); + transaction1 = financialTransactionService.createFinancialTransaction(transaction1); + + Entry tr1Entry1 = new EntryImpl(); + tr1Entry1.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry1.setAccount(accountVmpVae); + tr1Entry1.setFinancialTransaction(transaction1); + tr1Entry1.setDescription("test desc"); + tr1Entry1.setVoucher("voucher"); + tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); + + Entry tr1Entry2 = new EntryImpl(); + tr1Entry2.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry2.setDebit(true); + tr1Entry2.setAccount(accountVmpVae); + tr1Entry2.setFinancialTransaction(transaction1); + tr1Entry2.setDescription("test desc"); + tr1Entry2.setVoucher("voucher"); + tr1Entry2 = financialTransactionService.createEntry(tr1Entry2); + + transaction1.setEntry(Lists.newArrayList(tr1Entry1, tr1Entry2)); + financialTransactionService.updateFinancialTransaction(transaction1); + } - createFinancialTransaction("jdv", df.parse("April 4, 2012"), "511", "501", BigDecimal.valueOf(42.0)); + + protected void initTestWithSomeFinancialTransaction() throws Exception { + + Account accountVmpVae = accountService.getAccountByNumber("511"); + EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); + + FinancialTransaction transaction1 = new FinancialTransactionImpl(); + transaction1.setTransactionDate(df.parse("April 4, 2012")); + transaction1.setEntryBook(journalDesVentes); + transaction1 = financialTransactionService.createFinancialTransaction(transaction1); + + Entry tr1Entry1 = new EntryImpl(); + tr1Entry1.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry1.setAccount(accountVmpVae); + tr1Entry1.setFinancialTransaction(transaction1); + tr1Entry1.setDescription("test desc"); + tr1Entry1.setVoucher("voucherA"); + tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); + + Entry tr1Entry2 = new EntryImpl(); + tr1Entry2.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry2.setDebit(true); + tr1Entry2.setAccount(accountVmpVae); + tr1Entry2.setFinancialTransaction(transaction1); + tr1Entry2.setDescription("test desc"); + tr1Entry2.setVoucher("voucherA"); + tr1Entry2 = financialTransactionService.createEntry(tr1Entry2); + + transaction1.setEntry(Lists.newArrayList(tr1Entry1, tr1Entry2)); + financialTransactionService.updateFinancialTransaction(transaction1); + + FinancialTransaction transaction2 = new FinancialTransactionImpl(); + transaction2.setTransactionDate(df.parse("April 4, 2012")); + transaction2.setEntryBook(journalDesVentes); + transaction2 = financialTransactionService.createFinancialTransaction(transaction2); + + Entry tr1Entry1b = new EntryImpl(); + tr1Entry1b.setAmount(BigDecimal.valueOf(12.0)); + tr1Entry1b.setAccount(accountVmpVae); + tr1Entry1b.setFinancialTransaction(transaction2); + tr1Entry1b.setDescription("test desc"); + tr1Entry1b.setVoucher("voucherB"); + financialTransactionService.createEntry(tr1Entry1b); + + Entry tr1Entry2b = new EntryImpl(); + tr1Entry2b.setAmount(BigDecimal.valueOf(6.0)); + tr1Entry2b.setDebit(true); + tr1Entry2b.setAccount(accountVmpVae); + tr1Entry2b.setFinancialTransaction(transaction2); + tr1Entry2b.setDescription("test desc"); + tr1Entry2b.setVoucher("voucherB"); + financialTransactionService.createEntry(tr1Entry2b); + + Entry tr1Entry3b = new EntryImpl(); + tr1Entry3b.setAmount(BigDecimal.valueOf(6.0)); + tr1Entry3b.setDebit(true); + tr1Entry3b.setAccount(accountVmpVae); + tr1Entry3b.setFinancialTransaction(transaction2); + tr1Entry3b.setDescription("test desc"); + tr1Entry3b.setVoucher("voucherB"); + financialTransactionService.createEntry(tr1Entry3b); } - /** - * Create FinancialTransaction with 2 entries - * @throws Exception - */ protected FinancialTransaction createFinancialTransaction(String entryBookCode, Date date, String accountDebitNumber, String accountCreditNumber, BigDecimal amount) throws Exception { @@ -333,4 +413,4 @@ public abstract class AbstractLimaTest { return transaction; } -} +} \ No newline at end of file diff --git a/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java b/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java index 26df6ff..cb02753 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java @@ -52,7 +52,7 @@ public class AccountServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - createAccounts(); + initTestWithAccounts(); } @Test @@ -362,9 +362,9 @@ public class AccountServiceImplTest extends AbstractLimaTest { */ @Test(expected = UsedAccountException.class) public void removeUsedAccountTest() throws Exception { - createEntryBooks(); - createFiscalPeriod(); - createFinancialTransaction(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); + initTestWithFinancialTransaction(); Account account = accountService.getAccountByNumber("511"); accountService.removeAccount(account); } diff --git a/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java b/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java index 8455e99..56b768f 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java @@ -48,7 +48,7 @@ public class EntryBookServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - createEntryBooks(); + initTestWithEntryBooks(); } @Test @@ -175,8 +175,8 @@ public class EntryBookServiceImplTest extends AbstractLimaTest { */ @Test(expected=UsedEntryBookException.class) public void deleteUsedEntryBook() throws Exception { - createFiscalPeriod(); - createFinancialTransaction(); + initTestWithFiscalPeriod(); + initTestWithFinancialTransaction(); EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); entryBookService.removeEntryBook(entryBook); diff --git a/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java b/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java index 5da0a81..8dbc49c 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java @@ -58,9 +58,9 @@ public class FinancialPeriodServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); } @Test diff --git a/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java b/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java index 0ebf319..e4a9e16 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java @@ -63,9 +63,9 @@ public class FinancialTransactionServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); } @Test diff --git a/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java b/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java index 08168f9..8f5f9ed 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java @@ -72,8 +72,8 @@ public class FiscalPeriodServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - createAccounts(); - createEntryBooks(); + initTestWithAccounts(); + initTestWithEntryBooks(); } @Test diff --git a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java index 4e147a7..dbaf7d5 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java @@ -55,6 +55,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; +import java.math.BigDecimal; import java.nio.charset.Charset; import java.text.ParseException; import java.util.ArrayList; @@ -72,9 +73,9 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportAccounts() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); // make sure they are some accounts. List<Account> accounts = accountService.getAllAccounts(); Assert.assertTrue(accountService.getAllAccounts().size() > 0); @@ -105,7 +106,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { // make sure all account have been created Assert.assertEquals(nbEntities, accountService.getAllAccounts().size()); Assert.assertEquals(nbEntities, result.getImportResults().get(0).getNbCreated()); - Assert.assertNull(result.getImportResults().get(0).getAllExceptionsByLine()); + Assert.assertTrue(result.getImportResults().get(0).getAllExceptionsByLine().isEmpty()); } finally { IOUtils.closeQuietly(contentStream); } @@ -117,7 +118,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { ImportExportResults result = importService.importAccountAsCSV(inportStream); Assert.assertNotNull(result); Map<Integer, LimaException> exceptionMap = result.getImportResults().get(0).getAllExceptionsByLine(); - Assert.assertNotNull(exceptionMap); + Assert.assertTrue(!exceptionMap.isEmpty()); Collection<LimaException> exceptions = exceptionMap.values(); Assert.assertEquals(1, exceptions.size()); ImportFileException exception = (ImportFileException) exceptions.iterator().next(); @@ -126,8 +127,8 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportEntryBooks() throws Exception { - createAccounts(); - createEntryBooks(); + initTestWithAccounts(); + initTestWithEntryBooks(); String tmpDir = System.getProperty("java.io.tmpdir")+"/"; ImportExportResults export = exportService.exportEntryBooksAsCSV(Charset.defaultCharset().name()); @@ -157,15 +158,15 @@ public class ImportExportServiceTest extends AbstractLimaTest { Assert.assertEquals(nbEntities, entryBookService.getAllEntryBooks().size()); Assert.assertEquals(nbEntities, result.getNbCreated()); - Assert.assertNull(result.getAllExceptionsByLine()); + Assert.assertTrue(result.getAllExceptionsByLine().isEmpty()); } @Test public void testExportImportEntries() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); - createFinancialTransaction(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); + initTestWithFinancialTransaction(); List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012")); List<Entry> entries = Lists.newArrayList(); @@ -214,14 +215,14 @@ public class ImportExportServiceTest extends AbstractLimaTest { Assert.assertEquals(nbEntities, entries.size()); Assert.assertEquals(nbEntities, result.getNbCreated()); - Assert.assertNull(result.getAllExceptionsByLine()); + Assert.assertTrue(result.getAllExceptionsByLine().isEmpty()); } @Test public void testExportImportFiscalPeriodsAsCSV() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); String tmpDir = System.getProperty("java.io.tmpdir")+"/"; String export = exportService.exportFiscalPeriodsAsCSV(Charset.defaultCharset().name()).getExportResults().get(0).getExportData(); @@ -249,15 +250,15 @@ public class ImportExportServiceTest extends AbstractLimaTest { Assert.assertEquals(nbFiscalPeriods, fiscalPeriodService.getAllFiscalPeriods().size()); Assert.assertEquals(nbFiscalPeriods, result.getNbCreated()); - Assert.assertNull(result.getAllExceptionsByLine()); + Assert.assertTrue(result.getAllExceptionsByLine().isEmpty()); } @Test public void exportImportAllAsCSVTest() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); - createFinancialTransaction(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); + initTestWithFinancialTransaction(); Identity identity = new IdentityImpl(); identity.setName("Code Lutin"); @@ -284,7 +285,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { ImportResult importResult = importResults.get(i); log.info(imported[i] +": created:"+importResult.getNbCreated() + " updated:" + importResult.getNbUpdated() + " ignoded:" + importResult.getNbIgnored()); Assert.assertTrue(importResult.getNbCreated()>0); - Assert.assertNull(importResult.getAllExceptionsByLine()); + Assert.assertTrue(importResult.getAllExceptionsByLine().isEmpty()); } } @@ -444,7 +445,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { result = importService.importFinancialStatementsAsCSV(bcr_developed).getImportResults().get(0); - Assert.assertNull(result.getAllExceptionsByLine()); + Assert.assertTrue(result.getAllExceptionsByLine().isEmpty()); Assert.assertEquals(162, result.getNbCreated()); Assert.assertEquals(162, financialStatementService.getAllFinancialStatements().size()); FinancialStatement actifImmobiliseStatement = financialStatementService.getFinancialStatementByLabel("ACTIF IMMOBILISÉ"); @@ -465,7 +466,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { result = importService.importVATStatementsAsCSV(bcr_developed).getImportResults().get(0); - Assert.assertNull(result.getAllExceptionsByLine()); + Assert.assertTrue(result.getAllExceptionsByLine().isEmpty()); Assert.assertEquals(55, result.getNbCreated()); Assert.assertEquals(55, vatStatementService.getAllVatStatements().size()); } @@ -506,7 +507,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { InputStream entriesStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/ecritures.txt"); String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1"); ImportResult result = importService.importEntriesFromEbp(entriesData).getImportResults().get(0); - Assert.assertNull(result.getAllExceptionsByLine()); + Assert.assertTrue(result.getAllExceptionsByLine().isEmpty()); Assert.assertEquals(28, result.getNbCreated()); entriesStream.close(); @@ -552,10 +553,10 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportEntriesEbp() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); - createFinancialTransaction(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); + initTestWithSomeFinancialTransaction(); List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012")); List<Entry> entries = Lists.newArrayList(); @@ -564,7 +565,6 @@ public class ImportExportServiceTest extends AbstractLimaTest { entries.addAll(financialTransaction.getEntry()); } Assert.assertTrue(!entries.isEmpty()); - int nbEntities = entries.size(); //test export String tmpDir = System.getProperty("java.io.tmpdir")+"/"; @@ -590,27 +590,33 @@ public class ImportExportServiceTest extends AbstractLimaTest { // test import FileInputStream contentStream = null; - ImportResult result; try { contentStream = new FileInputStream(tmpDir + "export-entries-EBP.csv"); String inputStream = IOUtils.toString(contentStream); - result = importService.importEntriesFromEbp(inputStream).getImportResults().get(0); + importService.importEntriesFromEbp(inputStream).getImportResults().get(0); } finally { IOUtils.closeQuietly(contentStream); } // valid import financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012")); - Assert.assertEquals(1, financialTransactions.size()); + Assert.assertEquals(2, financialTransactions.size()); for (FinancialTransaction financialTransaction : financialTransactions) { - entries.addAll(financialTransaction.getEntry()); - } - - Assert.assertEquals(nbEntities, entries.size()); - Assert.assertEquals(nbEntities, result.getNbCreated()); - Assert.assertNull(result.getAllExceptionsByLine()); - for (Entry entry : entries) { - Assert.assertTrue(42.0 == entry.getAmount().doubleValue()); + if (financialTransaction.getAmountDebit().compareTo(BigDecimal.valueOf(42.0)) == 0) { + Collection<Entry> voucherAEntries = financialTransaction.getEntry(); + Assert.assertEquals(2L, voucherAEntries.size()); + for (Entry entry : voucherAEntries) { + Assert.assertTrue(entry.getVoucher().contentEquals("voucherA")); + } + } else if (financialTransaction.getAmountDebit().compareTo(BigDecimal.valueOf(12.0)) == 0) { + Collection<Entry> voucherBEntries = financialTransaction.getEntry(); + Assert.assertEquals(3L, voucherBEntries.size()); + for (Entry entry : voucherBEntries) { + Assert.assertTrue(entry.getVoucher().contentEquals("voucherB")); + } + } else { + Assert.fail("Fail to import financial transactions"); + } } } diff --git a/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java b/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java index 6851851..a3e05e0 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java @@ -48,10 +48,10 @@ public class ReportServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); - createFinancialTransaction(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); + initTestWithFinancialTransaction(); } /** diff --git a/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java b/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java index 1ea0b63..a5dba3f 100644 --- a/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java +++ b/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java @@ -54,10 +54,10 @@ public class FinancialTransactionDAOTest extends AbstractLimaTest { @Test public void testFindAllUnbalancedTransactions() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); - createFinancialTransaction(); + initTestWithAccounts(); + initTestWithEntryBooks(); + initTestWithFiscalPeriod(); + initTestWithFinancialTransaction(); FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties index 9022472..363fe27 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties @@ -428,7 +428,10 @@ lima.identity.phoneNumber=Phone number lima.identity.vatNumber=VAT number lima.identity.zipCode=Zip code lima.import.error=Import Failed +lima.import.error.andMoreErrors=And %d more errors +lima.import.error.entriesOutOfDatesRange=Open fiscal period lima.import.error.extractFile=Invalid file +lima.import.error.invalidAccountNumber=None existing account with number '%' lima.import.error.noDataToImport=Any data to import lima.import.error.unknown=Unknown error lima.import.line=line diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index 541d2e3..5d8f7dd 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -439,7 +439,10 @@ lima.identity.phoneNumber=n° Tel lima.identity.vatNumber=Numéro TVA\: FR lima.identity.zipCode=Code Postal lima.import.error=Une erreur est survenue lors de l'import +lima.import.error.andMoreErrors=Et %d autres erreurs... +lima.import.error.entriesOutOfDatesRange=Periode fiscale non authorisé lima.import.error.extractFile=Le fichier n'est correct +lima.import.error.invalidAccountNumber=Le compte '%s' n'existe pas. lima.import.error.noDataToImport=Aucune donnée à importer. lima.import.error.unknown=Erreur inconnue. lima.import.line=Ligne %d\: -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 8f3fbd5dfa2219ed181c487786dbd780fb396f79 Author: David Cossé <cosse@codelutin.com> Date: Fri Jul 8 10:33:23 2016 +0200 refs #1174 ajout d'une exception pour gérer le cas ou l'on essaye de supprimer un compte qui 'existe pas --- .../business/exceptions/UnexistingAccount.java | 26 +++++++++++++++++++++- .../accountingrules/DefaultAccountingRules.java | 6 ++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnexistingAccount.java b/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnexistingAccount.java index f8c7528..34bc826 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnexistingAccount.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnexistingAccount.java @@ -1,10 +1,34 @@ package org.chorem.lima.business.exceptions; +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + /** - * Created by davidcosse on 08/07/16. + * @author David Cossé */ public class UnexistingAccount extends AccountException { + private static final long serialVersionUID = 1L; + public UnexistingAccount(String accountNumber, String message) { super(accountNumber, message); } diff --git a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java index 9c2fafb..182b557 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java +++ b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java @@ -39,6 +39,7 @@ import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.UnexistingAccount; import org.chorem.lima.business.exceptions.UnbalancedEntriesException; import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; import org.chorem.lima.business.exceptions.UnfilledEntriesException; @@ -175,10 +176,13 @@ public class DefaultAccountingRules implements AccountingRules { * Recursive function */ @Override - public void removeAccountRules(Account account) throws UsedAccountException { + public void removeAccountRules(Account account) throws UsedAccountException, UnexistingAccount { EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); // Check if account have entries + if (!account.isPersisted()) { + throw new UnexistingAccount(account.getAccountNumber(), "Unsaved Account, this account can not be removed"); + } if (entryTopiaDao.forAccountEquals(account).exists()) { throw new UsedAccountException(account.getAccountNumber()); } -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 49a9e4543b9f0e5179c4838d225f854cb23ceaba Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 13:38:54 2016 +0200 refs #1174 Correction sur affichage des résultats d'import dans le cas ou il n'y a pas eu d'erreur --- .../test/java/org/chorem/lima/business/ImportExportServiceTest.java | 3 ++- .../src/main/java/org/chorem/lima/ui/importexport/ImportExport.java | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java index dbaf7d5..e4e6a4d 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java @@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils; import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.ImportEbpException; import org.chorem.lima.business.exceptions.ImportFileException; import org.chorem.lima.business.exceptions.LimaException; import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; @@ -621,7 +622,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { } protected void importEBPData() throws IOException, ParseException, BeginAfterEndFiscalPeriodException, - NotBeginNextDayOfLastFiscalPeriodException, MoreOneUnlockFiscalPeriodException { + NotBeginNextDayOfLastFiscalPeriodException, MoreOneUnlockFiscalPeriodException, ImportEbpException { // create fiscal period (mandatory for import) FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java index 970d1b1..6ee3c74 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java @@ -395,7 +395,7 @@ public class ImportExport { Class fromSource = result.getFromSource(); message.append("Import "); message.append(getFromSourceMessage(fromSource)); - message.append(result.getAllExceptionsByLine().size() > 0 ? "Des erreurs sont survenues lors de l'import, veuillez regarder le fichier de log pour plus de détails.\n" : "Aucune erreur rencontrée\n"); + message.append(result.getAllExceptionsByLine().isEmpty() ? "Aucune erreur rencontrée\n" : "Des erreurs sont survenues lors de l'import, veuillez regarder le fichier de log pour plus de détails.\n"); message.append(t("lima.import.report", result.getNbCreated(), result.getNbIgnored(), result.getNbUpdated())); logErrorMessage(result, fromSource); @@ -420,7 +420,7 @@ public class ImportExport { protected void logErrorMessage(ImportResult result,Class fromSource) { Map<Integer, LimaException> exceptionsByLine = result.getAllExceptionsByLine(); - if (exceptionsByLine != null) { + if (!exceptionsByLine.isEmpty()) { StringBuilder errorMessage = new StringBuilder(); errorMessage.append("\n" + "Import " + getFromSourceMessage(fromSource)); errorMessage.append("\n" + t("lima.import.report", result.getNbCreated(), result.getNbIgnored(), result.getNbUpdated())); @@ -701,7 +701,7 @@ public class ImportExport { protected ImportExportResults processBackup(ImportResult result, String tmpDir, String determinant) { ImportExportResults results = null; InputStream entryBooksStream = null, transactionsStream = null, fiscalPeriodsStream = null, accountsStream = null, entriesStream = null, identityStream = null; - if (result.getAllExceptionsByLine() == null || result.getAllExceptionsByLine().isEmpty()) { + if (result.getAllExceptionsByLine().isEmpty()) { try { entryBooksStream = new FileInputStream(tmpDir + EntryBook.class.getSimpleName() + "-" + determinant + ".csv"); String entryBooksStreamString = IOUtils.toString(entryBooksStream); -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 15ca0fe9bfa6aebb5586680dc805e4f6a9fbf92d Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 15:16:31 2016 +0200 refs #1174 l'exception sur la non existance d'un compte dont la suppression est demandée ne doit pas être levé au niveau des règles métier --- .../chorem/lima/business/accountingrules/DefaultAccountingRules.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java index 182b557..dca2f1d 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java +++ b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java @@ -180,9 +180,6 @@ public class DefaultAccountingRules implements AccountingRules { EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); // Check if account have entries - if (!account.isPersisted()) { - throw new UnexistingAccount(account.getAccountNumber(), "Unsaved Account, this account can not be removed"); - } if (entryTopiaDao.forAccountEquals(account).exists()) { throw new UsedAccountException(account.getAccountNumber()); } -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 2cd8ecd3774bcd6cd5d7d72694e18ec1c4a29076 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 15:18:56 2016 +0200 refs #1174 suppression de l'exception de la signature de la méthode --- .../src/main/java/org/chorem/lima/business/AccountingRules.java | 3 +-- .../chorem/lima/business/accountingrules/DefaultAccountingRules.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java b/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java index 93cb419..a319a22 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java +++ b/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java @@ -36,7 +36,6 @@ import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksExce import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; import org.chorem.lima.business.exceptions.UnbalancedEntriesException; import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; -import org.chorem.lima.business.exceptions.UnexistingAccount; import org.chorem.lima.business.exceptions.UnfilledEntriesException; import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.business.exceptions.UsedEntryBookException; @@ -68,7 +67,7 @@ public interface AccountingRules { void updateAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException; - void removeAccountRules(Account account) throws UsedAccountException, UnexistingAccount; + void removeAccountRules(Account account) throws UsedAccountException; /** * Entrybook rules. diff --git a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java index dca2f1d..9c2fafb 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java +++ b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java @@ -39,7 +39,6 @@ import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; -import org.chorem.lima.business.exceptions.UnexistingAccount; import org.chorem.lima.business.exceptions.UnbalancedEntriesException; import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; import org.chorem.lima.business.exceptions.UnfilledEntriesException; @@ -176,7 +175,7 @@ public class DefaultAccountingRules implements AccountingRules { * Recursive function */ @Override - public void removeAccountRules(Account account) throws UsedAccountException, UnexistingAccount { + public void removeAccountRules(Account account) throws UsedAccountException { EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); // Check if account have entries -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 45cac9a26f1bddfae8f8a910b2917d30628a83f6 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 15:20:44 2016 +0200 refs #1174 Rollback Changes, les résultats ne sont pas satifaisant au regard de la balance de référence --- .../lima/business/ejb/ImportServiceImpl.java | 84 ++++++---------------- .../lima/business/ImportExportServiceTest.java | 25 +++---- 2 files changed, 30 insertions(+), 79 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java index 11feab7..11a23d1 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java @@ -23,7 +23,6 @@ package org.chorem.lima.business.ejb; */ import com.google.common.base.Function; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; @@ -988,7 +987,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created Date fiscalPeriodsBeginDate = fiscalPeriods.get(0).getBeginDate(); Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate(); - Map<EntryBook, Map<Date, Set<FinancialTransaction>>> entryBookFinancialTransactionsByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBeginDate, fiscalPeriodsEndingDate); + Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBeginDate, fiscalPeriodsEndingDate); for (EntryEBP entryEBP : entryEBPs) { Date dateEcr = entryEBP.getDatEcr(); @@ -1007,7 +1006,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ try { // find financial transactions for entry period and entrybook - addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionsByDate, dateEcr); + addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr); } catch (LockedFinancialPeriodException | LockedEntryBookException | AlreadyExistEntryBookException | AfterLastFiscalPeriodException | BeforeFirstFiscalPeriodException e) { result.addException(e); @@ -1051,68 +1050,34 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ return entry; } - protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, Set<FinancialTransaction>>> entryBookFinancialTransactionsByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException, AlreadyExistEntryBookException, AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException { + protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException, AlreadyExistEntryBookException, AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException { EntryBook entryBook = getEntryBook(indexedEntryBooks, entryBookCode); - Map<Date, Set<FinancialTransaction>> financialTransactionsByDate = entryBookFinancialTransactionsByDate.get(entryBook); + Map<Date, FinancialTransaction> financialTransactionsByDate = entryBookFinancialTransactionByDate.get(entryBook); if (financialTransactionsByDate == null) { financialTransactionsByDate = new HashMap<>(); - entryBookFinancialTransactionsByDate.put(entryBook, financialTransactionsByDate); + entryBookFinancialTransactionByDate.put(entryBook, financialTransactionsByDate); } - // find financial transaction for this required date and required voucher. - Set<FinancialTransaction> financialTransactionsForDate = financialTransactionsByDate.get(dateEcr); - if (financialTransactionsForDate == null) { - financialTransactionsForDate = Sets.newHashSet(); - financialTransactionsByDate.put(dateEcr, financialTransactionsForDate); - } - - String voucher = entry.getVoucher(); - - // look for an existing one - FinancialTransaction financialTransactionForDateAndVoucher = getFinancialTransactionForVoucher(financialTransactionsForDate, voucher); - - // if none exist a new one is created - if (financialTransactionForDateAndVoucher == null - || !(dateEcr.equals(financialTransactionForDateAndVoucher.getTransactionDate()) && entryBook + // create transaction + FinancialTransaction financialTransaction = financialTransactionsByDate.get(dateEcr); + if (financialTransaction == null + || !(dateEcr.equals(financialTransaction + .getTransactionDate()) && entryBook .getCode().equals( - financialTransactionForDateAndVoucher.getEntryBook() + financialTransaction.getEntryBook() .getCode()))) { // create financial transaction - financialTransactionForDateAndVoucher = financialTransactionService.createNewFinancialTransaction(); - financialTransactionForDateAndVoucher.setEntryBook(entryBook); - financialTransactionForDateAndVoucher.setTransactionDate(dateEcr); - financialTransactionForDateAndVoucher = financialTransactionService.createFinancialTransaction(financialTransactionForDateAndVoucher); - financialTransactionsForDate.add(financialTransactionForDateAndVoucher); + financialTransaction = financialTransactionService.createNewFinancialTransaction(); + financialTransaction.setEntryBook(entryBook); + financialTransaction.setTransactionDate(dateEcr); + financialTransaction = financialTransactionService.createFinancialTransaction(financialTransaction); + financialTransactionsByDate.put(financialTransaction.getTransactionDate(), financialTransaction); } - - // add entry to financial transaction - financialTransactionForDateAndVoucher.addEntry(entry); + financialTransaction.addEntry(entry); financialTransactionService.createEntry(entry); } - private FinancialTransaction getFinancialTransactionForVoucher(Set<FinancialTransaction> financialTransactions, String voucher) { - FinancialTransaction financialTransactionForEntry = null; - if (financialTransactions != null) { - for (FinancialTransaction financialTransaction : financialTransactions) { - Collection<Entry> entries = financialTransaction.getEntry(); - if (entries != null && entries.iterator().hasNext()) { - Entry firstEntry = entries.iterator().next(); - if (firstEntry.getVoucher().contentEquals(voucher)) { - financialTransactionForEntry = financialTransaction; - break; - } - } else { - entries = Lists.newArrayList(); - financialTransaction.setEntry(entries); - financialTransactionForEntry = financialTransaction; - break; - } - } - } - return financialTransactionForEntry; - } - protected EntryBook getEntryBook(Map<String, EntryBook> indexedEntryBooks, String entryBookCode) throws AlreadyExistEntryBookException { EntryBook entryBook; // entryBook loading @@ -1130,24 +1095,19 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ return entryBook; } - protected Map<EntryBook, Map<Date, Set<FinancialTransaction>>> getEntryBookFinancialTransactionOrderedByDate(Date fiscalPeriodsBiginDate, Date fiscalPeriodsEndingDate) { - Map<EntryBook, Map<Date, Set<FinancialTransaction>>> entryBookFinancialTransactionByDate = new HashMap<>(); - List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate); + protected Map<EntryBook, Map<Date, FinancialTransaction>> getEntryBookFinancialTransactionOrderedByDate(Date fiscalPeriodsBeginDate, Date fiscalPeriodsEndingDate) { + Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = new HashMap<>(); + List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(fiscalPeriodsBeginDate, fiscalPeriodsEndingDate); for (FinancialTransaction ft : financialTransactions) { EntryBook eb = ft.getEntryBook(); - Map<Date, Set<FinancialTransaction>> entryBooksFTs = entryBookFinancialTransactionByDate.get(eb); + Map<Date, FinancialTransaction> entryBooksFTs = entryBookFinancialTransactionByDate.get(eb); if (entryBooksFTs == null) { entryBooksFTs = new HashMap<>(); entryBookFinancialTransactionByDate.put(eb, entryBooksFTs); } // maybe not unique financial transaction for one date. // is there a way to know wich one to take ? - Set<FinancialTransaction> financialTransactionsForEntryBook = entryBooksFTs.get(ft.getTransactionDate()); - if (financialTransactionsForEntryBook == null) { - financialTransactionsForEntryBook = Sets.newHashSet(); - } - financialTransactionsForEntryBook.add(ft); - entryBooksFTs.put(ft.getTransactionDate(), financialTransactionsForEntryBook); + entryBooksFTs.put(ft.getTransactionDate(), ft); } return entryBookFinancialTransactionByDate; } diff --git a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java index e4e6a4d..4fbd06a 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java @@ -56,7 +56,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; -import java.math.BigDecimal; import java.nio.charset.Charset; import java.text.ParseException; import java.util.ArrayList; @@ -566,6 +565,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { entries.addAll(financialTransaction.getEntry()); } Assert.assertTrue(!entries.isEmpty()); + int nbEntities = entries.size(); //test export String tmpDir = System.getProperty("java.io.tmpdir")+"/"; @@ -591,10 +591,11 @@ public class ImportExportServiceTest extends AbstractLimaTest { // test import FileInputStream contentStream = null; + ImportResult result; try { contentStream = new FileInputStream(tmpDir + "export-entries-EBP.csv"); String inputStream = IOUtils.toString(contentStream); - importService.importEntriesFromEbp(inputStream).getImportResults().get(0); + result = importService.importEntriesFromEbp(inputStream).getImportResults().get(0); } finally { IOUtils.closeQuietly(contentStream); } @@ -603,22 +604,12 @@ public class ImportExportServiceTest extends AbstractLimaTest { financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012")); Assert.assertEquals(2, financialTransactions.size()); for (FinancialTransaction financialTransaction : financialTransactions) { - if (financialTransaction.getAmountDebit().compareTo(BigDecimal.valueOf(42.0)) == 0) { - Collection<Entry> voucherAEntries = financialTransaction.getEntry(); - Assert.assertEquals(2L, voucherAEntries.size()); - for (Entry entry : voucherAEntries) { - Assert.assertTrue(entry.getVoucher().contentEquals("voucherA")); - } - } else if (financialTransaction.getAmountDebit().compareTo(BigDecimal.valueOf(12.0)) == 0) { - Collection<Entry> voucherBEntries = financialTransaction.getEntry(); - Assert.assertEquals(3L, voucherBEntries.size()); - for (Entry entry : voucherBEntries) { - Assert.assertTrue(entry.getVoucher().contentEquals("voucherB")); - } - } else { - Assert.fail("Fail to import financial transactions"); - } + entries.addAll(financialTransaction.getEntry()); } + + Assert.assertEquals(nbEntities, entries.size()); + Assert.assertEquals(nbEntities, result.getNbCreated()); + Assert.assertTrue(result.getAllExceptionsByLine().isEmpty()); } protected void importEBPData() throws IOException, ParseException, BeginAfterEndFiscalPeriodException, -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 5be94d47acfb55bc7db134811699b2a6b7a29882 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 17:16:37 2016 +0200 refs #1174 Ne pas réencapsuler une exception Lima dans une autre --- .../main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java index 11a23d1..f361bc9 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java @@ -366,7 +366,11 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ result.increaseCreated(); } } catch (Exception e) { - result.addInitException(new ImportFileException(e.getMessage())); + if (e instanceof LimaException) { + result.addInitException((LimaException) e); + } else { + result.addInitException(new ImportFileException(e.getMessage())); + } results.setErrors(true); } finally { IOUtils.closeQuietly(contentStream); -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit c56887327963da702adef64eff7cba04dc17dc90 Merge: 9316918 5be94d4 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 17:16:53 2016 +0200 Merge branch 'feature/1174-Import_EBP_Transactions' into develop .../org/chorem/lima/business/ImportResult.java | 5 +- .../business/exceptions/UnexistingAccount.java | 26 ++++- .../org/chorem/lima/business/AccountingRules.java | 3 +- .../accountingrules/DefaultAccountingRules.java | 6 +- .../lima/business/ejb/AccountServiceImpl.java | 4 + .../lima/business/ejb/ImportServiceImpl.java | 23 +++-- .../resources/i18n/lima-business_en_GB.properties | 34 ++++--- .../resources/i18n/lima-business_fr_FR.properties | 51 +++++++--- .../org/chorem/lima/business/AbstractLimaTest.java | 110 ++++++++++++++++++--- .../lima/business/AccountServiceImplTest.java | 8 +- .../lima/business/EntryBookServiceImplTest.java | 6 +- .../business/FinancialPeriodServiceImplTest.java | 6 +- .../FinancialTransactionServiceImplTest.java | 6 +- .../lima/business/FiscalPeriodServiceImplTest.java | 4 +- .../lima/business/ImportExportServiceTest.java | 68 +++++++------ .../lima/business/ReportServiceImplTest.java | 8 +- .../lima/entity/FinancialTransactionDAOTest.java | 8 +- .../chorem/lima/ui/importexport/ImportExport.java | 6 +- .../resources/i18n/lima-swing_en_GB.properties | 3 + .../resources/i18n/lima-swing_fr_FR.properties | 3 + 20 files changed, 267 insertions(+), 121 deletions(-) -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 706f22a8b9d5e56eceeb050c7f2f3f797d5c8c32 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 21:17:19 2016 +0200 refs #1369 Mise à jour des intitulés pour l'import des journaux --- .../resources/i18n/lima-swing_en_GB.properties | 59 +-------------------- .../resources/i18n/lima-swing_fr_FR.properties | 61 +--------------------- 2 files changed, 3 insertions(+), 117 deletions(-) diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties index 363fe27..a643208 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties @@ -15,7 +15,6 @@ lima.account.remove.error.unexistingAcount=Unexisting account %1$s, it can not b lima.account.remove.error.usedAccount=There are financial statement on this account lima.account.update.error.invalidAccountNumber=Invalid account number\: %1$s lima.account.update.form=Update account -lima.accountViewer.previousSold=<html><b>On %s the sold was</b></html> lima.accountViewer.selectionDescription=For selected entries, lima.accountingView.summaryFiscalPeriodLabel=For %s fiscal period, lima.accountingView.summaryLabel=Period from %s to %s, @@ -98,24 +97,11 @@ lima.config.currency.label=currency lima.config.data.dir.description=LIMA data directory lima.config.data.dir.label=Data directory lima.config.decimalSeparator.label=Decimal separator -lima.config.documentReport.account.documentReportModelPath.description= -lima.config.documentReport.balance.balanceAccountReportModelPath.description= -lima.config.documentReport.balance.balanceSubAccountReportModelPath.description= -lima.config.documentReport.balance.documentReportModelPath.description= -lima.config.documentReport.entrybook.documentReportModelPath.description= -lima.config.documentReport.entrybook.entryBookModelPath.description= -lima.config.documentReport.entrybook.financialPeriodModelPath.description= -lima.config.documentReport.entrybook.transactionReportModelPath.description= -lima.config.documentReport.generalEntrybook.documentReportModelPath.description= -lima.config.documentReport.generalEntrybook.generalEntryBookEntryModelPath.description= -lima.config.documentReport.generalEntrybook.generalEntryBookModelPath.description= lima.config.host.address.description=LIMA host address -lima.config.host.http.port.description=HTTP port lima.config.i18n.dir.description=Translation directory lima.config.i18n.dir.label=Translation directory lima.config.locale.description=Localization used by LIMA lima.config.locale.label=Local -lima.config.reports.dir.description= lima.config.resources.dir.description= lima.config.resources.dir.label= lima.config.scale.description=Scale for numbers @@ -161,7 +147,6 @@ lima.entries.copy.transaction=Copy transaction lima.entries.enter=Add entries lima.entries.entryBook=Entry book lima.entries.financialPeriod=Financial period -lima.entries.fiscalPeriod.toolTip= lima.entries.fiscalYear=fiscal year lima.entries.letter.closed.entryBook.error=Entry book close %2$s (%1$s) for period from %3$te %3$tB %3$tY to %4$te %4$tB %4$tY. lima.entries.letter.unbalanced.error= @@ -195,7 +180,6 @@ lima.entry.debit=Debit lima.entry.description=Description lima.entry.letter=Letter lima.entry.remove.confirm=Do you really want to remove this financial transaction line ? -lima.entry.update.closed.entryBook.error= lima.entry.update.error.closedEntryBook= lima.entry.update.error.lockedFinancialPeriod= lima.entryBook=EntryBook @@ -221,11 +205,6 @@ lima.error.notAllowedLabel= lima.export.exceptions=Export failed. lima.export.failed=Export faild \! lima.export.terminated=Successful export -lima.exportFiscalControl.export= -lima.exportFiscalControl.exportFile= -lima.exportFiscalControl.fileChooser= -lima.exportFiscalControl.fiscalPeriod= -lima.exportFiscalControl.form= lima.file=File lima.filer.condition.sensitive.case=Case sensitive lima.filter=Filter @@ -235,7 +214,6 @@ lima.filter.condition.one=Valid at least one criteria lima.filter.condition.periodChoice.date=Date interval lima.filter.condition.periodChoice.financialPeriod=Financial period lima.filter.condition.periodChoice.fiscalPeriod=Fiscal period -lima.filter.condition.selectionMode=Balance entry selection lima.filter.condition.selectionMode.lettered=Lettered lima.filter.condition.selectionMode.manual=Manual lima.filter.credit=Add filter on credit @@ -320,7 +298,6 @@ lima.fiscalControlExport=FEC(fr) export lima.fiscalControlExport.entryBookAtNew= lima.fiscalControlExport.entryBookAtNew.toolTip= lima.fiscalControlExport.export= -lima.fiscalControlExport.exportFile= lima.fiscalControlExport.file.nonConformanceName= lima.fiscalControlExport.file.nonConformanceName.cancel= lima.fiscalControlExport.file.nonConformanceName.continue= @@ -329,7 +306,6 @@ lima.fiscalControlExport.file.overwrite= lima.fiscalControlExport.file.overwrite.cancel= lima.fiscalControlExport.file.overwrite.continue= lima.fiscalControlExport.file.overwrite.title= -lima.fiscalControlExport.fileChooser= lima.fiscalControlExport.fiscalPeriod= lima.fiscalControlExport.form= lima.fiscalControlExport.sirenMissing= @@ -417,7 +393,6 @@ lima.home.fiscalYears.noOpen=Any open fiscal year lima.home.fiscalYears.opened=%s open fiscal year lima.identity=Identity lima.identity.address=Address -lima.identity.address2=Address (next) lima.identity.businessNumber=Business number lima.identity.city=City lima.identity.classificationCode=Classification code @@ -428,12 +403,10 @@ lima.identity.phoneNumber=Phone number lima.identity.vatNumber=VAT number lima.identity.zipCode=Zip code lima.import.error=Import Failed -lima.import.error.andMoreErrors=And %d more errors lima.import.error.entriesOutOfDatesRange=Open fiscal period lima.import.error.extractFile=Invalid file lima.import.error.invalidAccountNumber=None existing account with number '%' lima.import.error.noDataToImport=Any data to import -lima.import.error.unknown=Unknown error lima.import.line=line lima.import.report=%d created\n %d ignored\n %d updated lima.import.terminated=Import finished @@ -463,10 +436,8 @@ lima.launch.finished=completed lima.launch.services=starting services lima.launch.webServer=starting web server lima.lettering.account=Accounts -lima.lettering.account.aAll=All lima.lettering.account.back=← lima.lettering.account.next=→ -lima.lettering.accountViewerBalanceStatus=<html>From %s to %s\: Sold is\: <b>%s - %s \= %s</b> - Selected entries sold\: <b>%s - %s \= %s</b> lima.lettering.balanceStatus=<html>Debit\: <b>%s</b> - Credit\: <b>%s</b> - Sold\: <b>%s</b>. Selected entries\: Debit\: <b>%s</b> - Credit\: <b>%s</b> - Sold\: <b>%s</b> lima.lettering.checkAll=All lima.lettering.checkLettredEntry=Lettered @@ -480,9 +451,6 @@ lima.lettering.period.end=TO lima.lettering.refresh=Refresh (F5) lima.lettering.roundAndCreateEntry.error.lockedEntryBook= lima.lettering.roundAndCreateEntry.error.lockedFinancialPeriod= -lima.lettering.selection.credit=Credit -lima.lettering.selection.debit=Debit -lima.lettering.selection.sold=Balance lima.lettering.unLettered=Remove lettering lima.lookAndFeel.nimbus.warning= lima.message.help.usage=Options (set with --option <key> <value>\: @@ -496,34 +464,18 @@ lima.opening=Launching lima.opening.accounts=<html><center>Select a default, <br/>import your personal<br/> or cancel to create your own account chart.</center></html> lima.opening.close=Close lima.opening.end=Finish -lima.opening.entryBook=Select it to import default entry books +lima.opening.entryBook=<html><center>Select entry books to import, <br/>import defaults ones<br/>import your personal</br>or next to create your own entry books.</center></html> lima.opening.fiscalPeriod=Create fiscal period lima.opening.import=Import a CSV backup lima.opening.next=Next lima.opening.previous=Previous lima.opening.welcome=<html><center>Welcome to Lima<br/>this assistant help you to start your business accounting in the blink of an eye<br/>OR import instantly your already existing save in CSV format<br/><br/><br/><br/></center></html> -lima.paste=Paste lima.preferences=Preferences lima.quit=Exit lima.refresh=Refresh lima.refresh.shortcut=Refresh (F5) lima.remove=Remove lima.remove.shortcut=Edit (Ctrl+M) -lima.report.accounts=Accounts\: -lima.report.assets=Assets -lima.report.balance=Balance -lima.report.balanceForPeriod=Balance -lima.report.balanceSheet=Balance -lima.report.credit=Credit -lima.report.currency=Currency\: -lima.report.currentAsset=Current asset -lima.report.dedit=Debit -lima.report.fromDateToDate=From %s to %s -lima.report.generatingDate=Printed on %s -lima.report.investments=Investments -lima.report.label=Label -lima.report.liabilities=Liabilities -lima.report.totalForPeriod=Period total lima.retainedEarnings.wait= lima.search=Search lima.structure=Structure @@ -541,13 +493,11 @@ lima.table.letter=Letter lima.table.locked=Loked lima.table.number=Account Number lima.table.provisionDeprecation=Provision Deprecation -lima.table.sold= lima.table.voucher=Voucher lima.title=Lutin Invoice Monitoring and Accounting lima.transaction=Transaction lima.treasury=Tax authority administration lima.treasury.address=Address -lima.treasury.address2=Address (next) lima.treasury.cdi=CDI lima.treasury.city=City lima.treasury.dossierNumber=File number @@ -555,20 +505,15 @@ lima.treasury.key=key lima.treasury.serviceCode=Service Code lima.treasury.sie=SIE lima.treasury.systemType=System Type -lima.treasury.vatNumber=VAT number lima.treasury.zipCode=Zip Code -lima.ui.dateFormat=MM/dd/yyy lima.update=Modify lima.update.shortcut=Update (Ctrl+M) lima.validate=Validate lima.vatStatement=VAT statement chart lima.vatStatement.accounts=List of accounts -lima.vatStatement.base=Base VAT statement chart lima.vatStatement.boxName=PDF BoxName lima.vatStatement.default= -lima.vatStatement.delete=Delete actual VAT statement chart before import new lima.vatStatement.delete.parent=Remove parent -lima.vatStatement.developed=Developed VAT statement chart lima.vatStatement.error.alreadyExistVatStatement= lima.vatStatement.import=Import CSV lima.vatStatement.import.delete= @@ -577,9 +522,7 @@ lima.vatStatement.label=Label lima.vatStatement.master=Master VAT statement lima.vatStatement.movement=Movement lima.vatStatement.movement.add=Add movement -lima.vatStatement.nothing=No vat statement chart lima.vatStatement.remove.confirm=Do you really want to remove line ? lima.vatStatement.remove.title=Remove line ? -lima.vatStatement.shortened=Shortened vat statement chart lima.vatStatements=VAT statements lima.wait=Work in progress diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index 5d8f7dd..9bbc6eb 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -1,6 +1,3 @@ -Identit\\u00e9= -Tr\\u00e9sor\ Public= -blima.config.documentReport.generalEntrybook.generalEntryBookEntryModelPath.description= lima.account=Compte lima.account.add=Nouveau compte (Ctrl+A) lima.account.add.error.InvalidAccountNumber=Le numéro du compt %1$s n'est pas valide @@ -18,7 +15,6 @@ lima.account.remove.error.unexistingAcount=Le compte %1$s n'existe pas, le compt lima.account.remove.error.usedAccount=Il exist des transactions sur ce compte lima.account.update.error.invalidAccountNumber=Le numéro du compte %1$s n'est pas valide lima.account.update.form=Modification d'un compte -lima.accountViewer.previousSold=<html><b>Solde au %s</b></html> lima.accountViewer.selectionDescription=Pour la sélection, lima.accountingView.summaryFiscalPeriodLabel=Pour l'exercice %s, lima.accountingView.summaryLabel=Pour la période du %s au %s, @@ -98,31 +94,8 @@ lima.config.currency.description=Afficher le symbole monétaire lima.config.currency.label=Unité monétaire lima.config.data.dir.description=Répertoire d'enregistrement des données de l'application lima.config.data.dir.label=Répertoire des données -lima.config.decimalSeparator.description=Caractères de séparation entre la partie entière et la parti décimale d'un nombre lima.config.decimalSeparator.label=Séparateur de décimales -lima.config.documentReport.account.accountModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'account' -lima.config.documentReport.account.documentReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'DocumentReport' -lima.config.documentReport.balance.balanceAccountReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'BalanceAccount' -lima.config.documentReport.balance.balanceSubAccountReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'BalanceAccount' des comptes enfants -lima.config.documentReport.balance.documentReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'DocumentReport -lima.config.documentReport.balanceReportAccount.description= -lima.config.documentReport.bigDecimalFormat.description=format pour affichage des montants dans les rapports -lima.config.documentReport.bigDecimalFormat.label=format pour affichage des montants -lima.config.documentReport.entrybook.documentReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'EntryBook' -lima.config.documentReport.entrybook.entryBookModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'EntryBook' -lima.config.documentReport.entrybook.financialPeriodModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'FinancialPeriod' -lima.config.documentReport.entrybook.transactionReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'Transaction' -lima.config.documentReport.financialStatement.documentReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'DocumentReport' -lima.config.documentReport.financialStatement.financialStatementModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'financialStatement' -lima.config.documentReport.generalEntrybook.documentReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'DocumentReport' -lima.config.documentReport.generalEntrybook.generalEntryBookEntryModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'GeneralEntryBookEntry' -lima.config.documentReport.generalEntrybook.generalEntryBookModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'GeneralEntryBook' -lima.config.documentReport.generalLedger.documentReportModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'DocumentReport' -lima.config.documentReport.generalLedger.generalLedgerModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'generalLedger' lima.config.host.address.description=Adresse du serveur distant -lima.config.host.address.label=Serveur -lima.config.host.port.description= -lima.config.host.port.label= lima.config.i18n.dir.description=Dossier contenant les traduction de lima lima.config.i18n.dir.label=dossier de traduction lima.config.locale.description=Paramétres local utilisés par l'application @@ -131,7 +104,6 @@ lima.config.numberSeparator.comma=Virgule lima.config.numberSeparator.dot=Point lima.config.numberSeparator.semicolon=Point-virgule lima.config.numberSeparator.space=Espace -lima.config.reports.dir.description= lima.config.resources.dir.description=Dossier contenant les fichiers ressouces de lima lima.config.resources.dir.label=Dossier ressources lima.config.scale.description=Nombre de caratères décimales pour les montants @@ -245,7 +217,6 @@ lima.filter.condition.one=Valide au moins une condition lima.filter.condition.periodChoice.date=Interval de Dates lima.filter.condition.periodChoice.financialPeriod=Période Financière lima.filter.condition.periodChoice.fiscalPeriod=Exercice -lima.filter.condition.selectionMode=Sélection des écritures lettrées lima.filter.condition.selectionMode.lettered=Lettré lima.filter.condition.selectionMode.manual=Manuelle lima.filter.credit=Ajouter un filtre sur les crédits @@ -428,7 +399,6 @@ lima.home.fiscalYears.noOpen=Aucun exercice ouvert \! lima.home.fiscalYears.opened=%s exercices ouverts lima.identity=Identité lima.identity.address=Adresse -lima.identity.address2=Adresse (suite) lima.identity.businessNumber=SIRET lima.identity.city=Ville lima.identity.classificationCode=Code NAF @@ -439,12 +409,10 @@ lima.identity.phoneNumber=n° Tel lima.identity.vatNumber=Numéro TVA\: FR lima.identity.zipCode=Code Postal lima.import.error=Une erreur est survenue lors de l'import -lima.import.error.andMoreErrors=Et %d autres erreurs... lima.import.error.entriesOutOfDatesRange=Periode fiscale non authorisé lima.import.error.extractFile=Le fichier n'est correct lima.import.error.invalidAccountNumber=Le compte '%s' n'existe pas. lima.import.error.noDataToImport=Aucune donnée à importer. -lima.import.error.unknown=Erreur inconnue. lima.import.line=Ligne %d\: lima.import.report=%d créés\n %d ignorés\n %d mis à jours lima.import.terminated=Import terminé @@ -475,10 +443,8 @@ lima.launch.finished=Application prête \! lima.launch.services=Chargement des services lima.launch.webServer=Lancement du service distant lima.lettering.account=Comptes -lima.lettering.account.aAll=TOUS lima.lettering.account.back=← lima.lettering.account.next=→ -lima.lettering.accountViewerBalanceStatus=<html>Pour la période du %s au %s\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b> - Pour la sélection\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b> lima.lettering.balanceStatus=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b>. Entrées sélectionnées\: Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b> lima.lettering.checkAll=Toutes lima.lettering.checkLettredEntry=Lettrées @@ -501,37 +467,20 @@ lima.ok=OK lima.openEjb.remote.mode.description=Activation du mode server lima.openEjb.remote.mode.label=Activation du mode server lima.opening=Initialisation -lima.opening.accounts=<html><center>Veuillez sélectionner un plan par défault, <br/>importer un plan personnalisé<br/> ou annuler pour créer votre propre plan.</center></html> +lima.opening.accounts=<html><center>Veuillez sélectionner un plan par comptable, <br/>importer un plan personnalisé<br/>ou continuer pour créer votre propre plan ultérieurement.</center></html> lima.opening.close=Fermer lima.opening.end=Terminer -lima.opening.entryBook=<html>Cochez la case pour importer les journaux par défaut \:<br/> Achats, Ventes, Trésorerie, Opération diverses</html> +lima.opening.entryBook=<html><center>Veuillez sélectionner les journaux à importer, <br/>journaux par défaut<br/>journaux personnalisés </br>ou continuer pour créer vos journaux plus ultérieurement.</center></html> lima.opening.fiscalPeriod=Création de l'exercice lima.opening.import=Importer une sauvegarde CSV lima.opening.next=Suivant lima.opening.previous=Retour lima.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour démarrer votre comptabilité en quelques instants <br/>Ou bien importer directement une ancienne sauvegarde de LIMA au format CSV<br/><br/><br/><br/></center></html> -lima.paste=Coller lima.preferences=Préférences lima.quit=Quitter lima.refresh=Actualiser lima.refresh.shortcut=Actualiser (F5) lima.remove.shortcut= -lima.report.account=Compte -lima.report.accounts=Comptes\: -lima.report.assets=avoirs -lima.report.balance=Solde -lima.report.balanceForPeriod=Solde période -lima.report.balanceSheet=Balance -lima.report.credit=Crédit -lima.report.currency=Devise\: -lima.report.currentAsset=Actif à court terme -lima.report.dedit=Débit -lima.report.fromDateToDate=Du %s au %s -lima.report.generatingDate=Édition du %s -lima.report.investments=investissements -lima.report.label=Intitulé -lima.report.liabilities=passif -lima.report.totalForPeriod=Total période lima.retainedEarnings.wait=Report à nouveau en cours lima.structure=Structure lima.table.account=Compte @@ -548,13 +497,11 @@ lima.table.letter=Lettre lima.table.locked=Clos lima.table.number=Numéro de compte lima.table.provisionDeprecation=Amortissements et provisions -lima.table.sold= lima.table.voucher=Pièce comptable lima.title=Lutin Invoice Monitoring and Accounting lima.transaction=Transaction lima.treasury=Trésor Public lima.treasury.address=Adresse -lima.treasury.address2=Adresse (suite) lima.treasury.cdi=CDI lima.treasury.city=Ville lima.treasury.dossierNumber=Numéro de dossier @@ -563,17 +510,14 @@ lima.treasury.serviceCode=Code service lima.treasury.sie=SIE lima.treasury.systemType=Régime lima.treasury.zipCode=Code Postal -lima.ui.dateFormat=dd/MM/yyy lima.update=Modifier lima.update.shortcut=Modifier (Ctrl+M) lima.validate=Valider lima.vatStatement=Plan TVA lima.vatStatement.accounts=Liste des comptes -lima.vatStatement.base=Standard lima.vatStatement.boxName=PDF BoxName lima.vatStatement.default=Par défaut lima.vatStatement.delete.parent=Veuillez supprimer les sous-catégories de cette ligne -lima.vatStatement.developed=Développé lima.vatStatement.error.alreadyExistVatStatement=u00C9chec \: Le plan %s exist déjà \! lima.vatStatement.import=Importé lima.vatStatement.import.delete=Supprimer le plan TVA actuel avant d'importer @@ -584,6 +528,5 @@ lima.vatStatement.movement=Regroupement lima.vatStatement.movement.add=Ajouter un regrouprement (Ctrl+N) lima.vatStatement.remove.confirm=Etes vous sur de vouloir supprimer cette ligne ? lima.vatStatement.remove.title=supprimer de ligne ? -lima.vatStatement.shortened=Abrégé lima.vatStatements=Plan TVA lima.wait=Traitement en cours -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 6edeb52faca651e06e013b3b9f2da3c51cdb41cf Author: David Cossé <cosse@codelutin.com> Date: Fri Sep 23 16:14:17 2016 +0200 refs #1369 Ajout de la possibilité d'importer des journaux CSV et EBP --- .../org/chorem/lima/enums/EntryBooksChartEnum.java | 25 +++++++++++-- .../lima/ui/entrybook/EntryBookImportForm.css | 22 +++++++---- .../lima/ui/entrybook/EntryBookImportForm.jaxx | 14 ++++++- .../lima/ui/entrybook/EntryBookViewHandler.java | 19 ++++++++-- .../lima/ui/opening/CreateEntryBookPanel.css | 16 +++++++- .../lima/ui/opening/CreateEntryBookPanel.jaxx | 20 +++++++++- .../chorem/lima/ui/opening/OpeningViewHandler.java | 41 ++++++++++++++++----- .../resources/i18n/lima-swing_en_GB.properties | 5 +++ .../resources/i18n/lima-swing_fr_FR.properties | 5 +++ src/site/resources/screens/lima_open_entrybook.png | Bin 21208 -> 26349 bytes src/site/rst/assistant.rst | 3 +- src/site/rst/importexport.rst | 20 ++++++++-- 12 files changed, 156 insertions(+), 34 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java b/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java index 3a03314..78654b1 100644 --- a/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java +++ b/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java @@ -22,20 +22,37 @@ package org.chorem.lima.enums; +import org.chorem.lima.beans.Labeled; + import java.net.URL; -public enum EntryBooksChartEnum { +import static org.nuiton.i18n.I18n.t; + +public enum EntryBooksChartEnum implements Labeled { + + IMPORT_DEFAULT("eb_default.csv", t("lima.chart.entryBook.import.default")),//"eb_default.csv" + IMPORT_CSV(null, t("lima.chart.entryBook.import.csv")), + IMPORT_EBP(null, t("lima.chart.entryBook.import.ebp")); - IMPORT(""), DEFAULT("eb_default.csv"); + private String label; private final String filePath; - EntryBooksChartEnum(String filePath) { + EntryBooksChartEnum(String filePath, String label) { + this.filePath = filePath; + this.label = label; } public URL getDefaultFileURL() { - URL url = ImportExportEnum.getFileURL("/import/" + filePath); + URL url = null; + if (filePath != null) { + url = ImportExportEnum.getFileURL("/import/" + filePath); + } return url; } + + public String getLabel() { + return label; + } } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css index 3d8265b..5fde1ba 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css @@ -23,17 +23,23 @@ title : "lima.entryBook.import.form"; } -#entryBooksDefault { - text : "lima.entryBook.default"; - value : "{EntryBooksChartEnum.DEFAULT}"; - buttonGroup : "{buttonGroup}"; +#importDefault { + text : "lima.importExport.entryBooks.default"; + value : "{EntryBooksChartEnum.IMPORT_DEFAULT}"; selected : true; + buttonGroup : buttonGroup; } -#entryBooksImport { - text : "lima.entryBook.import"; - value : "{EntryBooksChartEnum.IMPORT}"; - buttonGroup : "{buttonGroup}"; +#importcsv { + text : "lima.importExport.entryBooks.csv"; + value : "{EntryBooksChartEnum.IMPORT_CSV}"; + buttonGroup : buttonGroup; +} + +#importebp { + text : "lima.importExport.entryBooks.ebp"; + value : "{EntryBooksChartEnum.IMPORT_EBP}"; + buttonGroup : buttonGroup; } #cancel { diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx index 939e70e..a760f8f 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx @@ -45,12 +45,22 @@ <Table constraints="BorderLayout.CENTER"> <row> <cell> - <JRadioButton id="entryBooksDefault"/> + <JLabel id="entryBookLabel" /> </cell> </row> <row> <cell> - <JRadioButton id="entryBooksImport"/> + <JRadioButton id="importDefault"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importcsv"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importebp"/> </cell> </row> </Table> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java index ef3db65..dc6a452 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java @@ -291,10 +291,23 @@ public class EntryBookViewHandler implements ServiceListener { EntryBooksChartEnum entryBooksChartEnum = (EntryBooksChartEnum) value; // if action confirmed if (entryBooksChartEnum != null) { - ImportExport importExport = new ImportExport(view); - importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, - null, entryBooksChartEnum.getDefaultFileURL(), true); + switch (entryBooksChartEnum) { + case IMPORT_CSV: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_CSV.getDefaultFileURL(), true); + break; + case IMPORT_EBP: + importExport.importExport(ImportExportEnum.EBP_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_EBP.getDefaultFileURL(), true); + break; + + default: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, entryBooksChartEnum.getDefaultFileURL(), true); + break; + } + loadAllEntryBooks(); } } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css index ee620d9..78da71f 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css @@ -23,7 +23,21 @@ text : "lima.opening.entryBook"; } -#importEntryBook { +#importDefault { text : "lima.importExport.entryBooks.default"; + value : "{EntryBooksChartEnum.IMPORT_DEFAULT}"; selected : true; + buttonGroup : buttonGroup; +} + +#importcsv { + text : "lima.importExport.entryBooks.csv"; + value : "{EntryBooksChartEnum.IMPORT_CSV}"; + buttonGroup : buttonGroup; +} + +#importebp { + text : "lima.importExport.entryBooks.ebp"; + value : "{EntryBooksChartEnum.IMPORT_EBP}"; + buttonGroup : buttonGroup; } \ No newline at end of file diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx index afed9d1..d109fce 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx @@ -20,15 +20,31 @@ #L% --> <JPanel> + <import> + org.chorem.lima.enums.EntryBooksChartEnum + </import> + + <javax.swing.ButtonGroup id="buttonGroup"/> + <Table> <row> <cell> - <JLabel id="entryBookLabel"/> + <JLabel id="entryBookLabel" /> </cell> </row> <row> <cell> - <JCheckBox id='importEntryBook'/> + <JRadioButton id="importDefault"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importcsv"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importebp"/> </cell> </row> </Table> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java index 5f634e5..c827846 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java @@ -36,11 +36,10 @@ import org.chorem.lima.enums.ImportExportEnum; import org.chorem.lima.enums.VatStatementsChartEnum; import org.chorem.lima.ui.importexport.ImportExport; -import javax.swing.BorderFactory; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; -import java.awt.Color; +import java.awt.*; import static org.nuiton.i18n.I18n.t; @@ -178,12 +177,8 @@ public class OpeningViewHandler { break; case 4: - if (ebPanel.getImportEntryBook().isSelected()) { - importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, - null, EntryBooksChartEnum.DEFAULT.getDefaultFileURL(), false); - } else { - importExport.resetInitialImportedEntryBook(); - } + importEntryBookLayouts(importExport); + view.getEntrybooksIcon().setBorder(noBorder); view.getFiscalperiodsIcon().setBorder(BorderFactory.createLineBorder(green, 2)); panel.add(fsPanel); @@ -212,6 +207,34 @@ public class OpeningViewHandler { } } + private void importEntryBookLayouts(ImportExport importExport) { + + Object value = ebPanel.getButtonGroup().getSelectedValue(); + // if action confirmed + if (value != null) { + // reset previous imported values + importExport.resetInitialImportedEntryBook(); + + EntryBooksChartEnum entryBooksChartEnum = (EntryBooksChartEnum) value; + + switch (entryBooksChartEnum) { + case IMPORT_CSV: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_CSV.getDefaultFileURL(), false); + break; + case IMPORT_EBP: + importExport.importExport(ImportExportEnum.EBP_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_EBP.getDefaultFileURL(), false); + break; + + default: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, entryBooksChartEnum.getDefaultFileURL(), false); + break; + } + } + } + protected void importAccountabilityLayouts(ImportExport importExport) { Object value = caPanel.getButtonGroup().getSelectedValue(); // if action confirmed diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties index a643208..218ae28 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties @@ -30,6 +30,9 @@ lima.chart.accounts.developed=Developed account chart lima.chart.accounts.import.csv=CSV customized accounting plan lima.chart.accounts.import.ebp=EBP customized accounting plan lima.chart.accounts.shortened=Shortened account chart +lima.chart.entryBook.import.csv=eb_ebp_default.csv +lima.chart.entryBook.import.default=eb_default.csv +lima.chart.entryBook.import.ebp=eb_csv_default.csv lima.close=Close lima.closed=Closed lima.code=Code @@ -418,7 +421,9 @@ lima.importExport.ebp=Import/Export EBP lima.importExport.encoding.choice= lima.importExport.entry=Entries import completed. lima.importExport.entryBook=entry book completed. +lima.importExport.entryBooks.csv=CSV import lima.importExport.entryBooks.default=Default entry book +lima.importExport.entryBooks.ebp=EBP import lima.importExport.export=Export lima.importExport.financialStatement=Financial transactions import completed. lima.importExport.financialTransaction=financial transaction completed. diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index 9bbc6eb..efea358 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -30,6 +30,9 @@ lima.chart.accounts.developed=Développé lima.chart.accounts.import.csv=Personnalisé au format CSV lima.chart.accounts.import.ebp=Personnalisé au format EBP lima.chart.accounts.shortened=Abrégé +lima.chart.entryBook.import.csv=import CSV +lima.chart.entryBook.import.default=import par défaut +lima.chart.entryBook.import.ebp=import EBP lima.close=Fermer lima.config.category.directories=Répertoires lima.config.category.directories.description=Répertoires utilisés par Lima @@ -424,7 +427,9 @@ lima.importExport.ebp=Import/Export EBP lima.importExport.encoding.choice=Choix de l'encodage lima.importExport.entry=des écritures terminé. lima.importExport.entryBook=des journaux terminé. +lima.importExport.entryBooks.csv=Import CSV lima.importExport.entryBooks.default=Journaux par défaut +lima.importExport.entryBooks.ebp=Import EBP lima.importExport.export=Exporter lima.importExport.financialStatement=des déclaration financière terminé. lima.importExport.financialTransaction=des transaction financière terminé. diff --git a/src/site/resources/screens/lima_open_entrybook.png b/src/site/resources/screens/lima_open_entrybook.png index 6ca91a3..eae0072 100644 Binary files a/src/site/resources/screens/lima_open_entrybook.png and b/src/site/resources/screens/lima_open_entrybook.png differ diff --git a/src/site/rst/assistant.rst b/src/site/rst/assistant.rst index cf03e39..97966f1 100644 --- a/src/site/rst/assistant.rst +++ b/src/site/rst/assistant.rst @@ -78,8 +78,7 @@ Par défaut les quatres journaux les plus courants sont proposés au chargement - Caisse ; - Trésorerie. -Il est possible d'ajouter, modifier et supprimer des journaux en fonction de votre activité. -Menu Structure -> Journaux +Il est possible d'importer des jouranux depuis un fichier csv ou bien encore duis un fichier d'export généré par EBP. .. image:: screens/lima_open_entrybook.png diff --git a/src/site/rst/importexport.rst b/src/site/rst/importexport.rst index dab0de9..3eadd61 100644 --- a/src/site/rst/importexport.rst +++ b/src/site/rst/importexport.rst @@ -24,10 +24,23 @@ Import / Export =============== -Lima supporte actuellement deux formats d'import export : +Lima supporte actuellement deux formats d'import: -- Le CSV avec un modèle de donnée spécifique à Lima ; -- et le format EBP. +- le format CSV avec un modèle de donnée spécifique à Lima ; +- le format EBP, + +et 3 formats d'export: + +- FEC, +- CSV, +- EBP. + + +Format FEC (Fichier des écritures comptables) +--------------------------------------------- + +Le FEC est recquis par l’administration fiscale Française pour certains contrôles. +Tous les contribuables Français qui tiennent leur comptabilité au moyen de système informatisés doivent pouvoir remettre une copie du fichier des écritures comptables (FEC). Format CSV @@ -114,3 +127,4 @@ L'export est effectué ! .. _`disponible au téléchargement`: http://chorem.org/projects/lima/files + -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit c1b90ef2c0dc9c0683cdd05648f72be42fbc8427 Merge: c568873 6edeb52 Author: David Cossé <cosse@codelutin.com> Date: Fri Sep 23 16:18:07 2016 +0200 Merge branch 'feature/1369-demarage-initial' into develop .../org/chorem/lima/enums/EntryBooksChartEnum.java | 25 ++++++-- .../lima/ui/entrybook/EntryBookImportForm.css | 22 ++++--- .../lima/ui/entrybook/EntryBookImportForm.jaxx | 14 ++++- .../lima/ui/entrybook/EntryBookViewHandler.java | 19 +++++- .../lima/ui/opening/CreateEntryBookPanel.css | 16 ++++- .../lima/ui/opening/CreateEntryBookPanel.jaxx | 20 ++++++- .../chorem/lima/ui/opening/OpeningViewHandler.java | 41 ++++++++++--- .../resources/i18n/lima-swing_en_GB.properties | 64 ++------------------ .../resources/i18n/lima-swing_fr_FR.properties | 66 +++------------------ src/site/resources/screens/lima_open_entrybook.png | Bin 21208 -> 26349 bytes src/site/rst/assistant.rst | 3 +- src/site/rst/importexport.rst | 20 ++++++- 12 files changed, 159 insertions(+), 151 deletions(-) -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit a55ff1beca70f02ad63d0d446a950745e587ff1a Author: David Cossé <cosse@codelutin.com> Date: Fri Dec 16 16:21:18 2016 +0100 refs #686 pas de redémarrage de automatique de lima mais un dialogue demandant à l'utilisateur de redémmarrer --- .../java/org/chorem/lima/ui/MainViewHandler.java | 54 ++++++---------------- .../resources/i18n/lima-swing_en_GB.properties | 1 + .../resources/i18n/lima-swing_fr_FR.properties | 1 + 3 files changed, 17 insertions(+), 39 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java index 9dbdc02..2cb7dd0 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java @@ -62,7 +62,6 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; -import java.io.IOException; import java.net.URI; import java.net.URL; import java.util.Locale; @@ -118,14 +117,23 @@ public class MainViewHandler { public void changeLanguage(MainView mainUI, Locale newLocale) { LimaSwingConfig config = mainUI.getConfig(); - // sauvegarde de la nouvelle locale - config.setLocale(newLocale); + int response = JOptionPane.showConfirmDialog(mainUI,t("lima.restart")); - // rechargement i18n - LimaSwingApplicationContext.get().initI18n(config); + if (response == JOptionPane.YES_OPTION) { + // sauvegarde de la nouvelle locale + config.setLocale(newLocale); - // on recharge l'ui - reloadUI(LimaSwingApplicationContext.get()); + // rechargement i18n + LimaSwingApplicationContext.get().initI18n(config); + + LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.removeContextValue(LimaSwingApplicationContext.get()); + + mainUI.dispose(); + + mainUI.setVisible(false); + + System.exit(0); + } } /** @@ -309,38 +317,6 @@ public class MainViewHandler { } /** - * Permet de recharger l'ui principale et de changer de le mode d'affichage. - * - * @param rootContext le contexte applicatif - */ - protected void reloadUI(LimaSwingApplicationContext rootContext) { - - String version = LimaSwingApplicationContext.getContext().getConfig().getVersion(); - - // must remove all properties listener on config - LimaSwingApplicationContext.CONFIG_DEF.getContextValue(rootContext).removeJaxxPropertyChangeListener(); - - // scan main ui - MainView ui = getUI(rootContext); - - if (ui != null) { - LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.removeContextValue(rootContext); - - ui.dispose(); - - ui.setVisible(false); - } - - System.out.println("Lima-" + version + " restart !"); - try { - Runtime.getRuntime().exec("java -jar lima.jar"); - } catch (IOException e) { - e.printStackTrace(); - } - System.exit(0); - } - - /** * Test if there is some modification on screen, * * @param rootContext the context diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties index 218ae28..225ac47 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties @@ -481,6 +481,7 @@ lima.refresh=Refresh lima.refresh.shortcut=Refresh (F5) lima.remove=Remove lima.remove.shortcut=Edit (Ctrl+M) +lima.restart=Please restart the interface lima.retainedEarnings.wait= lima.search=Search lima.structure=Structure diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index efea358..e85dc99 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -486,6 +486,7 @@ lima.quit=Quitter lima.refresh=Actualiser lima.refresh.shortcut=Actualiser (F5) lima.remove.shortcut= +lima.restart=Veuillez redémarrer l'interface lima.retainedEarnings.wait=Report à nouveau en cours lima.structure=Structure lima.table.account=Compte -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 8b4e7bbb34e21b4f8906796ede98cba67036029f Author: David Cossé <cosse@codelutin.com> Date: Fri Dec 16 16:24:34 2016 +0100 refs #1314 mise à jour du mavenpom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cd6756a..251683e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>chorempom</artifactId> - <version>9</version> + <version>10.4</version> </parent> <groupId>org.chorem</groupId> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm