r3226 - in trunk/lima-business/src/main: java/org/chorem/lima/business/accountingrules resources/i18n
Author: vsalaun Date: 2011-07-18 10:03:17 +0200 (Mon, 18 Jul 2011) New Revision: 3226 Url: http://chorem.org/repositories/revision/lima/3226 Log: add to i18n all LimaBusinessExceptions from DefaultAccountingRules and translate them to French Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.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-13 14:47:32 UTC (rev 3225) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2011-07-18 08:03:17 UTC (rev 3226) @@ -25,6 +25,8 @@ package org.chorem.lima.business.accountingrules; +import static org.nuiton.i18n.I18n._; + import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -69,8 +71,8 @@ // Check if the numberaccount is not blank if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException("Invalid AccountNumber : " - + account.getAccountNumber()); + throw new LimaBusinessException(_("lima-business.accountingrules.invalidaccountnumber") + + " : " + account.getAccountNumber()); } } @@ -82,13 +84,12 @@ throws LimaException { // check the number account is not empty if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException("Invalid AccountNumber : " + throw new LimaBusinessException(_("lima-business.accountingrules.invalidaccountnumber") + account.getAccountNumber()); } //check if parentaccount have no subaccount if (masterAccount.getSubAccounts().size() > 0){ - throw new LimaBusinessException( - "Subledger must create on a account whithout subaccount : "); + throw new LimaBusinessException(_("lima-business.accountingrules.subledgererror")); } } @@ -99,8 +100,7 @@ public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException { //check if the enddate period is after the begindate period if (fiscalPeriod.getEndDate().before(fiscalPeriod.getBeginDate())){ - throw new LimaBusinessException( - "The enddate is before the begindate"); + throw new LimaBusinessException(_("lima-business.accountingrules.enddateerror")); } return null; } @@ -126,7 +126,7 @@ // Check if account have entries int nbentries = entryDAO.findAllByAccount(account).size(); if (nbentries != 0) { - throw new LimaBusinessException("Can't delete Account with entries"); + throw new LimaBusinessException(_("lima-business.accountingrules.deleteaccounterror")); } } catch (TopiaException ex) { @@ -144,7 +144,7 @@ // Check if entrybook have entries int nbfinancialtransaction = financialTransactionDAO.findAllByEntryBook(entryBook).size(); if (nbfinancialtransaction != 0) { - throw new LimaBusinessException("Can't delete entryBook with financialtransaction"); + throw new LimaBusinessException(_("lima-business.accountingrules.deleteentrybookerror")); } } catch (TopiaException ex) { @@ -161,7 +161,7 @@ public void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException { //check financial period locked if (financialTransaction.getFinancialPeriod().getLocked()){ - throw new LimaBusinessException("The financial period is blocked"); + throw new LimaBusinessException(_("lima-business.accountingrules.financialperiodblocked")); } //check all entrybook of his financial period are blocked @@ -186,7 +186,7 @@ } } if (entryBooks.size() == closedEntryBooks.size()){ - throw new LimaBusinessException("All EntryBook of this financialperiod are closed"); + throw new LimaBusinessException(_("lima-business.accountingrules.allentrybookclosed")); } } catch (TopiaException eee) { @@ -218,7 +218,7 @@ result = financialTransactionDAO.findAllByQuery(query); if (result.size()>0){ - throw new LimaBusinessException("Can't block financialperiod/entrybook contain financialtransaction not equilibrate"); + throw new LimaBusinessException(_("lima-business.accountingrules.blockerrorequillibrate")); } } catch (TopiaException ex) { @@ -244,7 +244,7 @@ result = financialTransactionDAO.findAllByQuery(query); if (result.size()>0){ - throw new LimaBusinessException("Can't block financialperiod / missing elements in transactions for this FinancialPeriod/EntryBook"); + throw new LimaBusinessException(_("lima-business.accountingrules.missingelements")); } } catch (TopiaException ex) { @@ -268,7 +268,7 @@ result = financialTransactionDAO.findAllByQuery(query); if (result.size()>0){ - throw new LimaBusinessException("Can't block financialperiod / missing EntryBook in transactions"); + throw new LimaBusinessException(_("lima-business.accountingrules.missingentrybook")); } } catch (TopiaException ex) { @@ -299,7 +299,7 @@ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( entryOld.getFinancialTransaction().getEntryBook(), financialPeriod); if (closedPeriodicEntryBook.getLocked()){ - throw new LimaBusinessException("Can't update entry : financialperiod of this entrybook is closed"); + throw new LimaBusinessException(_("lima-Business.accountingrules.updateentryerror")); } //third case @@ -309,7 +309,7 @@ // Check 2 & 3 cases if (closedPeriodicEntryBook2.getLocked()){ - throw new LimaBusinessException("Can't update entry : financialperiod of this entrybook is closed"); + throw new LimaBusinessException(_("lima-Business.accountingrules.updateentryerror")); } } @@ -337,12 +337,12 @@ //1. check old financial period locked if (financialPeriodOld.getLocked()){ - throw new LimaBusinessException("The financial period of this transaction is blocked"); + throw new LimaBusinessException(_("lima-business.accountingrules.financialtransactionblocked")); } //2. check new financial period locked if (financialPeriod.getLocked()){ - throw new LimaBusinessException("The financial period of the new date is blocked"); + throw new LimaBusinessException(_("lima-business.accountingrules.financialnewdateblocked")); } try { @@ -355,7 +355,7 @@ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( financialTransactionOld.getEntryBook(), financialPeriod); if (closedPeriodicEntryBookOld.getLocked()){ - throw new LimaBusinessException("Can't update financialtransaction : financialperiod of this entrybook is closed"); + throw new LimaBusinessException(_("lima-Business.accountingrules.updateentryerror")); } //4. the new entrybook belong to a blocked closedPeriodicEntryBook @@ -363,7 +363,7 @@ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( financialTransaction.getEntryBook(), financialPeriod); if (closedPeriodicEntryBook.getLocked()){ - throw new LimaBusinessException("Can't update financialtransaction : financialperiod of new entrybook is closed"); + throw new LimaBusinessException(_("lima-Business.accountingrules.updatenewentryerror")); } //5. the actual entrybook belong to a blocked closedPeriodicEntryBook @@ -371,7 +371,7 @@ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( financialTransactionOld.getEntryBook(), financialPeriodOld); if (closedPeriodicEntryBookOld2.getLocked()){ - throw new LimaBusinessException("Can't update financialtransaction : the new financialperiod of this entrybook is closed"); + throw new LimaBusinessException(_("lima-Business.accountingrules.updatefinancialtransactionperioderror")); } //6. the new entrybook belong to a blocked closedPeriodicEntryBook @@ -379,7 +379,7 @@ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( financialTransaction.getEntryBook(), financialPeriodOld); if (closedPeriodicEntryBook2.getLocked()){ - throw new LimaBusinessException("Can't update financialtransaction : this financialperiod of new entrybook is closed"); + throw new LimaBusinessException(_("lima-Business.accountingrules.updatefinancialtransactionnewperioderror")); } @@ -398,10 +398,10 @@ Date financialTransactionDate = financialTransaction.getTransactionDate(); if (financialTransactionDate.before(beginDateFiscalPeriod)){ - throw new LimaBusinessException("The date is before the fiscal period"); + throw new LimaBusinessException(_("lima-business.accountingrules.datebeforeerror")); } if (financialTransactionDate.after(endDateFiscalPeriod)){ - throw new LimaBusinessException("The date is after the fiscal period"); + throw new LimaBusinessException(_("lima-business.accountingrules.dateaftererror")); } /* @@ -466,14 +466,14 @@ if (log.isErrorEnabled()) { log.error("Exception during query", cause); } - throw new LimaException("Exception during query", 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("Invalid AccountNumber : " + throw new LimaBusinessException(_("lima-business.accountingrules.invalidaccountnumber") + account.getAccountNumber()); } } @@ -482,7 +482,7 @@ public void updateSubLedgerRules(Account account) throws LimaException { // check the number account is not empty if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException("Invalid AccountNumber : " + throw new LimaBusinessException(_("lima-business.accountingrules.invalidaccountnumber") + account.getAccountNumber()); } } 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-13 14:47:32 UTC (rev 3225) +++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2011-07-18 08:03:17 UTC (rev 3226) @@ -1,6 +1,25 @@ = +lima-Business.accountingrules.updateentryerror=Can't update entry \: financialperiod of this entrybook is closed +lima-Business.accountingrules.updatefinancialtransactionnewperioderror=Can't update financialtransaction \: this financialperiod of new entrybook is closed +lima-Business.accountingrules.updatefinancialtransactionperioderror=Can't update financialtransaction \: the new financialperiod of this entrybook is closed +lima-Business.accountingrules.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.accountingrules.allentrybookclosed=All EntryBook of this financialperiod are closed +lima-business.accountingrules.blockerrorequillibrate=Can't block financialperiod/entrybook contain financialtransaction not equilibrate +lima-business.accountingrules.dateaftererror=The date is after the fiscal period +lima-business.accountingrules.datebeforeerror=The date is before the fiscal period +lima-business.accountingrules.deleteaccounterror=Can't delete Account with entries +lima-business.accountingrules.deleteentrybookerror=Can't delete entryBook with financialtransaction +lima-business.accountingrules.enddateerror=The end date is before the begin date +lima-business.accountingrules.financialnewdateblocked=The financial period of the new date is blocked +lima-business.accountingrules.financialperiodblocked=The financial period is blocked +lima-business.accountingrules.financialtransactionblocked=The financial period of this transaction is blocked +lima-business.accountingrules.invalidaccountnumber=Invalid AccountNumber +lima-business.accountingrules.missingelements=Can't block financialperiod / missing elements in transactions for this FinancialPeriod/EntryBook +lima-business.accountingrules.missingentrybook=Can't block financialperiod / missing EntryBook in transactions +lima-business.accountingrules.subledgererror=Subledger must create on a account whithout subaccount lima-business.common.failed=FAILED \: %s \n +lima-business.common.queryerror=Exception during query lima-business.document.accountnumber=Account N° lima-business.document.amounts=Amounts lima-business.document.balance=Balance 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-13 14:47:32 UTC (rev 3225) +++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2011-07-18 08:03:17 UTC (rev 3226) @@ -1,6 +1,25 @@ = +lima-Business.accountingrules.updateentryerror=Impossible de mettre à jour l'entrée \: la période financière de ce journal est bloquée +lima-Business.accountingrules.updatefinancialtransactionnewperioderror=Impossible de mettre à jour la transaction \: la période financière de ce nouveau journal est bloquée +lima-Business.accountingrules.updatefinancialtransactionperioderror=Impossible de mettre à jour la transaction \: la période financière de ce journal est bloquée +lima-Business.accountingrules.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.accountingrules.allentrybookclosed=Tous les journaux de cette période financière sont fermés +lima-business.accountingrules.blockerrorequillibrate=Impossible de bloquer la période financière / le journal, il contient des transactions non équilibrées +lima-business.accountingrules.dateaftererror=La date est antérieure à la période fiscale +lima-business.accountingrules.datebeforeerror=La date est postérieure à la période fiscale +lima-business.accountingrules.deleteaccounterror=Impossible de supprimer un comte contenant des entrées +lima-business.accountingrules.deleteentrybookerror=Impossible de supprimer un journal contenant des transactions +lima-business.accountingrules.enddateerror=La date de fin est antérieure à la date de début +lima-business.accountingrules.financialnewdateblocked=La période financière de cette nouvelle date est bloquée +lima-business.accountingrules.financialperiodblocked=La période financière est bloquée +lima-business.accountingrules.financialtransactionblocked=La période financière de cette transaction est bloquée +lima-business.accountingrules.invalidaccountnumber=Numéro de compte invalide +lima-business.accountingrules.missingelements=Impossible de bloquer la période financière / il manque des éléments dans des transactions +lima-business.accountingrules.missingentrybook=Impossible de bloquer la période financière / il mmanque un journal dans une transaction +lima-business.accountingrules.subledgererror=Un livre auxilliaire doit être créé sur un compte contenant aucun sous-compte lima-business.common.failed=Échec \: %s \n +lima-business.common.queryerror=Exception lors de la requête lima-business.document.accountnumber=N° Compte lima-business.document.amounts=Totaux lima-business.document.balance=Balance
participants (1)
-
vsalaun@users.chorem.org