branch feature/1233 created (now 89b999b)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1233 in repository lima. See http://git.chorem.org/lima.git at 89b999b refs #1233 : test du service des périodes fiscales (suppresion des fonctions de service non utilisé) This branch includes the following new commits: new cd3af52 refs #1233 : test du service des comptes + retructuration des initialiseur de test new 391ae16 refs #1233 : test du service des journaux new 89b999b refs #1233 : test du service des périodes fiscales (suppresion des fonctions de service non utilisé) The 3 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 89b999b2b954938b4f59ee7ff461e7ef86c17d6f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Jun 2 08:56:32 2015 +0200 refs #1233 : test du service des périodes fiscales (suppresion des fonctions de service non utilisé) commit 391ae16b10a4f7645850c16a376e95a4afdfe29c Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Jun 1 15:42:03 2015 +0200 refs #1233 : test du service des journaux commit cd3af5229bbb68615692bb75d8ccf14f03f85a74 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Jun 1 14:51:42 2015 +0200 refs #1233 : test du service des comptes + retructuration des initialiseur de test -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1233 in repository lima. See http://git.chorem.org/lima.git commit cd3af5229bbb68615692bb75d8ccf14f03f85a74 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Jun 1 14:51:42 2015 +0200 refs #1233 : test du service des comptes + retructuration des initialiseur de test --- .../chorem/lima/business/api/AccountService.java | 5 +- .../org/chorem/lima/business/AccountingRules.java | 3 +- .../accountingrules/DefaultAccountingRules.java | 8 +- .../accountingrules/FranceAccountingRules.java | 3 +- .../lima/business/ejb/AccountServiceImpl.java | 7 +- .../lima/business/ejb/ImportServiceImpl.java | 4 +- .../org/chorem/lima/business/AbstractLimaTest.java | 502 +-------------------- .../lima/business/AccountServiceImplTest.java | 332 ++++++++++---- .../lima/business/EntryBookServiceImplTest.java | 2 +- .../business/FinancialPeriodServiceImplTest.java | 5 +- .../FinancialTransactionServiceImplTest.java | 5 +- .../lima/business/ImportExportServiceTest.java | 31 +- .../lima/business/ReportServiceImplTest.java | 5 +- .../lima/entity/FinancialTransactionDAOTest.java | 5 +- 14 files changed, 306 insertions(+), 611 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java index 6e1badf..b21482d 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java @@ -47,7 +47,6 @@ public interface AccountService { * Return account count. * * @return account count - * @throws LimaException technical exception */ long getAccountCount(); @@ -91,7 +90,7 @@ public interface AccountService { * @return true if updated or false if created * @throws InvalidAccountNumberException */ - boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException; + boolean createOrUpdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException; /** * Create new account. If {@code masterAccount} is not null, {@code account} @@ -100,7 +99,7 @@ public interface AccountService { * @param account account * @throws LimaException */ - Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException; + Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException; Account updateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException; 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 ac1b443..c53001e 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 @@ -31,7 +31,6 @@ import org.chorem.lima.business.exceptions.LockedEntryBookException; import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; @@ -64,7 +63,7 @@ public interface AccountingRules { * @param account new account * @throws org.chorem.lima.business.exceptions.LimaException if rule validation fails */ - void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException; + void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException; void updateAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException; 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 b6e2be7..1bc2c3e 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 @@ -36,7 +36,6 @@ import org.chorem.lima.business.exceptions.LockedEntryBookException; import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; @@ -93,14 +92,11 @@ public class DefaultAccountingRules implements AccountingRules { * Rules to check before create accounts. */ @Override - public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { + public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException { // Check if the numberaccount is not blank - if (StringUtils.isBlank(account.getAccountNumber())) { + if (StringUtils.isBlank(account.getAccountNumber()) || account.getAccountNumber().contains("\\")) { throw new InvalidAccountNumberException(account.getAccountNumber()); } - if (account.getAccountNumber().contains("\\")){ - throw new NotAllowedLabelException(account.getAccountNumber()); - } } diff --git a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java index 2b2ae1a..eeffbb1 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java +++ b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java @@ -31,7 +31,6 @@ import org.chorem.lima.business.exceptions.InvalidAccountNumberException; import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException; import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; @@ -66,7 +65,7 @@ public class FranceAccountingRules extends DefaultAccountingRules { * Règles de vérification de la création du PCG, appliquées à la comptabilité française. */ @Override - public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { + public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException { super.createAccountRules(account); validFranceAccountingRules(account); 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 fa33638..29055f7 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 @@ -69,7 +69,7 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe } @Override - public boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { + public boolean createOrUpdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { // check if account number already exist AccountTopiaDao accountDao = getDaoHelper().getAccountDao(); @@ -91,7 +91,7 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe * @throws LimaException */ @Override - public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { + public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException { // check if account number already exist AccountTopiaDao accountDao = getDaoHelper().getAccountDao(); @@ -105,7 +105,7 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe return result; } - protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { + protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException { // check rules before create the account AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); accountingRules.createAccountRules(account); @@ -129,6 +129,7 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe AccountTopiaDao accountDao = getDaoHelper().getAccountDao(); while (account == null && accountNumber.length() > 1) { + accountNumber = accountNumber.substring(0, accountNumber.length() - 1); account = accountDao.forAccountNumberEquals(accountNumber).findUniqueOrNull(); } return account; 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 b66e798..5f116a3 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 @@ -165,7 +165,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ boolean updated; for (Account account : accounts) { try { - updated = accountService.createOrUbdateAccount(account); + updated = accountService.createOrUpdateAccount(account); if (updated) { result.increaseUpdated(); } else { @@ -827,7 +827,7 @@ public class ImportServiceImpl extends AbstractLimaService implements ImportServ for (Account account : accounts) { boolean updated = false; try { - updated = accountService.createOrUbdateAccount(account); + updated = accountService.createOrUpdateAccount(account); } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabelException e) { result.addException(e); } 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 9550225..210f6c4 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,9 +38,12 @@ 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.AccountTopiaDao; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; @@ -51,7 +54,6 @@ import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.entity.FiscalPeriodImpl; import org.chorem.lima.entity.LimaCallaoEntityEnum; import org.chorem.lima.entity.LimaCallaoTopiaApplicationContext; -import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext; import org.hibernate.cfg.Environment; import org.junit.After; import org.junit.Before; @@ -209,10 +211,12 @@ public abstract class AbstractLimaTest { /** * Create a basic account plan. * - * @throws org.chorem.lima.business.exceptions.LimaException - * @throws java.text.ParseException + * @throws org.chorem.lima.business.exceptions.AlreadyExistAccountException + * @throws org.chorem.lima.business.exceptions.NotAllowedLabelException + * @throws org.chorem.lima.business.exceptions.InvalidAccountNumberException + * @throws org.chorem.lima.business.exceptions.NotNumberAccountNumberException */ - protected void initTestWithAccounts() throws Exception { + protected void createAccounts() throws AlreadyExistAccountException, NotAllowedLabelException, InvalidAccountNumberException, NotNumberAccountNumberException { // creation d'un plan compatble de test Account classFinancier = new AccountImpl(); @@ -252,486 +256,12 @@ public abstract class AbstractLimaTest { } /** - * Create a basic account plan. - * - * @throws org.chorem.lima.business.exceptions.LimaException - * @throws java.text.ParseException - */ - protected void initTestDefaultAccounts() throws Exception { - LimaCallaoTopiaPersistenceContext tcontext = context.newPersistenceContext(); - AccountTopiaDao accountTopiaDao = tcontext.getAccountDao(); - - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1", Account.PROPERTY_LABEL, "COMPTES DE CAPITAUX"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2", Account.PROPERTY_LABEL, "COMPTES D'IMMOBILISATIONS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "3", Account.PROPERTY_LABEL, "COMPTES DE STOCKS ET D'EN-COURS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4", Account.PROPERTY_LABEL, "COMPTES DE TIERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5", Account.PROPERTY_LABEL, "COMPTES FINANCIERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6", Account.PROPERTY_LABEL, "COMPTES DE CHARGES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7", Account.PROPERTY_LABEL, "COMPTES DE PRODUITS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "8", Account.PROPERTY_LABEL, "COMPTES SPECIAUX"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "10", Account.PROPERTY_LABEL, "REPORT A NOUVEAU (solde créditeur ou débiteur)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "11", Account.PROPERTY_LABEL, "RESULTAT NET DE L'EXERCICE (bénéfice ou perte)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "12", Account.PROPERTY_LABEL, "PROVISIONS REGLEMENTEES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "13", Account.PROPERTY_LABEL, "PROVlSlONS POUR RISQUES ET CHARGES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "14", Account.PROPERTY_LABEL, "EMPRUNTS ET DETTES ASSIMILEES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "15", Account.PROPERTY_LABEL, "IMMOBlLlSATIONS CORPORELLES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "16", Account.PROPERTY_LABEL, "IMMOBILlSATlONS EN COURS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "17", Account.PROPERTY_LABEL, "AUTRES IMMOBILISATIONS FINANCIERES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "20", Account.PROPERTY_LABEL, "MATIERES PREMIERES (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "21", Account.PROPERTY_LABEL, "AUTRES APPROVISIONNEMENTS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "23", Account.PROPERTY_LABEL, "EN-COURS DE PRODUCTION DE BIENS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "26", Account.PROPERTY_LABEL, "EN-COURS DE PRODUCTION DE SERVICES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27", Account.PROPERTY_LABEL, "STOCKS DE PRODUITS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "28", Account.PROPERTY_LABEL, "STOCKS DE MARCHANDISES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "29", Account.PROPERTY_LABEL, "SECURITE SOCIALE ET AUTRES ORGANISMES SOCIAUX"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "31", Account.PROPERTY_LABEL, "DEBITEURS ET CREDITEURS DIVERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "32", Account.PROPERTY_LABEL, "COMPTES TRANSITOIRES OU D'ATTENTE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "33", Account.PROPERTY_LABEL, "VALEURS MOBILIERES DE PLACEMENT"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "34", Account.PROPERTY_LABEL, "BANQUES; ETABLISSEMENTS FINANCIERS ET ASSIMILES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "35", Account.PROPERTY_LABEL, "CAISSE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "37", Account.PROPERTY_LABEL, "REGIES D'AVANCES ET ACCREDITIFS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "39", Account.PROPERTY_LABEL, "VIREMENTS INTERNES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "40", Account.PROPERTY_LABEL, "ACHATS (sauf 603)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "41", Account.PROPERTY_LABEL, "Services extérieurs"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "42", Account.PROPERTY_LABEL, "Autres services extérieurs"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "43", Account.PROPERTY_LABEL, "IMPOTS; TAXES ET VERSEMENTS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44", Account.PROPERTY_LABEL, "AUTRES CHARGES DE GESTION COURANTE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "45", Account.PROPERTY_LABEL, "CHARGES FINANCIERES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "46", Account.PROPERTY_LABEL, "CHARGES EXCEPTIONNELLES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "47", Account.PROPERTY_LABEL, "PRODUCTION IMMOBILISEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "48", Account.PROPERTY_LABEL, "SUBVENTlONS D'EXPLOITATION"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "49", Account.PROPERTY_LABEL, "AUTRES PRODUITS DE GESTION COURANTE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "50", Account.PROPERTY_LABEL, "PRODUITS FINANCIERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "51", Account.PROPERTY_LABEL, "PRODUITS EXCEPTIONNELS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "52", Account.PROPERTY_LABEL, "REPRISES SUR AMORTISSEMENTS ET PROVISIONS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "53", Account.PROPERTY_LABEL, "TRANSFERTS DE CHARGES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "54", Account.PROPERTY_LABEL, "ENGAGEMENTS HORS BILAN"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "58", Account.PROPERTY_LABEL, "RESULTAT EN INSTANCE D'AFFECTATION"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "59", Account.PROPERTY_LABEL, "BILAN"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "60", Account.PROPERTY_LABEL, "Capital"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "61", Account.PROPERTY_LABEL, "Ecarts de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "62", Account.PROPERTY_LABEL, "Compte de l'exploitant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "63", Account.PROPERTY_LABEL, "Résultat de l'exercice (bénéfice)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "64", Account.PROPERTY_LABEL, "Résultat de l'exercice (perte)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "65", Account.PROPERTY_LABEL, "Amortissements dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "66", Account.PROPERTY_LABEL, "Provision spéciale de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "67", Account.PROPERTY_LABEL, "Plus-values réinvesties"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68", Account.PROPERTY_LABEL, "Autres provisions réglementées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "69", Account.PROPERTY_LABEL, "Provisions pour risques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "70", Account.PROPERTY_LABEL, "Autres emprunts obligataires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "71", Account.PROPERTY_LABEL, "Emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "72", Account.PROPERTY_LABEL, "Primes de remboursement des obligations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "74", Account.PROPERTY_LABEL, "Dettes rattachées a des participations (groupe)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "75", Account.PROPERTY_LABEL, "Frais détablissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "76", Account.PROPERTY_LABEL, "Frais de recherche et de développement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "77", Account.PROPERTY_LABEL, "Concessions et droits similaires; brevets; licences; marques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78", Account.PROPERTY_LABEL, "Droit au bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "79", Account.PROPERTY_LABEL, "Fonds commercial"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "80", Account.PROPERTY_LABEL, "Autres immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "88", Account.PROPERTY_LABEL, "Dépôts et cautionnements versés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "89", Account.PROPERTY_LABEL, "Amortissements des immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "101", Account.PROPERTY_LABEL, "Amortissements des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "104", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations incorporell"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "105", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "106", Account.PROPERTY_LABEL, "Provisions pour dépréciation des participations et créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "107", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres immobilisations fina"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "108", Account.PROPERTY_LABEL, "Provisions pour dépréciation des matières premières (et four"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "109", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres approvisionnements"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "110", Account.PROPERTY_LABEL, "Provisions pour dépréciation des encours de production de bi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "119", Account.PROPERTY_LABEL, "Provisions pour dépréciation des en-cours de production de s"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "120", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de produits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "129", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "131", Account.PROPERTY_LABEL, "Personnel - Rémunérations dues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "138", Account.PROPERTY_LABEL, "Personnel - Charges à payer et produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "139", Account.PROPERTY_LABEL, "Sécurité sociale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "142", Account.PROPERTY_LABEL, "Autres organismes sociaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "143", Account.PROPERTY_LABEL, "Etat - Impôts sur les bénéfices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "144", Account.PROPERTY_LABEL, "Etat - Taxes sur le chiffre d'affaires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "145", Account.PROPERTY_LABEL, "Obligations cautionnées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "146", Account.PROPERTY_LABEL, "Autres impôts; taxes et versements assimilés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "147", Account.PROPERTY_LABEL, "Associés - Comptes courants"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "148", Account.PROPERTY_LABEL, "Créances sur cessions d'immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "151", Account.PROPERTY_LABEL, "Compte d'attente"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "153", Account.PROPERTY_LABEL, "Charges à repartir sur plusieurs exercices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "154", Account.PROPERTY_LABEL, "Charges constatées d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "155", Account.PROPERTY_LABEL, "Produits constatés d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "156", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de clients"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "157", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de débiteurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "158", Account.PROPERTY_LABEL, "Valeurs à I'encaissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "161", Account.PROPERTY_LABEL, "Banques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "163", Account.PROPERTY_LABEL, "Autres organismes financiers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "164", Account.PROPERTY_LABEL, "Concours bancaires courant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "165", Account.PROPERTY_LABEL, "Caisse siège social"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "166", Account.PROPERTY_LABEL, "Virements internes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "167", Account.PROPERTY_LABEL, "Provisions pour dépréciation des valeurs mobilières de place"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "168", Account.PROPERTY_LABEL, "Achats stockés - Matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "169", Account.PROPERTY_LABEL, "VARIATION DES STOCKS (approvisionnements et marchandises)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "171", Account.PROPERTY_LABEL, "Achat de materiel; equipement et travaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "174", Account.PROPERTY_LABEL, "Achats non stockes de matières et fournitures"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "178", Account.PROPERTY_LABEL, "Achats de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "201", Account.PROPERTY_LABEL, "Frais accessoires d'achat"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "203", Account.PROPERTY_LABEL, "Rabais; remises et ristournes obtenus sur achats"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "205", Account.PROPERTY_LABEL, "Sous-traitance générale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "206", Account.PROPERTY_LABEL, "Redevances de crédit-bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "207", Account.PROPERTY_LABEL, "Locations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "208", Account.PROPERTY_LABEL, "Charges locatives et de copropriété"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "211", Account.PROPERTY_LABEL, "Entretien et réparations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "212", Account.PROPERTY_LABEL, "Primes d'assurance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "213", Account.PROPERTY_LABEL, "Personnel extérieur à l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "214", Account.PROPERTY_LABEL, "Rémunérations intermédiaires et honoraires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "215", Account.PROPERTY_LABEL, "Publicité; publications; relations publiques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "218", Account.PROPERTY_LABEL, "Transports de biens et transports collectifs du personnel"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "231", Account.PROPERTY_LABEL, "Déplacements; missions et réceptions"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "232", Account.PROPERTY_LABEL, "Frais postaux et frais de télécommunications"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "237", Account.PROPERTY_LABEL, "Services bancaires et assimiles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "238", Account.PROPERTY_LABEL, "Impôts; taxes et versements assimiles sur rémunérations (aut"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "261", Account.PROPERTY_LABEL, "Autres impôts taxes et versements assimiles (administration"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "266", Account.PROPERTY_LABEL, "Rémunération du travail de l'exploitant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "267", Account.PROPERTY_LABEL, "Charges de sécurité sociale et de prévoyance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "268", Account.PROPERTY_LABEL, "Redevances pour concessions; brevets; licences; marques; pro"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "269", Account.PROPERTY_LABEL, "Pertes sur créances irrécouvrables"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "271", Account.PROPERTY_LABEL, "Quote-part de résultat sur opérations faites en commun"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "272", Account.PROPERTY_LABEL, "Escomptes accordés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "273", Account.PROPERTY_LABEL, "Valeurs comptables des éléments d'actif cédés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "274", Account.PROPERTY_LABEL, "Dotations aux amort. - Charges d'exploitation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "275", Account.PROPERTY_LABEL, "Dotations aux amortissements et aux provisions - Charges fin"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "276", Account.PROPERTY_LABEL, "Dotations aux amortissements et aux provisions - Charges exc"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "279", Account.PROPERTY_LABEL, "Participation des salaries aux fruits de l'expansion"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "280", Account.PROPERTY_LABEL, "Impôts sur les bénéfices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "281", Account.PROPERTY_LABEL, "Imposition forfaitaire annuelle des sociétés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "290", Account.PROPERTY_LABEL, "Produits - Reports en arrière des déficits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "291", Account.PROPERTY_LABEL, "Ventes de produits finis"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "293", Account.PROPERTY_LABEL, "Prestations de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "296", Account.PROPERTY_LABEL, "Ventes de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "297", Account.PROPERTY_LABEL, "Produits des activités annexes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "311", Account.PROPERTY_LABEL, "Rabais; remises et ristournes accordées par l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "312", Account.PROPERTY_LABEL, "VARIATION DES STOCKS (en-cours de production; produits)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "317", Account.PROPERTY_LABEL, "Immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "321", Account.PROPERTY_LABEL, "Produits divers de gestion courante"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "322", Account.PROPERTY_LABEL, "Escomptes obtenus"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "326", Account.PROPERTY_LABEL, "Produits des cessions éléments d'actif"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "331", Account.PROPERTY_LABEL, "Reprises sur amortissements et provisions (à inscrire dans l"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "335", Account.PROPERTY_LABEL, "Reprises sur provisions a inscrire dans les produits financi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "341", Account.PROPERTY_LABEL, "Reprises sur provisions (à inscrire dans les produits except"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "345", Account.PROPERTY_LABEL, "Transfert de charges d'exploitation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "351", Account.PROPERTY_LABEL, "Engagements donnés par l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "355", Account.PROPERTY_LABEL, "Engagements reçus par l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "358", Account.PROPERTY_LABEL, "Contrepartie des engagements"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "371", Account.PROPERTY_LABEL, "Réserve légale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "372", Account.PROPERTY_LABEL, "Réserves indisponibles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "391", Account.PROPERTY_LABEL, "Réserves statutaires ou contractuelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "392", Account.PROPERTY_LABEL, "Réserves réglementes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "393", Account.PROPERTY_LABEL, "Autres réserves"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "394", Account.PROPERTY_LABEL, "Provisions pour charges sociales et fiscales sur congés à pa"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "395", Account.PROPERTY_LABEL, "Matériel industriel (1)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "397", Account.PROPERTY_LABEL, "Matériel de transport"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "400", Account.PROPERTY_LABEL, "Matériel de bureau et matériel informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "401", Account.PROPERTY_LABEL, "Frais établissement (même ventilation que celle du compte 20"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "403", Account.PROPERTY_LABEL, "Constructions même ventilation que celle du compte 213)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "404", Account.PROPERTY_LABEL, "Installations techniques; matériel et outillage industriels"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "405", Account.PROPERTY_LABEL, "Dettes provisionnées pour congés à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "408", Account.PROPERTY_LABEL, "Autres charges à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "409", Account.PROPERTY_LABEL, "Obligataires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "410", Account.PROPERTY_LABEL, "tva cee"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "411", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires déductibles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "413", Account.PROPERTY_LABEL, "Produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "416", Account.PROPERTY_LABEL, "Reglement par chèques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "417", Account.PROPERTY_LABEL, "Réglement par CB"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "418", Account.PROPERTY_LABEL, "Réglement par LCR"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "419", Account.PROPERTY_LABEL, "Réglement en especes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "421", Account.PROPERTY_LABEL, "Intérêts courus à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "422", Account.PROPERTY_LABEL, "Crédit de mobilisation de créances commerciales (CMCC)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "424", Account.PROPERTY_LABEL, "Mobilisation de créances nées à létranger"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "425", Account.PROPERTY_LABEL, "Fournitures consommables"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "426", Account.PROPERTY_LABEL, "Variation des stocks de matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "427", Account.PROPERTY_LABEL, "Variation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "428", Account.PROPERTY_LABEL, "Achat marchandise CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "431", Account.PROPERTY_LABEL, "Achats en francise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "437", Account.PROPERTY_LABEL, "Malis sur emballages"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "438", Account.PROPERTY_LABEL, "Honoraires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "441", Account.PROPERTY_LABEL, "Commissions et frais sur émission d'emprunts"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "442", Account.PROPERTY_LABEL, "Frais sur effets (commissions d'endos...)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "443", Account.PROPERTY_LABEL, "Participation des employeurs à l'effort de construction"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "444", Account.PROPERTY_LABEL, "Contribution sociale de solidarité à la charge des sociétés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445", Account.PROPERTY_LABEL, "Congés payes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "446", Account.PROPERTY_LABEL, "Indemnités et avantages divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "447", Account.PROPERTY_LABEL, "Cotisations à l'URSSAF"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "451", Account.PROPERTY_LABEL, "Cotisations aux caisses de retraites"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "455", Account.PROPERTY_LABEL, "Cotisations aux ASSEDIC"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "456", Account.PROPERTY_LABEL, "Intérêts des emprunts et dettes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "457", Account.PROPERTY_LABEL, "Intérêts des comptes courants et des dépôts créditeurs"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "458", Account.PROPERTY_LABEL, "Intérêts bancaires et sur opérations de financement (escompt"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "462", Account.PROPERTY_LABEL, "Intérêts des obligations cautionnées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "464", Account.PROPERTY_LABEL, "Pertes de change ou de conversion"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "465", Account.PROPERTY_LABEL, "Dotations aux amortissements sur immobilisations incorporell"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "467", Account.PROPERTY_LABEL, "Dotations aux amortissements des charges d'exploitation à ré"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "468", Account.PROPERTY_LABEL, "Dotations aux provisions pour risques et charges d'exploitat"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "470", Account.PROPERTY_LABEL, "Dotations aux amortissements des primes de remboursement des"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "476", Account.PROPERTY_LABEL, "Dotation aux provisions pour dépréciation des éléments finan"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "477", Account.PROPERTY_LABEL, "Dotations aux amortissements exceptionnels sur immobilisatio"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "478", Account.PROPERTY_LABEL, "Ports et frais accessoires factures"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "481", Account.PROPERTY_LABEL, "Bonis sur reprises d'emballages consignes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "486", Account.PROPERTY_LABEL, "Autres produits activités annexes (cessions d'approvisionnem"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "487", Account.PROPERTY_LABEL, "Variation des en-cours de production de biens"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "488", Account.PROPERTY_LABEL, "Variation des en-cours de production de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "491", Account.PROPERTY_LABEL, "Variation des stocks de produits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "495", Account.PROPERTY_LABEL, "Gains de change ou de conversion"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "496", Account.PROPERTY_LABEL, "Reprises sur provisions pour dépréciation des éléments finan"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "501", Account.PROPERTY_LABEL, "Sur emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "502", Account.PROPERTY_LABEL, "TVA à décaisser"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "503", Account.PROPERTY_LABEL, "TVA sur immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "504", Account.PROPERTY_LABEL, "TVA sur autres bien et services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "505", Account.PROPERTY_LABEL, "Crédit de TVA à reporter"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "506", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "507", Account.PROPERTY_LABEL, "TVA collectée"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "508", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "509", Account.PROPERTY_LABEL, "Remboursement de taxes sur le chiffre d'affaires demandé"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "511", Account.PROPERTY_LABEL, "TVA récupérée d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "512", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires sur factures non parvenues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "514", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires sur factures à établir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "515", Account.PROPERTY_LABEL, "Achats stockés - Matières premières France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "516", Account.PROPERTY_LABEL, "Achats stockés - Matières premières CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "517", Account.PROPERTY_LABEL, "Frais accessoires d'achat France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "518", Account.PROPERTY_LABEL, "Frais accessoires d'achat CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "519", Account.PROPERTY_LABEL, "Dotations aux amort. immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "530", Account.PROPERTY_LABEL, "Dotations provisions dépréc. immos incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "540", Account.PROPERTY_LABEL, "Dotations provisions dépréc. immos corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "580", Account.PROPERTY_LABEL, "Stocks et en-cours"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "590", Account.PROPERTY_LABEL, "Créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "601", Account.PROPERTY_LABEL, "Amortissements dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "602", Account.PROPERTY_LABEL, "Ventes de produits finis France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "603", Account.PROPERTY_LABEL, "Ventes de produits finis CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "604", Account.PROPERTY_LABEL, "Prestations de services France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "605", Account.PROPERTY_LABEL, "Prestations de services CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "606", Account.PROPERTY_LABEL, "Ventes de marchandises France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "607", Account.PROPERTY_LABEL, "Ventes de marchandises CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "608", Account.PROPERTY_LABEL, "Compte créé pendant import"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "609", Account.PROPERTY_LABEL, "Reprises prov. dépréc. immos incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "611", Account.PROPERTY_LABEL, "Reprises prov. dépréc. immos corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "612", Account.PROPERTY_LABEL, "Stocks et en-cours"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "613", Account.PROPERTY_LABEL, "Créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "614", Account.PROPERTY_LABEL, "Reprises sur provisions - Amort. dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "615", Account.PROPERTY_LABEL, "achat cee"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "616", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "617", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "618", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "619", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "621", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "622", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "623", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "624", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "625", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "626", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "627", Account.PROPERTY_LABEL, "TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "628", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "629", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "631", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "633", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "635", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "637", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "641", Account.PROPERTY_LABEL, "Capital"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "644", Account.PROPERTY_LABEL, "Capital non amorti"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "645", Account.PROPERTY_LABEL, "Ecarts de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "646", Account.PROPERTY_LABEL, "Réserve légale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "647", Account.PROPERTY_LABEL, "réserve légale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "648", Account.PROPERTY_LABEL, "Réserves indisponibles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "651", Account.PROPERTY_LABEL, "Réserves statutaires ou contractuelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "653", Account.PROPERTY_LABEL, "Réserves réglementes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "654", Account.PROPERTY_LABEL, "Autres réserves"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "655", Account.PROPERTY_LABEL, "Compte de l'exploitant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "658", Account.PROPERTY_LABEL, "report a nouveau"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "661", Account.PROPERTY_LABEL, "Résultat de l'exercice (bénéfice)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "664", Account.PROPERTY_LABEL, "Résultat de l'exercice (perte)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "665", Account.PROPERTY_LABEL, "Amortissements dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "667", Account.PROPERTY_LABEL, "Provision spéciale de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "668", Account.PROPERTY_LABEL, "Plus-values réinvesties"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "671", Account.PROPERTY_LABEL, "Autres provisions réglementées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "672", Account.PROPERTY_LABEL, "Provisions pour risques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "675", Account.PROPERTY_LABEL, "Provision pour litige"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "678", Account.PROPERTY_LABEL, "Provisions pour charges sociales et fiscales sur congés à pa"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "681", Account.PROPERTY_LABEL, "Autres emprunts obligataires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "686", Account.PROPERTY_LABEL, "Emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "687", Account.PROPERTY_LABEL, "Sur emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "691", Account.PROPERTY_LABEL, "Primes de remboursement des obligations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "695", Account.PROPERTY_LABEL, "Dettes rattachées a des participations (groupe)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "696", Account.PROPERTY_LABEL, "Frais détablissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "697", Account.PROPERTY_LABEL, "Frais de recherche et de développement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "698", Account.PROPERTY_LABEL, "Concessions et droits similaires; brevets; licences; marques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "699", Account.PROPERTY_LABEL, "Droit au bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "701", Account.PROPERTY_LABEL, "Fonds commercial"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "702", Account.PROPERTY_LABEL, "Autres immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "703", Account.PROPERTY_LABEL, "Matériel industriel (1)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "704", Account.PROPERTY_LABEL, "Matériel de transport"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "705", Account.PROPERTY_LABEL, "Matériel de bureau et matériel informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "706", Account.PROPERTY_LABEL, "MATERIEL INFORMATIQUE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "707", Account.PROPERTY_LABEL, "Autres titres"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "708", Account.PROPERTY_LABEL, "PRET AUX SALARIES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "709", Account.PROPERTY_LABEL, "Dépôts et cautionnements versés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "713", Account.PROPERTY_LABEL, "Créances sur Titres Immo."); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "721", Account.PROPERTY_LABEL, "Amortissements des immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "722", Account.PROPERTY_LABEL, "Frais établissement (même ventilation que celle du compte 20"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "740", Account.PROPERTY_LABEL, "Amortissements des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "751", Account.PROPERTY_LABEL, "Constructions même ventilation que celle du compte 213)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "752", Account.PROPERTY_LABEL, "Installations techniques; matériel et outillage industriels"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "753", Account.PROPERTY_LABEL, "AMORTISSEMENT MATERIEL"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "754", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations incorporell"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "755", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "758", Account.PROPERTY_LABEL, "Provisions pour dépréciation des participations et créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "761", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres immobilisations fina"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "762", Account.PROPERTY_LABEL, "Provisions pour dépréciation des matières premières (et four"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "763", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres approvisionnements"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "764", Account.PROPERTY_LABEL, "Provisions pour dépréciation des encours de production de bi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "765", Account.PROPERTY_LABEL, "Provisions pour dépréciation des en-cours de production de s"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "766", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de produits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "767", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "768", Account.PROPERTY_LABEL, "Fournisseurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "771", Account.PROPERTY_LABEL, "NF Poussin Benjamin"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "772", Account.PROPERTY_LABEL, "NF Thimel Arnaud"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "775", Account.PROPERTY_LABEL, "NF Ruchaud Julien"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "777", Account.PROPERTY_LABEL, "Mutuelle du Mans"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "778", Account.PROPERTY_LABEL, "SFR"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "781", Account.PROPERTY_LABEL, "Free Telecom"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "786", Account.PROPERTY_LABEL, "April"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "787", Account.PROPERTY_LABEL, "CM-CIC Epargne Salariale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "791", Account.PROPERTY_LABEL, "ECAC -Troadec"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "796", Account.PROPERTY_LABEL, "Fournisseurs facture à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "801", Account.PROPERTY_LABEL, "Facture à Emettre"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "802", Account.PROPERTY_LABEL, "Personnel - Rémunérations dues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "809", Account.PROPERTY_LABEL, "Regul Mutuelle à recupérer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "890", Account.PROPERTY_LABEL, "Personnel - Charges à payer et produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "891", Account.PROPERTY_LABEL, "Dettes provisionnées pour congés à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1061", Account.PROPERTY_LABEL, "Intéressement à verser aux salariés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1062", Account.PROPERTY_LABEL, "Personnel -autres charges a payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1063", Account.PROPERTY_LABEL, "Urssaf"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1064", Account.PROPERTY_LABEL, "Urssaf-csg-crds-forfait social"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1068", Account.PROPERTY_LABEL, "retraite"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1391", Account.PROPERTY_LABEL, "Pôle Emploi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1398", Account.PROPERTY_LABEL, "Retraite ARRCO"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1671", Account.PROPERTY_LABEL, "Retraite Cadre AGIRC"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1674", Account.PROPERTY_LABEL, "Mutuelle"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1675", Account.PROPERTY_LABEL, "Prévoyance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2761", Account.PROPERTY_LABEL, "charges sociales sur congés à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2768", Account.PROPERTY_LABEL, "Autres charges à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2801", Account.PROPERTY_LABEL, "URSSAF à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2803", Account.PROPERTY_LABEL, "Subventions d'expoitation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2805", Account.PROPERTY_LABEL, "Etat - Impôts sur les bénéfices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2807", Account.PROPERTY_LABEL, "Crédit Impot Recherche à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2808", Account.PROPERTY_LABEL, "IS à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2811", Account.PROPERTY_LABEL, "Crédit Impot Recherche à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2812", Account.PROPERTY_LABEL, "Crédit Impot Intéressement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2813", Account.PROPERTY_LABEL, "Etat - Taxes sur le chiffre d'affaires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2814", Account.PROPERTY_LABEL, "TVA à décaisser"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2815", Account.PROPERTY_LABEL, "TVA à décaisser 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2818", Account.PROPERTY_LABEL, "TVA sur immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2905", Account.PROPERTY_LABEL, "TVA sur immobilisations 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2906", Account.PROPERTY_LABEL, "TVA sur autres bien et services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2907", Account.PROPERTY_LABEL, "TVA/ABS 2;1%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2908", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2911", Account.PROPERTY_LABEL, "TVA sur autres biens et services 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2931", Account.PROPERTY_LABEL, "Crédit de TVA à reporter"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2932", Account.PROPERTY_LABEL, "Crédit de TVA à reporter 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2961", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2966", Account.PROPERTY_LABEL, "TVA collectée"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2967", Account.PROPERTY_LABEL, "TVA Collectée 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2968", Account.PROPERTY_LABEL, "TVA encaissée"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2971", Account.PROPERTY_LABEL, "TVA encaissée 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2972", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2973", Account.PROPERTY_LABEL, "TVA A REGUL"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2974", Account.PROPERTY_LABEL, "Remboursement de taxes sur le chiffre d'affaires demandé"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2975", Account.PROPERTY_LABEL, "TVA récupérée d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2976", Account.PROPERTY_LABEL, "Taxes sur le chif d'af sur factures non parvenues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4081", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires sur factures à établir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4084", Account.PROPERTY_LABEL, "Obligations cautionnées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4088", Account.PROPERTY_LABEL, "Autres TVA à déduire"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4091", Account.PROPERTY_LABEL, "Autres impôts; taxes et versements assimilés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4096", Account.PROPERTY_LABEL, "ETAT CHARGES A PAYER"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4097", Account.PROPERTY_LABEL, "Etat charges a payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4098", Account.PROPERTY_LABEL, "TAXE PRO"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4191", Account.PROPERTY_LABEL, "Etat charges à payer formation prof"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4196", Account.PROPERTY_LABEL, "Impôt dégrevements à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4197", Account.PROPERTY_LABEL, "Associés - Comptes courants"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4198", Account.PROPERTY_LABEL, "compte REGNIER"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4282", Account.PROPERTY_LABEL, "compte POUSSIN"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4284", Account.PROPERTY_LABEL, "compte PINEAU"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4286", Account.PROPERTY_LABEL, "Créances sur cessions d'immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4287", Account.PROPERTY_LABEL, "Subvention Oseo à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4452", Account.PROPERTY_LABEL, "Débiteurs et crediteurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4455", Account.PROPERTY_LABEL, "Produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4456", Account.PROPERTY_LABEL, "Compte d'attente"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4457", Account.PROPERTY_LABEL, "Compte d'attente"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4458", Account.PROPERTY_LABEL, "Charges à repartir sur plusieurs exercices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4686", Account.PROPERTY_LABEL, "Charges constatées d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4687", Account.PROPERTY_LABEL, "Produits constatés d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5111", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de clients"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5112", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de débiteurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5113", Account.PROPERTY_LABEL, "VMP - Actions"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5114", Account.PROPERTY_LABEL, "CAT Tonic 60"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5121", Account.PROPERTY_LABEL, "Valeurs à I'encaissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5122", Account.PROPERTY_LABEL, "Banques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6022", Account.PROPERTY_LABEL, "CAT TONIC 60"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6026", Account.PROPERTY_LABEL, "Autres organismes financiers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6031", Account.PROPERTY_LABEL, "Intérêts courus à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6032", Account.PROPERTY_LABEL, "Concours bancaires courant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6091", Account.PROPERTY_LABEL, "Crédit de mobilisation de créances commerciales (CMCC)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6092", Account.PROPERTY_LABEL, "Mobilisation de créances nées à létranger"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6094", Account.PROPERTY_LABEL, "TONIC 60- Intérets courus à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6095", Account.PROPERTY_LABEL, "Caisse siège social"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6096", Account.PROPERTY_LABEL, "Virements internes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6097", Account.PROPERTY_LABEL, "Provisions pour dépréciation des valeurs mobilières de place"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6098", Account.PROPERTY_LABEL, "Achats stockés - Matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6371", Account.PROPERTY_LABEL, "ACHATS MATERIELS INFORMATIQUES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6411", Account.PROPERTY_LABEL, "Achats stockés - Matières premières France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6412", Account.PROPERTY_LABEL, "Achats stockés - Matières premières CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6413", Account.PROPERTY_LABEL, "Fournitures consommables"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6414", Account.PROPERTY_LABEL, "achat carburant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6451", Account.PROPERTY_LABEL, "Fourniture de magasin"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6452", Account.PROPERTY_LABEL, "Fourniture de bureau"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6453", Account.PROPERTY_LABEL, "Frais postaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6454", Account.PROPERTY_LABEL, "Emballages"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6688", Account.PROPERTY_LABEL, "VARIATION DES STOCKS (approvisionnements et marchandises)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7133", Account.PROPERTY_LABEL, "Variation des stocks de matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7134", Account.PROPERTY_LABEL, "Variation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7135", Account.PROPERTY_LABEL, "Prestations de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7688", Account.PROPERTY_LABEL, "achat matériel informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27682", Account.PROPERTY_LABEL, "Achats non stockes de matières et fournitures"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27684", Account.PROPERTY_LABEL, "éléctricité"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27685", Account.PROPERTY_LABEL, "gaz"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27688", Account.PROPERTY_LABEL, "Repas"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44551", Account.PROPERTY_LABEL, "Petit équipement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44562", Account.PROPERTY_LABEL, "frais d'aménagement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44566", Account.PROPERTY_LABEL, "Fournitures de bureau"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44567", Account.PROPERTY_LABEL, "CARBURANTS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44571", Account.PROPERTY_LABEL, "Achats de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44583", Account.PROPERTY_LABEL, "achats divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44584", Account.PROPERTY_LABEL, "Achats de marchandises France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44586", Account.PROPERTY_LABEL, "Achats de marchandises CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44587", Account.PROPERTY_LABEL, "Frais accessoires d'achat"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68111", Account.PROPERTY_LABEL, "Frais accessoires d'achat France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68112", Account.PROPERTY_LABEL, "Frais accessoires d'achat CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68161", Account.PROPERTY_LABEL, "Rabais; remises et ristournes obtenus sur achats"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68162", Account.PROPERTY_LABEL, "RRR sur prestations de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68725", Account.PROPERTY_LABEL, "Sous-traitance générale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78161", Account.PROPERTY_LABEL, "Redevances de crédit-bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78162", Account.PROPERTY_LABEL, "Locations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78725", Account.PROPERTY_LABEL, "loyer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445661", Account.PROPERTY_LABEL, "Location informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445662", Account.PROPERTY_LABEL, "location mobilière"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445664", Account.PROPERTY_LABEL, "Malis sur emballages"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445665", Account.PROPERTY_LABEL, "Charges locatives et de copropriété"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445711", Account.PROPERTY_LABEL, "Entretien et réparations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445712", Account.PROPERTY_LABEL, "Entretien et réparations sur biens immo"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445714", Account.PROPERTY_LABEL, "entretien locaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445715", Account.PROPERTY_LABEL, "Primes d'assurance"); - tcontext.commit(); - } - - /** * Create some EntryBooks. * * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ - protected void initTestWithEntryBooks() throws Exception { + protected void createEntryBooks() throws Exception { // creation d'un journal EntryBook journalDesVentes = new EntryBookImpl(); journalDesVentes.setLabel("Journal des ventes"); @@ -756,14 +286,7 @@ public abstract class AbstractLimaTest { * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ - protected void initTestWithFiscalPeriod() throws Exception { - initTestWithAccounts(); - - // creation d'un journal - EntryBook journalDesVentes = new EntryBookImpl(); - journalDesVentes.setLabel("Journal des ventes"); - journalDesVentes.setCode("jdv"); - entryBookService.createEntryBook(journalDesVentes); + protected void createFiscalPeriod() throws Exception { // creation d'un exercice fiscal FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); @@ -776,9 +299,8 @@ public abstract class AbstractLimaTest { * Create FinancialTransaction with 2 entries * @throws Exception */ - protected void initTestWithFinancialTransaction() throws Exception { + protected void createFinancialTransaction() throws Exception { - initTestWithFiscalPeriod(); Account accountVmpVae = accountService.getAccountByNumber("511"); EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); 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 01505fe..9cf9a7a 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 @@ -22,7 +22,11 @@ package org.chorem.lima.business; +import org.chorem.lima.business.exceptions.AlreadyExistAccountException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; @@ -30,6 +34,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import java.util.Iterator; import java.util.List; /** @@ -46,15 +51,164 @@ public class AccountServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - initTestWithAccounts(); + createAccounts(); + } + + @Test + public void getAccountCountTest() { + Assert.assertEquals(7, accountService.getAccountCount()); + } + + @Test + public void getMasterAccountCountTest() { + Account master = accountService.getMasterAccount("501"); + Assert.assertNotNull(master); + Assert.assertEquals("50", master.getAccountNumber()); + + master = accountService.getMasterAccount("5"); + Assert.assertNull(master); + } + + @Test + public void getAccountByNumberTest() { + Account account = accountService.getAccountByNumber("501"); + Assert.assertNotNull(account); + Assert.assertEquals("501", account.getAccountNumber()); + Assert.assertEquals("Parts dans des entreprises liées", account.getLabel()); + + account = accountService.getAccountByNumber("753"); + Assert.assertNull(account); + } + + /** + * Permet de tester la méthode recherchant tous les comptes. + * + * @throws LimaException + */ + @Test + public void getAllAccountTest() throws LimaException { + List<Account> listAccount = accountService.getAllAccounts(); + Assert.assertEquals(7, listAccount.size()); + + Iterator<Account> iterator = listAccount.iterator(); + + Account account = iterator.next(); + Assert.assertEquals("5", account.getAccountNumber()); + Assert.assertEquals("Comptes financiers", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("50", account.getAccountNumber()); + Assert.assertEquals("Valeurs mobilières de placement", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("501", account.getAccountNumber()); + Assert.assertEquals("Parts dans des entreprises liées", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("502", account.getAccountNumber()); + Assert.assertEquals("Actions propres", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("51", account.getAccountNumber()); + Assert.assertEquals("Banques établissements financiers et assimilés", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("511", account.getAccountNumber()); + Assert.assertEquals("Valeurs à l'encaissement", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("512", account.getAccountNumber()); + Assert.assertEquals("Banques", account.getLabel()); + } + + /** + * Find all leaf account. + * + * @throws LimaException + */ + @Test + public void getAllLeafAccountTest() throws LimaException { + List<Account> listAccount = accountService.getAllLeafAccounts(); + Iterator<Account> iterator = listAccount.iterator(); + + Account account = iterator.next(); + Assert.assertEquals("501", account.getAccountNumber()); + Assert.assertEquals("Parts dans des entreprises liées", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("502", account.getAccountNumber()); + Assert.assertEquals("Actions propres", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("511", account.getAccountNumber()); + Assert.assertEquals("Valeurs à l'encaissement", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("512", account.getAccountNumber()); + Assert.assertEquals("Banques", account.getLabel()); + } + + /** + * Test get all subaccounts. + * + * @throws LimaException + */ + @Test + public void getAllSubAccountsTest() throws LimaException { + Account parent = accountService.getAccountByNumber("50"); + List<Account> listAccount = accountService.getAllSubAccounts(parent); + Assert.assertEquals(2, listAccount.size()); + + Iterator<Account> iterator = listAccount.iterator(); + + Account account = iterator.next(); + Assert.assertEquals("501", account.getAccountNumber()); + Assert.assertEquals("Parts dans des entreprises liées", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("502", account.getAccountNumber()); + Assert.assertEquals("Actions propres", account.getLabel()); + + parent = accountService.getAccountByNumber("501"); + listAccount = accountService.getAllSubAccounts(parent); + Assert.assertEquals(0, listAccount.size()); + } + + + + @Test + public void createOrUbdateAccountTest() throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { + Account account = new AccountImpl(); + account.setAccountNumber("503"); + account.setLabel("VMP - Actions"); + boolean updated = accountService.createOrUpdateAccount(account); + Assert.assertFalse(updated); + Assert.assertEquals(8, accountService.getAccountCount()); + account = accountService.getAccountByNumber("503"); + Assert.assertNotNull(account); + Assert.assertEquals("503", account.getAccountNumber()); + Assert.assertEquals("VMP - Actions", account.getLabel()); + + account = new AccountImpl(); + account.setAccountNumber("502"); + account.setLabel("Actions propres MAJ"); + updated = accountService.createOrUpdateAccount(account); + Assert.assertTrue(updated); + Assert.assertEquals(8, accountService.getAccountCount()); + account = accountService.getAccountByNumber("502"); + Assert.assertEquals("Actions propres MAJ", account.getLabel()); } /** * Création d'un compte dans le plan comptable. - * @throws org.chorem.lima.business.exceptions.LimaException + * + * @throws org.chorem.lima.business.exceptions.AlreadyExistAccountException + * @throws org.chorem.lima.business.exceptions.NotAllowedLabelException + * @throws org.chorem.lima.business.exceptions.InvalidAccountNumberException + * @throws org.chorem.lima.business.exceptions.NotNumberAccountNumberException */ @Test - public void createAccountTest() throws LimaException { + public void createAccountTest() throws AlreadyExistAccountException, NotAllowedLabelException, InvalidAccountNumberException, NotNumberAccountNumberException { Account myAccount = new AccountImpl(); myAccount.setAccountNumber("2"); myAccount.setLabel("Comptes d'immobilisations"); @@ -64,10 +218,13 @@ public class AccountServiceImplTest extends AbstractLimaTest { /** * Création d'un compte dans le plan comptable (echec duplication). * - * @throws LimaException + * @throws org.chorem.lima.business.exceptions.AlreadyExistAccountException + * @throws org.chorem.lima.business.exceptions.NotAllowedLabelException + * @throws org.chorem.lima.business.exceptions.InvalidAccountNumberException + * @throws org.chorem.lima.business.exceptions.NotNumberAccountNumberException */ - @Test(expected = LimaException.class) - public void createAccountEchecTest() throws LimaException { + @Test(expected = AlreadyExistAccountException.class) + public void createAccountFailAlreadyExistTest() throws AlreadyExistAccountException, NotAllowedLabelException, InvalidAccountNumberException, NotNumberAccountNumberException { Account myAccount = new AccountImpl(); myAccount.setAccountNumber("5"); myAccount.setLabel("Comptes de capitaux"); @@ -75,50 +232,38 @@ public class AccountServiceImplTest extends AbstractLimaTest { } /** - * Création d'un compte dans le plan comptable. - * - * Le test ne doit pas echoué avec les regles par defaut, mais peut echouer - * suivant certaines autres regles. - * - * @throws LimaException + * Création d'un compte dans le plan comptable (echec numéro de compte non valide). + * + * @throws org.chorem.lima.business.exceptions.AlreadyExistAccountException + * @throws org.chorem.lima.business.exceptions.NotAllowedLabelException + * @throws org.chorem.lima.business.exceptions.InvalidAccountNumberException + * @throws org.chorem.lima.business.exceptions.NotNumberAccountNumberException */ - @Test - public void testCreateAccountWrongNumber() throws LimaException { + @Test(expected = InvalidAccountNumberException.class) + public void createAccountFailInvalidAccountNumberTest() throws AlreadyExistAccountException, NotAllowedLabelException, InvalidAccountNumberException, NotNumberAccountNumberException { Account myAccount = new AccountImpl(); - myAccount.setAccountNumber("42"); // erreur de compte (4) - myAccount.setLabel("Comptes de tiers"); + myAccount.setAccountNumber(""); + myAccount.setLabel("Comptes de capitaux"); accountService.createAccount(myAccount); } /** - * Permet de tester l'ajout des comptes sous format DTO. La grande différence - * entre la création classique, l'applicaion va enregistrer tous les comptes - * enfants. - * @throws LimaException + * Création d'un compte dans le plan comptable (echec duplication). + * + * @throws org.chorem.lima.business.exceptions.AlreadyExistAccountException + * @throws org.chorem.lima.business.exceptions.NotAllowedLabelException + * @throws org.chorem.lima.business.exceptions.InvalidAccountNumberException + * @throws org.chorem.lima.business.exceptions.NotNumberAccountNumberException */ - @Test - public void createAccountWithChildTest() throws LimaException { - // Création des comptes - Account classCharges = new AccountImpl(); - classCharges.setAccountNumber("6"); - classCharges.setLabel("Comptes de charges"); - accountService.createAccount(classCharges); - - Account accountAchat = new AccountImpl(); - accountAchat.setAccountNumber("60"); - accountAchat.setLabel("Achats (sauf 603)"); - accountService.createAccount(accountAchat); + @Test(expected = NotNumberAccountNumberException.class) + public void createAccountFailNotNumberAccountNumberTest() throws AlreadyExistAccountException, NotAllowedLabelException, InvalidAccountNumberException, NotNumberAccountNumberException { + Account myAccount = new AccountImpl(); + myAccount.setAccountNumber("CINQ"); + myAccount.setLabel("Comptes de capitaux"); + accountService.createAccount(myAccount); + } - Account accountSe = new AccountImpl(); - accountSe.setAccountNumber("61"); - accountSe.setLabel("Services extérieurs"); - accountService.createAccount(accountSe); - Account accountVs = new AccountImpl(); - accountVs.setAccountNumber("603"); - accountVs.setLabel("Variations des stocks (approvisionnements et marchandises)"); - accountService.createAccount(accountVs); - } /** * Permet de tester l'ajout des comptes sous format DTO. La grande différence @@ -140,54 +285,15 @@ public class AccountServiceImplTest extends AbstractLimaTest { accountService.createAccount(accountVmp); } - /** - * Recherche d'un compte dans le plan comptable à partir d'un numéro de - * compte. - * @throws LimaException - */ - @Test - public void searchAccountTest() throws LimaException { - // On recherche le compte 5 Comptes financiers - Account result = accountService.getAccountByNumber("5"); - Assert.assertEquals("Comptes financiers", result.getLabel()); - } - - /** - * Permet de tester la méthode recherchant tous les comptes. - * - * @throws LimaException - */ - @Test - public void getAllAccountTest() throws LimaException { - List<Account> listAccount = accountService.getAllAccounts(); - Assert.assertEquals(7, listAccount.size()); - } - - /** - * Find all leaf account. - * - * @throws LimaException - */ - @Test - public void getAllLeafAccountTest() throws LimaException { - List<Account> listAccount = accountService.getAllLeafAccounts(); - Assert.assertEquals(4, listAccount.size()); - } - - /** - * Test get all subaccounts. - * - * @throws LimaException - */ @Test - public void getAllSubAccountsTest() throws LimaException { - Account parent = accountService.getAccountByNumber("50"); - List<Account> listAccount = accountService.getAllSubAccounts(parent); - Assert.assertEquals(2, listAccount.size()); - - parent = accountService.getAccountByNumber("501"); - listAccount = accountService.getAllSubAccounts(parent); - Assert.assertEquals(0, listAccount.size()); + public void updateAccountTest() throws NotNumberAccountNumberException, InvalidAccountNumberException { + Account account = new AccountImpl(); + account.setAccountNumber("502"); + account.setLabel("Actions propres MAJ"); + accountService.updateAccount(account); + Assert.assertEquals(7, accountService.getAccountCount()); + account = accountService.getAccountByNumber("502"); + Assert.assertEquals("Actions propres MAJ", account.getLabel()); } /** @@ -203,14 +309,41 @@ public class AccountServiceImplTest extends AbstractLimaTest { accountService.removeAccount(accountToRemove); // Il ne doit rester que 6 compte - Assert.assertEquals(6, accountService.getAllAccounts().size()); + List<Account> listAccount = accountService.getAllAccounts(); + Assert.assertEquals(6, listAccount.size()); + + Iterator<Account> iterator = listAccount.iterator(); + + Account account = iterator.next(); + Assert.assertEquals("5", account.getAccountNumber()); + Assert.assertEquals("Comptes financiers", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("501", account.getAccountNumber()); + Assert.assertEquals("Parts dans des entreprises liées", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("502", account.getAccountNumber()); + Assert.assertEquals("Actions propres", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("51", account.getAccountNumber()); + Assert.assertEquals("Banques établissements financiers et assimilés", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("511", account.getAccountNumber()); + Assert.assertEquals("Valeurs à l'encaissement", account.getLabel()); + + account = iterator.next(); + Assert.assertEquals("512", account.getAccountNumber()); + Assert.assertEquals("Banques", account.getLabel()); } /** * On souhaite supprimer le compte 422, ce dernier n'existe pas. La * suppression ne peut s'effectuer. * - * @throws LimaException + * @throws UsedAccountException */ @Test(expected = Exception.class) public void removeUnexistedAccountTest() throws UsedAccountException { @@ -220,8 +353,25 @@ public class AccountServiceImplTest extends AbstractLimaTest { accountService.removeAccount(account4); } + /** + * On souhaite supprimer le compte 501, ce dernier est utilisé dans une ecriture. La + * suppression ne peut s'effectuer. + * + * @throws UsedAccountException + */ + @Test(expected = UsedAccountException.class) + public void removeUsedAccountTest() throws Exception { + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); + Account account = accountService.getAccountByNumber("511"); + accountService.removeAccount(account); + } + + + @Test - public void testStringToListAccounts() throws Exception { + public void testStringToListAccounts() { List<Account> accounts = accountService.stringToListAccounts("50..511"); Assert.assertEquals(5, accounts.size()); 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 104b357..abf3005 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 @@ -50,7 +50,7 @@ public class EntryBookServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - initTestWithEntryBooks(); + createEntryBooks(); } /** 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 581b4cd..e699b7c 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 @@ -51,7 +51,10 @@ public class FinancialPeriodServiceImplTest extends AbstractLimaTest { */ @Test public void blockClosedPeriodicEntryBookTest() throws Exception { - initTestWithFinancialTransaction(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); // find one closed to close LimaCallaoTopiaPersistenceContext tcontext = context.newPersistenceContext(); 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 f25568e..c44ea97 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 @@ -54,7 +54,10 @@ public class FinancialTransactionServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - initTestWithFinancialTransaction(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); } /** 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 8e342c6..d76cd5e 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 @@ -72,7 +72,9 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportAccounts() throws Exception { - initTestWithFiscalPeriod(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); // make sure they are some accounts. List<Account> accounts = accountService.getAllAccounts(); Assert.assertTrue(accountService.getAllAccounts().size() > 0); @@ -124,7 +126,8 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportEntryBooks() throws Exception { - initTestWithEntryBooks(); + createAccounts(); + createEntryBooks(); String tmpDir = System.getProperty("java.io.tmpdir")+"/"; ImportExportResults export = exportService.exportEntryBooksAsCSV(Charset.defaultCharset().name()); @@ -159,7 +162,10 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportEntries() throws Exception { - initTestWithFinancialTransaction(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012")); List<Entry> entries = Lists.newArrayList(); @@ -213,7 +219,9 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportFiscalPeriodsAsCSV() throws Exception { - initTestWithFiscalPeriod(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); String tmpDir = System.getProperty("java.io.tmpdir")+"/"; String export = exportService.exportFiscalPeriodsAsCSV(Charset.defaultCharset().name()).getExportResults().get(0).getExportData(); @@ -246,7 +254,11 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void exportImportAllAsCSVTest() throws Exception { - initTestWithFinancialTransaction(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); + Identity identity = new IdentityImpl(); identity.setName("Code Lutin"); identity.setAddress("12 Avenue Jules Verne"); @@ -471,6 +483,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { for (String accountNumber : accountNumbers) { Account account = new AccountImpl(); account.setAccountNumber(accountNumber); + account.setLabel("Account " + accountNumber); accountService.createAccount(account); } @@ -479,6 +492,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { for (String accountNumber : _31JanuaryFTaccountNumbers) { Account account = new AccountImpl(); account.setAccountNumber(accountNumber); + account.setLabel("Account " + accountNumber); _31JanuaryFTaccounts.add(accountService.createAccount(account)); } @@ -538,7 +552,10 @@ public class ImportExportServiceTest extends AbstractLimaTest { @Test public void testExportImportEntriesEbp() throws Exception { - initTestWithFinancialTransaction(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012")); List<Entry> entries = Lists.newArrayList(); @@ -613,7 +630,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { entryBookStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/journaux.txt"); entriesStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/ecritures.txt"); - importService.importAccountFromEbp(IOUtils.toString(accountStream, "ISO-8859-1")); + ImportExportResults importExportResults = importService.importAccountFromEbp(IOUtils.toString(accountStream, "ISO-8859-1")); importService.importEntryBookFromEbp(IOUtils.toString(entryBookStream, "ISO-8859-1")); importService.importEntriesFromEbp(IOUtils.toString(entriesStream, "ISO-8859-1")); } 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 36b376b..6851851 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,7 +48,10 @@ public class ReportServiceImplTest extends AbstractLimaTest { @Before public void initTest() throws Exception { - initTestWithFinancialTransaction(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); } /** 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 a77eda6..1ea0b63 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,7 +54,10 @@ public class FinancialTransactionDAOTest extends AbstractLimaTest { @Test public void testFindAllUnbalancedTransactions() throws Exception { - initTestWithFinancialTransaction(); + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + createFinancialTransaction(); FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1233 in repository lima. See http://git.chorem.org/lima.git commit 391ae16b10a4f7645850c16a376e95a4afdfe29c Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Jun 1 15:42:03 2015 +0200 refs #1233 : test du service des journaux --- .../lima/business/EntryBookServiceImplTest.java | 146 +++++++++++++++++---- 1 file changed, 119 insertions(+), 27 deletions(-) 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 abf3005..8455e99 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 @@ -22,19 +22,17 @@ package org.chorem.lima.business; +import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; import org.chorem.lima.business.exceptions.LimaException; import org.chorem.lima.business.exceptions.UsedEntryBookException; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; -import org.chorem.lima.entity.FinancialTransaction; -import org.chorem.lima.entity.FinancialTransactionImpl; -import org.chorem.lima.entity.FiscalPeriod; -import org.chorem.lima.entity.FiscalPeriodImpl; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.text.ParseException; +import java.util.Iterator; +import java.util.List; /** * Tests pour la gestion des journaux. @@ -53,6 +51,104 @@ public class EntryBookServiceImplTest extends AbstractLimaTest { createEntryBooks(); } + @Test + public void getEntryBookByCodeTest() { + + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + Assert.assertNotNull(entryBook); + Assert.assertEquals("jdv", entryBook.getCode()); + Assert.assertEquals("Journal des ventes", entryBook.getLabel()); + + entryBook = entryBookService.getEntryBookByCode("XXX"); + Assert.assertNull(entryBook); + } + + @Test + public void getAllEntryBooksTest() throws LimaException { + List<EntryBook> allEntryBooks = entryBookService.getAllEntryBooks(); + + Assert.assertEquals(3, allEntryBooks.size()); + + Iterator<EntryBook> iterator = allEntryBooks.iterator(); + + EntryBook entryBook = iterator.next(); + Assert.assertEquals("JRN", entryBook.getCode()); + Assert.assertEquals("MyJournal", entryBook.getLabel()); + + entryBook = iterator.next(); + Assert.assertEquals("jda", entryBook.getCode()); + Assert.assertEquals("Journal des achats", entryBook.getLabel()); + + entryBook = iterator.next(); + Assert.assertEquals("jdv", entryBook.getCode()); + Assert.assertEquals("Journal des ventes", entryBook.getLabel()); + } + + @Test + public void createNewEntryBookTest() { + EntryBook newEntryBook = entryBookService.createNewEntryBook(); + Assert.assertNull(newEntryBook.getCode()); + Assert.assertNull(newEntryBook.getLabel()); + + List<EntryBook> allEntryBooks = entryBookService.getAllEntryBooks(); + + Assert.assertEquals(3, allEntryBooks.size()); + Assert.assertFalse(allEntryBooks.contains(newEntryBook)); + } + + @Test + public void createOrUpdateEntryBookTest() { + EntryBook entryBook = new EntryBookImpl(); + entryBook.setCode("jdm"); + entryBook.setLabel("journal des machins"); + boolean updated = entryBookService.createOrUpdateEntryBook(entryBook); + Assert.assertFalse(updated); + Assert.assertEquals(4, entryBookService.getAllEntryBooks().size()); + entryBook = entryBookService.getEntryBookByCode("jdm"); + Assert.assertNotNull(entryBook); + Assert.assertEquals("jdm", entryBook.getCode()); + Assert.assertEquals("journal des machins", entryBook.getLabel()); + + entryBook = new EntryBookImpl(); + entryBook.setCode("jdv"); + entryBook.setLabel("journal des ventes bis"); + updated = entryBookService.createOrUpdateEntryBook(entryBook); + Assert.assertTrue(updated); + Assert.assertEquals(4, entryBookService.getAllEntryBooks().size()); + entryBook = entryBookService.getEntryBookByCode("jdv"); + Assert.assertNotNull(entryBook); + Assert.assertEquals("jdv", entryBook.getCode()); + Assert.assertEquals("journal des ventes bis", entryBook.getLabel()); + } + + @Test + public void createEntryBookTest() throws AlreadyExistEntryBookException { + + EntryBook entryBook = new EntryBookImpl(); + entryBook.setCode("jdm"); + entryBook.setLabel("journal des machins"); + + entryBook = entryBookService.createEntryBook(entryBook); + Assert.assertEquals("jdm", entryBook.getCode()); + Assert.assertEquals("journal des machins", entryBook.getLabel()); + + List<EntryBook> allEntryBooks = entryBookService.getAllEntryBooks(); + + Assert.assertEquals(4, allEntryBooks.size()); + Assert.assertTrue(allEntryBooks.contains(entryBook)); + } + + @Test(expected = AlreadyExistEntryBookException.class) + public void createEntryBookFailAlreadyExistTest() throws AlreadyExistEntryBookException { + + EntryBook entryBook = new EntryBookImpl(); + entryBook.setCode("jdv"); + entryBook.setLabel("journal des ventes bis"); + + entryBookService.createEntryBook(entryBook); + } + + /** * Permet de tester la modification d'un journal suivant son préfixe. * @@ -60,7 +156,6 @@ public class EntryBookServiceImplTest extends AbstractLimaTest { */ @Test public void modifyJournalTest() throws LimaException { - entryBookService.getAllEntryBooks(); EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); Assert.assertNotNull(entryBook); Assert.assertEquals(JOURNAL_DES_VENTES, entryBook.getLabel()); @@ -79,21 +174,10 @@ public class EntryBookServiceImplTest extends AbstractLimaTest { * @throws LimaException */ @Test(expected=UsedEntryBookException.class) - public void deleteUsedEntryBook() throws LimaException, ParseException { + public void deleteUsedEntryBook() throws Exception { + createFiscalPeriod(); + createFinancialTransaction(); EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); - Assert.assertNotNull(entryBook); - - // make transaction used - // creation d'un exercice fiscal - FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); - fiscalPeriod.setBeginDate(df.parse("January 1, 2012")); - fiscalPeriod.setEndDate(df.parse("December 31, 2012")); - fiscalPeriodService.createFiscalPeriod(fiscalPeriod); - - FinancialTransaction financialTransaction = new FinancialTransactionImpl(); - financialTransaction.setTransactionDate(df.parse("January 1, 2012")); - financialTransaction.setEntryBook(entryBook); - financialTransactionService.createFinancialTransaction(financialTransaction); entryBookService.removeEntryBook(entryBook); } @@ -107,14 +191,22 @@ public class EntryBookServiceImplTest extends AbstractLimaTest { @Test public void deleteNonUsedEntryBookTest() throws LimaException { - EntryBook myEntryBook = new EntryBookImpl(); - myEntryBook.setCode("JRN2"); - myEntryBook.setLabel("MyJournal"); - myEntryBook = entryBookService.createEntryBook(myEntryBook); - int nbEntryBooks = entryBookService.getAllEntryBooks().size(); - entryBookService.removeEntryBook(myEntryBook); + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + + entryBookService.removeEntryBook(entryBook); + List<EntryBook> allEntryBooks = entryBookService.getAllEntryBooks(); + + Assert.assertEquals(2, allEntryBooks.size()); - Assert.assertEquals(nbEntryBooks -1, entryBookService.getAllEntryBooks().size()); + Iterator<EntryBook> iterator = allEntryBooks.iterator(); + + entryBook = iterator.next(); + Assert.assertEquals("JRN", entryBook.getCode()); + Assert.assertEquals("MyJournal", entryBook.getLabel()); + + entryBook = iterator.next(); + Assert.assertEquals("jda", entryBook.getCode()); + Assert.assertEquals("Journal des achats", entryBook.getLabel()); } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1233 in repository lima. See http://git.chorem.org/lima.git commit 89b999b2b954938b4f59ee7ff461e7ef86c17d6f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Jun 2 08:56:32 2015 +0200 refs #1233 : test du service des périodes fiscales (suppresion des fonctions de service non utilisé) --- .../lima/business/api/FinancialPeriodService.java | 4 - .../business/ejb/FinancialPeriodServiceImpl.java | 18 -- .../lima/entity/FinancialPeriodTopiaDao.java | 14 -- .../org/chorem/lima/business/AbstractLimaTest.java | 71 +++--- .../business/FinancialPeriodServiceImplTest.java | 263 +++++++++++++++++++-- .../chorem/lima/ui/account/AccountViewHandler.java | 12 +- 6 files changed, 290 insertions(+), 92 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java index 031192e..3b078dd 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java @@ -45,8 +45,6 @@ import java.util.List; public interface FinancialPeriodService { - List<FinancialPeriod> getUnblockedFinancialPeriods(); - ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook, FinancialPeriod financialPeriod); @@ -62,6 +60,4 @@ public interface FinancialPeriodService { List<FinancialPeriod> getFinancialPeriods(Date beginDate, Date endDate); - - FinancialPeriod getFinancialPeriodByNaturalIds(Date beginDate, Date endDate); } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java index 8e62747..cabbf73 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java @@ -62,16 +62,6 @@ public class FinancialPeriodServiceImpl extends AbstractLimaService implements F return result; } - /** @return all unblocked financial period */ - @Override - public List<FinancialPeriod> getUnblockedFinancialPeriods() { - - FinancialPeriodTopiaDao financialPeriodTopiaDao = getDaoHelper().getFinancialPeriodDao(); - List<FinancialPeriod>result = financialPeriodTopiaDao.findAllUnlockedOrderByBeginDate(); - - return result; - } - /** @return all financial period from a fiscal period */ @Override public List<FinancialPeriod> getFinancialPeriods(Date beginDate, Date endDate) { @@ -82,14 +72,6 @@ public class FinancialPeriodServiceImpl extends AbstractLimaService implements F return result; } - public FinancialPeriod getFinancialPeriodByNaturalIds(Date beginDate, Date endDate) { - - FinancialPeriodTopiaDao financialPeriodTopiaDao = getDaoHelper().getFinancialPeriodDao(); - FinancialPeriod result = financialPeriodTopiaDao.findByNaturalId(beginDate, endDate); - - return result; - } - @Override public ClosedPeriodicEntryBook blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws UnbalancedFinancialTransactionsException, UnfilledEntriesException, WithoutEntryBookFinancialTransactionsException, NotLockedClosedPeriodicEntryBooksException { AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); diff --git a/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java b/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java index 9582a70..e951ade 100644 --- a/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java +++ b/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java @@ -77,19 +77,5 @@ public class FinancialPeriodTopiaDao extends AbstractFinancialPeriodTopiaDao<Fin return financialPeriod; } - - /** - * Retourne toutes les periodes ordonnées par date de debut de periode. - * - * @return all period ordered - */ - public List<FinancialPeriod> findAllUnlockedOrderByBeginDate() { - - List<FinancialPeriod> financialPeriod = forLockedEquals(false) - .setOrderByArguments(FinancialPeriod.PROPERTY_BEGIN_DATE) - .findAll(); - - return financialPeriod; - } } 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 210f6c4..6ddf862 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 @@ -65,6 +65,7 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.text.DateFormat; +import java.util.Date; import java.util.Locale; import java.util.Properties; import java.util.UUID; @@ -301,32 +302,48 @@ public abstract class AbstractLimaTest { */ protected void createFinancialTransaction() 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)); } + + /** + * Create FinancialTransaction with 2 entries + * @throws Exception + */ + protected FinancialTransaction createFinancialTransaction(String entryBookCode, Date date, + String accountDebitNumber, String accountCreditNumber, + BigDecimal amount) throws Exception { + + EntryBook entryBook = entryBookService.getEntryBookByCode(entryBookCode); + Account accountDebit = accountService.getAccountByNumber(accountDebitNumber); + Account accountCredit = accountService.getAccountByNumber(accountCreditNumber); + + FinancialTransaction transaction = new FinancialTransactionImpl(); + transaction.setTransactionDate(date); + transaction.setEntryBook(entryBook); + transaction = financialTransactionService.createFinancialTransaction(transaction); + + Entry entry1 = new EntryImpl(); + entry1.setAmount(amount); + entry1.setDebit(true); + entry1.setAccount(accountDebit); + entry1.setFinancialTransaction(transaction); + entry1.setDescription("test desc"); + entry1.setVoucher("voucher"); + entry1 = financialTransactionService.createEntry(entry1); + + Entry entry2 = new EntryImpl(); + entry2.setAmount(amount); + entry2.setDebit(false); + entry2.setAccount(accountCredit); + entry2.setFinancialTransaction(transaction); + entry2.setDescription("test desc"); + entry2.setVoucher("voucher"); + entry2 = financialTransactionService.createEntry(entry2); + + transaction.setEntry(Lists.newArrayList(entry1, entry2)); + financialTransactionService.updateFinancialTransaction(transaction); + + return transaction; + } + } 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 e699b7c..5da0a81 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 @@ -22,12 +22,24 @@ package org.chorem.lima.business; +import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; +import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; +import org.chorem.lima.business.exceptions.UnfilledEntriesException; import org.chorem.lima.entity.ClosedPeriodicEntryBook; -import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao; -import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FinancialPeriod; +import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.entity.FiscalPeriod; +import org.chorem.lima.entity.FiscalPeriodImpl; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; +import org.nuiton.util.DateUtil; +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.Iterator; import java.util.List; /** @@ -44,6 +56,54 @@ import java.util.List; */ public class FinancialPeriodServiceImplTest extends AbstractLimaTest { + @Before + public void initTest() throws Exception { + createAccounts(); + createEntryBooks(); + createFiscalPeriod(); + } + + @Test + public void getClosedPeriodicEntryBookTest() throws ParseException { + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + + List<FinancialPeriod> periods = financialPeriodService.getAllFinancialPeriods(); + + ClosedPeriodicEntryBook closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, periods.get(0)); + + Assert.assertNotNull(closedPeriodicEntryBook); + Assert.assertEquals(entryBook, closedPeriodicEntryBook.getEntryBook()); + Assert.assertEquals(periods.get(0), closedPeriodicEntryBook.getFinancialPeriod()); + Assert.assertFalse(closedPeriodicEntryBook.isLocked()); + } + + @Test + public void getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriodTest() throws Exception { + + List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks = financialPeriodService.getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod(); + + Assert.assertEquals(36, closedPeriodicEntryBooks.size()); + + // creation d'un exercice fiscal + FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); + fiscalPeriod.setBeginDate(df.parse("January 1, 2013")); + fiscalPeriod.setEndDate(df.parse("December 31, 2013")); + fiscalPeriodService.createFiscalPeriod(fiscalPeriod); + + closedPeriodicEntryBooks = financialPeriodService.getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod(); + + Assert.assertEquals(72, closedPeriodicEntryBooks.size()); + + List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllFiscalPeriods(); + + fiscalPeriodService.blockFiscalPeriod(fiscalPeriods.get(0)); + + closedPeriodicEntryBooks = financialPeriodService.getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod(); + + Assert.assertEquals(36, closedPeriodicEntryBooks.size()); + } + + /** * Test de la fermeture d'une periode comptable pour un journal donné. * @@ -51,28 +111,183 @@ public class FinancialPeriodServiceImplTest extends AbstractLimaTest { */ @Test public void blockClosedPeriodicEntryBookTest() throws Exception { - createAccounts(); - createEntryBooks(); - createFiscalPeriod(); - createFinancialTransaction(); - - // find one closed to close - LimaCallaoTopiaPersistenceContext tcontext = context.newPersistenceContext(); - ClosedPeriodicEntryBookTopiaDao dao = tcontext.getClosedPeriodicEntryBookDao(); - List<ClosedPeriodicEntryBook> closedPeriodics = dao.findAll(); - tcontext.close(); - ClosedPeriodicEntryBook closedPeriodic = closedPeriodics.get(0); - - // block it - Assert.assertFalse(closedPeriodic.isLocked()); - financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodic); - - // check it's blocked - tcontext = context.newPersistenceContext(); - dao = tcontext.getClosedPeriodicEntryBookDao(); - closedPeriodic = dao.findAll().get(0); - tcontext.close(); - Assert.assertFalse(closedPeriodic.isLocked()); + + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + + List<FinancialPeriod> periods = financialPeriodService.getAllFinancialPeriods(); + + ClosedPeriodicEntryBook closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, periods.get(0)); + + financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook); + + closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, periods.get(0)); + + Assert.assertTrue(closedPeriodicEntryBook.isLocked()); } + @Test(expected = UnbalancedFinancialTransactionsException.class) + public void blockClosedPeriodicEntryBookFailUnbalanceTest() throws Exception { + + FinancialTransaction transaction = createFinancialTransaction("jdv", df.parse("January 4, 2012"), "511", "501", BigDecimal.valueOf(42.0)); + + Entry entry = transaction.getEntry().iterator().next(); + entry.setAmount(BigDecimal.valueOf(12)); + + financialTransactionService.updateEntry(entry); + + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + + List<FinancialPeriod> periods = financialPeriodService.getAllFinancialPeriods(); + + ClosedPeriodicEntryBook closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, periods.get(0)); + + financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook); + } + + @Test(expected = UnfilledEntriesException.class) + public void blockClosedPeriodicEntryBookFailUnfilledEntriesTest() throws Exception { + + FinancialTransaction transaction = createFinancialTransaction("jdv", df.parse("January 4, 2012"), "511", "501", BigDecimal.valueOf(42.0)); + + Entry entry = transaction.getEntry().iterator().next(); + entry.setDescription(""); + + financialTransactionService.updateEntry(entry); + + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + + List<FinancialPeriod> periods = financialPeriodService.getAllFinancialPeriods(); + + ClosedPeriodicEntryBook closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, periods.get(0)); + + financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook); + } + + @Test(expected = Exception.class) + public void blockClosedPeriodicEntryBookFailNoEntryBoockTest() throws Exception { + + FinancialTransaction transaction = createFinancialTransaction("jdv", df.parse("January 4, 2012"), "511", "501", BigDecimal.valueOf(42.0)); + + transaction.setEntryBook(null); + + financialTransactionService.updateFinancialTransaction(transaction); + + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + + List<FinancialPeriod> periods = financialPeriodService.getAllFinancialPeriods(); + + ClosedPeriodicEntryBook closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, periods.get(0)); + + financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook); + } + + @Test(expected = NotLockedClosedPeriodicEntryBooksException.class) + public void blockClosedPeriodicEntryBookFailNoLockedPréviousTest() throws Exception { + + EntryBook entryBook = entryBookService.getEntryBookByCode("jdv"); + + List<FinancialPeriod> periods = financialPeriodService.getAllFinancialPeriods(); + + ClosedPeriodicEntryBook closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, periods.get(4)); + + financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook); + } + + @Test + public void getAllFinancialPeriodsTest() throws Exception { + + // creation d'un exercice fiscal + FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); + fiscalPeriod.setBeginDate(df.parse("January 1, 2013")); + fiscalPeriod.setEndDate(df.parse("December 31, 2013")); + fiscalPeriodService.createFiscalPeriod(fiscalPeriod); + + List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllFiscalPeriods(); + + fiscalPeriodService.blockFiscalPeriod(fiscalPeriods.get(0)); + + + List<FinancialPeriod> periods = financialPeriodService.getAllFinancialPeriods(); + + Assert.assertEquals(24, periods.size()); + + Iterator<FinancialPeriod> iterator = periods.iterator(); + + FinancialPeriod period; + period = iterator.next(); + Assert.assertEquals(df.parse("January 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("January 31, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("February 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("February 29, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("March 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("March 31, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("April 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("April 30, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("May 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("May 31, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("June 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("June 30, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("July 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("July 31, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("August 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("August 31, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("September 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("September 30, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("October 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("October 31, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("November 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("November 30, 2012")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("December 1, 2012"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("December 31, 2012")), period.getEndDate()); + + period = iterator.next(); + Assert.assertEquals(df.parse("January 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("January 31, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("February 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("February 28, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("March 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("March 31, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("April 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("April 30, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("May 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("May 31, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("June 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("June 30, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("July 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("July 31, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("August 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("August 31, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("September 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("September 30, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("October 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("October 31, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("November 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("November 30, 2013")), period.getEndDate()); + period = iterator.next(); + Assert.assertEquals(df.parse("December 1, 2013"), period.getBeginDate()); + Assert.assertEquals(DateUtil.getEndOfDay(df.parse("December 31, 2013")), period.getEndDate()); + } + + } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java index d4e683f..9680deb 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java @@ -25,18 +25,17 @@ package org.chorem.lima.ui.account; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaSwingConfig; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.ImportService; 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.business.exceptions.UsedAccountException; import org.chorem.lima.entity.Account; import org.chorem.lima.enums.AccountsChartEnum; import org.chorem.lima.enums.ImportExportEnum; -import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.ui.importexport.ImportExport; import org.chorem.lima.util.ErrorHelper; import org.jdesktop.swingx.JXTreeTable; @@ -45,7 +44,12 @@ import org.jdesktop.swingx.treetable.DefaultTreeTableModel; import org.jdesktop.swingx.treetable.MutableTreeTableNode; import org.jdesktop.swingx.treetable.TreeTableNode; -import javax.swing.*; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; +import javax.swing.InputMap; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.KeyStroke; import javax.swing.tree.TreePath; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; @@ -284,8 +288,6 @@ public class AccountViewHandler implements ServiceListener { errorHelper.showErrorMessage(t("lima.account.add.error.InvalidAccountNumber", e.getAccountNumber())); } catch (NotNumberAccountNumberException e) { errorHelper.showErrorMessage(t("lima.account.error.notNumberAccountNumber", e.getAccountNumber())); - } catch (NotAllowedLabelException e) { - errorHelper.showErrorMessage(t("lima.error.notAllowedLabel", e.getLabel())); } finally { dialog.dispose(); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm