Author: vsalaun Date: 2011-07-18 11:49:01 +0200 (Mon, 18 Jul 2011) New Revision: 3228 Url: http://chorem.org/repositories/revision/lima/3228 Log: add to i18n all LimaBusinessExceptions from FiscalPeriodServiceImpl and translate them to French Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2011-07-18 08:42:25 UTC (rev 3227) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2011-07-18 09:49:01 UTC (rev 3228) @@ -71,8 +71,8 @@ // Check if the numberaccount is not blank if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber", + account.getAccountNumber())); } } @@ -84,8 +84,8 @@ throws LimaException { // check the number account is not empty if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber") - + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber", + account.getAccountNumber())); } //check if parentaccount have no subaccount if (masterAccount.getSubAccounts().size() > 0){ @@ -466,15 +466,15 @@ if (log.isErrorEnabled()) { log.error("Exception during query", cause); } - throw new LimaException(_("lima-business.common.queryerror") + " " + cause); + throw new LimaException(_("lima-business.common.queryerror", cause)); } @Override public void updateAccountRules(Account masterAccount, Account account) throws LimaException { // Check if the numberaccount is not blank if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber") - + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber", + account.getAccountNumber())); } } @@ -482,8 +482,8 @@ public void updateSubLedgerRules(Account account) throws LimaException { // check the number account is not empty if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber") - + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber", + account.getAccountNumber())); } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2011-07-18 08:42:25 UTC (rev 3227) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2011-07-18 09:49:01 UTC (rev 3228) @@ -65,21 +65,21 @@ // Check if the number account is type numeric if (!StringUtils.isNumeric(account.getAccountNumber())){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric", + account.getAccountNumber())); } // Check if the number account start with the number of the master account if (masterAccount!=null && !account.getAccountNumber().startsWith( masterAccount.getAccountNumber())){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster", + account.getAccountNumber())); } // Check if master account have a number between 1 to 8 if (masterAccount==null && !account.getAccountNumber().matches("[1-8]")){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror", + account.getAccountNumber())); } } @@ -89,21 +89,21 @@ // Check if the number account is type numeric if (!StringUtils.isNumeric(account.getAccountNumber())){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric", + account.getAccountNumber())); } // Check if the number account start with the number of the master account if (masterAccount!=null && !account.getAccountNumber().startsWith( masterAccount.getAccountNumber())){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster", + account.getAccountNumber())); } // Check if master account have a number between 1 to 8 if (masterAccount==null && !account.getAccountNumber().matches("[1-8]")){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror", + account.getAccountNumber())); } } @@ -115,8 +115,8 @@ // check if the master account number is begin with 4 if (!masterAccount.getAccountNumber().startsWith("4")){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.masteraccountnumbererror") - + " : " + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.franceaccountingrules.masteraccountnumbererror", + account.getAccountNumber())); } } @@ -322,6 +322,6 @@ if (log.isErrorEnabled()) { log.error("Exception during query", cause); } - throw new LimaException(_("lima-business.common.queryerror") + " " + cause); + throw new LimaException(_("lima-business.common.queryerror", cause)); } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2011-07-18 08:42:25 UTC (rev 3227) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2011-07-18 09:49:01 UTC (rev 3228) @@ -25,6 +25,8 @@ package org.chorem.lima.business.ejb; +import static org.nuiton.i18n.I18n._; + import org.apache.commons.logging.Log; import org.chorem.lima.business.LimaException; import org.nuiton.topia.TopiaContext; @@ -64,7 +66,7 @@ if (log.isErrorEnabled()) { log.error("Exception during query", cause); } - throw new LimaException("Exception during query", cause); + throw new LimaException(_("lima-business.common.queryerror", cause)); } /** @@ -82,7 +84,7 @@ if (log != null && log.isErrorEnabled()) { log.error("Can't close transaction", ex); } - throw new LimaException("Can't close transaction", ex); + throw new LimaException(_("lima-business.common.transactionerror", ex)); } } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2011-07-18 08:42:25 UTC (rev 3227) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2011-07-18 09:49:01 UTC (rev 3228) @@ -288,7 +288,8 @@ transaction = beginTransaction(); if (fiscalPeriod.getLocked()){ - throw new LimaBusinessException("Fiscal Period already blocked"); + //throw new LimaBusinessException("Fiscal Period already blocked"); + throw new LimaBusinessException(_("lima-business.fiscalperiod.fiscalperiodalreadyblocked")); } //check rules accountingRules.blockFiscalPeriodRules(fiscalPeriod, transaction); @@ -405,7 +406,7 @@ } //check if the last financial period isn't blocked if (lastFPeriod.getLocked()) { - throw new LimaException("The last financial period from the fiscal period is blocked"); + throw new LimaBusinessException(_("lima-business.fiscalperiod.previousfiscalperiodalreadyblocked")); } FinancialPeriod beginfinancialPeriod = null; @@ -434,7 +435,7 @@ } } if (!found) { - throw new LimaException("Can't set financial period on the following fiscal year "); + throw new LimaBusinessException(_("lima-business.fiscalperiod.newfinancialperioderror")); } } Modified: trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties =================================================================== --- trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2011-07-18 08:42:25 UTC (rev 3227) +++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2011-07-18 09:49:01 UTC (rev 3228) @@ -5,7 +5,8 @@ lima-Business.defaultaccountingrules.updatenewentryerror=Can't update entry \: financialperiod of this entrybook is closed lima-business.account.accountalreardyexist=An account already exists with this number \: %s lima-business.common.failed=FAILED \: %s \n -lima-business.common.queryerror=Exception during query +lima-business.common.queryerror=Exception during query \: %s +lima-business.common.transactionerror=Can't close transaction \: %s lima-business.defaultaccountingrules.allentrybookclosed=All EntryBook of this financialperiod are closed lima-business.defaultaccountingrules.blockerrorequillibrate=Can't block financialperiod/entrybook contain financialtransaction not equilibrate lima-business.defaultaccountingrules.dateaftererror=The date is after the fiscal period @@ -16,7 +17,7 @@ lima-business.defaultaccountingrules.financialnewdateblocked=The financial period of the new date is blocked lima-business.defaultaccountingrules.financialperiodblocked=The financial period is blocked lima-business.defaultaccountingrules.financialtransactionblocked=The financial period of this transaction is blocked -lima-business.defaultaccountingrules.invalidaccountnumber=Invalid AccountNumber +lima-business.defaultaccountingrules.invalidaccountnumber=Invalid Account Number \: %d lima-business.defaultaccountingrules.missingelements=Can't block financialperiod / missing elements in transactions for this FinancialPeriod/EntryBook lima-business.defaultaccountingrules.missingentrybook=Can't block financialperiod / missing EntryBook in transactions lima-business.defaultaccountingrules.subledgererror=Subledger must create on a account whithout subaccount @@ -59,9 +60,12 @@ lima-business.financialstatement.check.warn=Warning this function is just an help.\n Many accounts must no calculate on Financial statement.\n Some account marked not found is normally.\n\n lima-business.financialtransaction.retainedearnings.description=Retained earnings lima-business.financialtransaction.retainedearnings.voucher=According to general meeting -lima-business.franceaccountingrules.accountnumbernotmaster=Account Number not begin with the number account master -lima-business.franceaccountingrules.accountnumbernotnumeric=Account Number is not numeric -lima-business.franceaccountingrules.accountstartnumbererror=Master account is not a digit between 1 to 8 +lima-business.fiscalperiod.fiscalperiodalreadyblocked=Fiscal Period already blocked +lima-business.fiscalperiod.newfinancialperioderror=Can't set financial period on the following fiscal year +lima-business.fiscalperiod.previousfiscalperiodalreadyblocked=The last financial period from the fiscal period is blocked +lima-business.franceaccountingrules.accountnumbernotmaster=Account Number not begin with the number account master \: %d +lima-business.franceaccountingrules.accountnumbernotnumeric=Account Number is not numeric \: %s +lima-business.franceaccountingrules.accountstartnumbererror=Master account is not a digit between 1 to 8 \: %d lima-business.franceaccountingrules.antefinancialperiodnotblockedentrybook=The previous financial periods for this entrybook must be blocked before this lima-business.franceaccountingrules.antefiscalperiodnotblocked=The ante fiscal period is not locked lima-business.franceaccountingrules.masteraccountnumbererror=Master Account Number is not a thirdpart account Modified: trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties =================================================================== --- trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2011-07-18 08:42:25 UTC (rev 3227) +++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2011-07-18 09:49:01 UTC (rev 3228) @@ -5,7 +5,8 @@ lima-Business.defaultaccountingrules.updatenewentryerror=Impossible de mettre à jour l'entrée \: la période financière de ce nouveau journal est bloquée lima-business.account.accountalreardyexist=Un compte existe déjà avec ce numéro \: %s lima-business.common.failed=Échec \: %s \n -lima-business.common.queryerror=Exception lors de la requête +lima-business.common.queryerror=Exception lors de la requête \: %s +lima-business.common.transactionerror=Impossible de fermer la transaction \: %s lima-business.defaultaccountingrules.allentrybookclosed=Tous les journaux de cette période financière sont fermés lima-business.defaultaccountingrules.blockerrorequillibrate=Impossible de bloquer la période financière / le journal, il contient des transactions non équilibrées lima-business.defaultaccountingrules.dateaftererror=La date est antérieure à la période fiscale @@ -16,7 +17,7 @@ lima-business.defaultaccountingrules.financialnewdateblocked=La période financière de cette nouvelle date est bloquée lima-business.defaultaccountingrules.financialperiodblocked=La période financière est bloquée lima-business.defaultaccountingrules.financialtransactionblocked=La période financière de cette transaction est bloquée -lima-business.defaultaccountingrules.invalidaccountnumber=Numéro de compte invalide +lima-business.defaultaccountingrules.invalidaccountnumber=Numéro de compte invalide \: %d lima-business.defaultaccountingrules.missingelements=Impossible de bloquer la période financière / il manque des éléments dans des transactions lima-business.defaultaccountingrules.missingentrybook=Impossible de bloquer la période financière / il mmanque un journal dans une transaction lima-business.defaultaccountingrules.subledgererror=Un livre auxilliaire doit être créé sur un compte contenant aucun sous-compte @@ -59,9 +60,12 @@ lima-business.financialstatement.check.warn=Attention cette fonctionnalité n'est qu'une aide utilisateur.\n Certains comptes ne doivent pas être présent au bilan et compte de résultat.\n Il est donc normal que des comptes sont marqués comme introuvable.\n\n lima-business.financialtransaction.retainedearnings.description=Report à nouveau lima-business.financialtransaction.retainedearnings.voucher=Selon décision AG -lima-business.franceaccountingrules.accountnumbernotmaster=Le numéro de compte doit reprendre le numéro de compte général -lima-business.franceaccountingrules.accountnumbernotnumeric=Le numéro de copte n'est pas numéric -lima-business.franceaccountingrules.accountstartnumbererror=Le numéro du copte général n'est pas compris entre 1 et 8 +lima-business.fiscalperiod.fiscalperiodalreadyblocked=La période fiscale est déjà bloquée +lima-business.fiscalperiod.newfinancialperioderror=Impossible de définir la période financière sur la période fiscale suivante +lima-business.fiscalperiod.previousfiscalperiodalreadyblocked=La dernière période financière de la période fiscale est bloquée +lima-business.franceaccountingrules.accountnumbernotmaster=Le numéro de compte doit reprendre le numéro de compte général \: %d +lima-business.franceaccountingrules.accountnumbernotnumeric=Le numéro de copte n'est pas numéric \: %s +lima-business.franceaccountingrules.accountstartnumbererror=Le numéro du copte général n'est pas compris entre 1 et 8 \: %d lima-business.franceaccountingrules.antefinancialperiodnotblockedentrybook=Les périodes financières précédentes pour ce journal doivent être bloquées avant lima-business.franceaccountingrules.antefiscalperiodnotblocked=La période fiscale précédante n'est pas bloquée lima-business.franceaccountingrules.masteraccountnumbererror=Le numéro du compte général n'est pas un compte de tiers