Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 1853 discussions
r3853 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by sbavencoff@users.chorem.org 18 Jul '14
by sbavencoff@users.chorem.org 18 Jul '14
18 Jul '14
Author: sbavencoff
Date: 2014-07-18 17:33:15 +0200 (Fri, 18 Jul 2014)
New Revision: 3853
Url: http://forge.chorem.org/projects/lima/repository/revisions/3853
Log:
refs #1044 : financial transaction
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-07-18 15:02:19 UTC (rev 3852)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-07-18 15:33:15 UTC (rev 3853)
@@ -30,8 +30,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.filter.FilterGenerator;
-import org.chorem.lima.filter.FinancialTransactionFilter;
import org.chorem.lima.beans.FinancialTransactionCondition;
import org.chorem.lima.beans.LetteringFilter;
import org.chorem.lima.business.AccountingRules;
@@ -44,7 +42,6 @@
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.utils.LetteringComparator;
-import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryImpl;
@@ -53,6 +50,8 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionTopiaDao;
import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.filter.FilterGenerator;
+import org.chorem.lima.filter.FinancialTransactionFilter;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -83,25 +82,14 @@
@TransactionAttribute
public class FinancialTransactionServiceImpl extends AbstractLimaService implements FinancialTransactionService {
-// @EJB
-// protected FinancialPeriodService financialPeriodService;
-
-// @EJB
-// protected ReportService reportService;
-
- //@EJB
- //protected EntryBookService entryBookService;
-
@EJB
protected AccountService accountService;
-// @EJB
-// protected OptionsService optionsService;
-
protected static final Log log = LogFactory.getLog(FinancialTransactionServiceImpl.class);
@Override
- public FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction) throws LockedFinancialPeriodException, LockedEntryBookException {
+ public FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction)
+ throws LockedFinancialPeriodException, LockedEntryBookException {
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
@@ -279,19 +267,17 @@
protected void amountsCalculation( BigDecimal resultOfFirstSecondEntrySubtraction, Entry sameAccountEntry, Entry costOrProductEntry) {
sameAccountEntry.setAmount(resultOfFirstSecondEntrySubtraction.abs());
costOrProductEntry.setAmount(resultOfFirstSecondEntrySubtraction.abs());
- Account costOrProductAccount;
/*-1 for less than 0 : credit*/
if (resultOfFirstSecondEntrySubtraction.compareTo(BigDecimal.ZERO) == -1) {
sameAccountEntry.setDebit(true);
costOrProductEntry.setDebit(false);
- costOrProductAccount = accountService.getAccountByNumber("758");
+ costOrProductEntry.setAccount(accountService.getAccountByNumber("758"));
} else { /*Greater than 0 : debit*/
sameAccountEntry.setDebit(false);
costOrProductEntry.setDebit(true);
- costOrProductAccount = accountService.getAccountByNumber("658");
+ costOrProductEntry.setAccount(accountService.getAccountByNumber("658"));
}
- costOrProductEntry.setAccount(costOrProductAccount);
}
public String findLastLetter(List<String> letters) {
@@ -364,23 +350,10 @@
@Override
public List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) {
- //List<FinancialTransaction> checkedResult = new ArrayList<FinancialTransaction>();
-
FinancialTransactionTopiaDao financialTransactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
List<FinancialTransaction> result = financialTransactionTopiaDao.getAllIncorrectTransaction(fiscalPeriod.getBeginDate(),
fiscalPeriod.getEndDate(), null);
- /*for (FinancialTransaction fTransaction : result) {
- BigDecimal credit = fTransaction.getAmountCredit();
- BigDecimal debit = fTransaction.getAmountDebit();
- credit = credit.setScale(optionsService.getScale(),
- BigDecimal.ROUND_HALF_UP);
- debit = debit.setScale(optionsService.getScale(),
- BigDecimal.ROUND_HALF_UP);
- if (credit.equals(debit)) {
- checkedResult.add(fTransaction);
- }
- }*/
return result;
}
@@ -434,10 +407,8 @@
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
- //FIXME mallon 22/06/2012 : Revoir l'utilisation du rattachement à la session et celle des deux objets 'financialTransactionOld'
- //et 'financialTransaction'
FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
- FinancialTransaction financialTransactionOld = transactionTopiaDao.findByTopiaId(financialTransaction.getTopiaId());
+ FinancialTransaction financialTransactionOld = transactionTopiaDao.forTopiaIdEquals(financialTransaction.getTopiaId()).findUnique();
accountingRules.updateFinancialTransactionDateRules(financialTransaction, financialTransactionOld);
@@ -461,14 +432,14 @@
accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(financialTransaction);
FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
- FinancialTransaction financialTransactionOld = transactionTopiaDao.findByTopiaId(financialTransaction.getTopiaId());
+ FinancialTransaction financialTransactionOld = transactionTopiaDao.forTopiaIdEquals(financialTransaction.getTopiaId()).findUnique();
transactionTopiaDao.delete(financialTransactionOld);
}
@Override
public FinancialTransaction getFinancialTransactionWithId(String id) {
FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
- FinancialTransaction result = transactionTopiaDao.findByTopiaId(id);
+ FinancialTransaction result = transactionTopiaDao.forTopiaIdEquals(id).findUnique();
return result;
}
@@ -496,7 +467,7 @@
EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao();
- Entry entryOld = entryTopiaDao.findByTopiaId(entry.getTopiaId());
+ Entry entryOld = entryTopiaDao.forTopiaIdEquals(entry.getTopiaId()).findUnique();
//check rules
accountingRules.updateEntryRules(entry, entryOld);
@@ -522,7 +493,7 @@
accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(financialTransaction);
EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao();
- Entry entryOld = entryTopiaDao.findByTopiaId(entry.getTopiaId());
+ Entry entryOld = entryTopiaDao.forTopiaIdEquals(entry.getTopiaId()).findUnique();
entryOld.getFinancialTransaction().removeEntry(entryOld);
entryTopiaDao.delete(entryOld);
1
0
r3852 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by sbavencoff@users.chorem.org 18 Jul '14
by sbavencoff@users.chorem.org 18 Jul '14
18 Jul '14
Author: sbavencoff
Date: 2014-07-18 17:02:19 +0200 (Fri, 18 Jul 2014)
New Revision: 3852
Url: http://forge.chorem.org/projects/lima/repository/revisions/3852
Log:
refs #1044 : ident + topia function
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-11 13:27:33 UTC (rev 3851)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-18 15:02:19 UTC (rev 3852)
@@ -186,7 +186,7 @@
* Si le compte n'existe pas, il envoie alors un message d'avertissement.
*
* @param account compte à modifier
- * @throws LimaException
+ * @throws InvalidAccountNumberException
*/
@Override
public Account updateAccount(Account account) throws InvalidAccountNumberException {
@@ -201,6 +201,7 @@
return result;
}
+ // TODO sbavencoff 18/07/2014 revoir la selection des comptes #1046
@Override
public List<Account> stringToListAccounts(String selectedAccounts) {
Set<Account> accounts = new HashSet<Account>();
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-11 13:27:33 UTC (rev 3851)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-18 15:02:19 UTC (rev 3852)
@@ -25,6 +25,7 @@
package org.chorem.lima.business.ejb;
+import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -98,23 +99,19 @@
// remove financialstatement
FinancialStatement financialStatementToDelete =
- financialStatementTopiaDao.findByTopiaId(
- financialStatement.getTopiaId());
+ financialStatementTopiaDao.findByTopiaId(financialStatement.getTopiaId());
financialStatementTopiaDao.delete(financialStatementToDelete);
//get all subFinancialStatement
List<FinancialStatement> financialStatements =
- getAllChildrenFinancialStatement(financialStatement,
- new ArrayList<FinancialStatement>());
+ getAllChildrenFinancialStatement(financialStatement, new ArrayList<FinancialStatement>());
//if FinancialStatement have subFinancialStatement
- if (financialStatements.size() > 0) {
- for (FinancialStatement subFinancialStatement : financialStatements) {
- FinancialStatement subFinancialStatementToDelete =
- financialStatementTopiaDao.findByTopiaId(
- subFinancialStatement.getTopiaId());
- financialStatementTopiaDao.delete(subFinancialStatementToDelete);
- }
+ for (FinancialStatement subFinancialStatement : financialStatements) {
+ FinancialStatement subFinancialStatementToDelete =
+ financialStatementTopiaDao.findByTopiaId(
+ subFinancialStatement.getTopiaId());
+ financialStatementTopiaDao.delete(subFinancialStatementToDelete);
}
}
@@ -147,11 +144,7 @@
@Override
public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement masterFinancialStatement) {
-
- FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao();
- List<FinancialStatement> financialStatements = financialStatementTopiaDao.findChildrenFinancialStatement(masterFinancialStatement);
-
- return financialStatements;
+ return Lists.newArrayList(masterFinancialStatement.getSubFinancialStatements());
}
@@ -204,49 +197,49 @@
FinancialStatementAmounts financialStatementAmounts = financialStatementAmounts(subFinancialStatement, selectedBeginDate, selectedEndDate);
if (!subFinancialStatement.isHeader()) {
//on calcul
- grossAmount =
- grossAmount.add(financialStatementAmounts.getGrossAmount());
+ grossAmount = grossAmount.add(financialStatementAmounts.getGrossAmount());
+
provisionDeprecationAmount = provisionDeprecationAmount.add(
financialStatementAmounts.getProvisionDeprecationAmount());
+
subResult.add(financialStatementAmounts);
+
} else {
FinancialStatementDatas financialStatementDatas =
financialStatementReport(subFinancialStatement,
selectedBeginDate, selectedEndDate, result);
+
grossAmount = grossAmount.add(financialStatementDatas.
getFinancialStatementAmounts().getGrossAmount());
+
provisionDeprecationAmount = provisionDeprecationAmount.
add(financialStatementDatas.getFinancialStatementAmounts().
getProvisionDeprecationAmount());
-
FinancialStatementAmounts headerfinancialStatementAmounts =
financialStatementDatas.getFinancialStatementAmounts();
+
//Si sous-total
if (subFinancialStatement.isSubAmount()) {
- FinancialStatementAmounts header =
- new FinancialStatementAmountsImpl();
+ FinancialStatementAmounts header = new FinancialStatementAmountsImpl();
header.setLabel(headerfinancialStatementAmounts.getLabel());
header.setLevel(headerfinancialStatementAmounts.getLevel());
header.setHeader(true);
+
//ajoute header
subResult.add(header);
+
//ajoute liste
if (financialStatementDatas.getListResult() != null) {
subResult.addAll(financialStatementDatas.getListResult());
}
+
//ajoute sstotal
- FinancialStatementAmounts subAmount =
- new FinancialStatementAmountsImpl();
- subAmount.setLabel(
- "TOTAL " + headerfinancialStatementAmounts.getLabel());
- subAmount.setLevel(
- headerfinancialStatementAmounts.getLevel());
- subAmount.setGrossAmount(
- headerfinancialStatementAmounts.getGrossAmount());
- subAmount.setProvisionDeprecationAmount(
- headerfinancialStatementAmounts.
- getProvisionDeprecationAmount());
+ FinancialStatementAmounts subAmount = new FinancialStatementAmountsImpl();
+ subAmount.setLabel("TOTAL " + headerfinancialStatementAmounts.getLabel());
+ subAmount.setLevel(headerfinancialStatementAmounts.getLevel());
+ subAmount.setGrossAmount(headerfinancialStatementAmounts.getGrossAmount());
+ subAmount.setProvisionDeprecationAmount(headerfinancialStatementAmounts.getProvisionDeprecationAmount());
subAmount.setSubAmount(true);
subResult.add(subAmount);
//ajoute une ligne vide
@@ -258,10 +251,8 @@
if (subFinancialStatement.isHeaderAmount()) {
subResult.add(headerfinancialStatementAmounts);
} else {
- headerfinancialStatementAmounts.
- setGrossAmount(new BigDecimal(0));
- headerfinancialStatementAmounts.
- setProvisionDeprecationAmount(new BigDecimal(0));
+ headerfinancialStatementAmounts.setGrossAmount(new BigDecimal(0));
+ headerfinancialStatementAmounts.setProvisionDeprecationAmount(new BigDecimal(0));
subResult.add(headerfinancialStatementAmounts);
}
//ajoute liste
@@ -271,11 +262,9 @@
}
}
}
- FinancialStatementAmounts financialStatementAmounts =
- new FinancialStatementAmountsImpl();
+ FinancialStatementAmounts financialStatementAmounts = new FinancialStatementAmountsImpl();
financialStatementAmounts.setGrossAmount(grossAmount);
- financialStatementAmounts.setProvisionDeprecationAmount(
- provisionDeprecationAmount);
+ financialStatementAmounts.setProvisionDeprecationAmount(provisionDeprecationAmount);
if (financialStatement != null) {
financialStatementAmounts.setLabel(financialStatement.getLabel());
financialStatementAmounts.setHeader(financialStatement.isHeader());
@@ -307,10 +296,8 @@
BigDecimal creditAmount = new BigDecimal(0);
BigDecimal provisionDeprecationAmount = new BigDecimal(0);
- FinancialStatement masterFinancialStatement =
- financialStatement.getMasterFinancialStatement();
- FinancialStatementWayEnum financialStatementWayEnum =
- FinancialStatementWayEnum.BOTH;
+ FinancialStatement masterFinancialStatement = financialStatement.getMasterFinancialStatement();
+ FinancialStatementWayEnum financialStatementWayEnum = FinancialStatementWayEnum.BOTH;
if (masterFinancialStatement != null) {
financialStatementWayEnum = masterFinancialStatement.getWay();
}
@@ -332,19 +319,15 @@
//CREDIT ACCOUNTS LIST
String creditAccountsString = financialStatement.getCreditAccounts();
if (creditAccountsString != null && !creditAccountsString.equals("")) {
- amounts = amountFromAccountList(creditAccountsString,
- selectedBeginDate, selectedEndDate);
+ amounts = amountFromAccountList(creditAccountsString, selectedBeginDate, selectedEndDate);
creditAmount = creditAmount.add(amounts.getCredit());
}
// PROVISION & DEPRECATION
- String provisionDeprecationAccountsString =
- financialStatement.getProvisionDeprecationAccounts();
+ String provisionDeprecationAccountsString = financialStatement.getProvisionDeprecationAccounts();
if (provisionDeprecationAccountsString != null && !provisionDeprecationAccountsString.equals("")) {
amounts = amountFromAccountList(provisionDeprecationAccountsString, selectedBeginDate, selectedEndDate);
- provisionDeprecationAmount =
- provisionDeprecationAmount.add(amounts.getCredit());
- provisionDeprecationAmount =
- provisionDeprecationAmount.subtract(amounts.getDebit());
+ provisionDeprecationAmount = provisionDeprecationAmount.add(amounts.getCredit());
+ provisionDeprecationAmount = provisionDeprecationAmount.subtract(amounts.getDebit());
}
switch (financialStatementWayEnum) {
case BOTH:
@@ -363,10 +346,8 @@
financialStatementAmounts.setGrossAmount(amount);
financialStatementAmounts.setLabel(financialStatement.getLabel());
- financialStatementAmounts.setProvisionDeprecationAmount(
- provisionDeprecationAmount);
- financialStatementAmounts.setLevel(
- financialStatement.getLevel());
+ financialStatementAmounts.setProvisionDeprecationAmount(provisionDeprecationAmount);
+ financialStatementAmounts.setLevel(financialStatement.getLevel());
return financialStatementAmounts;
}
@@ -379,22 +360,21 @@
BigDecimal credit = new BigDecimal(0);
Boolean substract = false;
- AccountTopiaDao accountTopiaDao = getDaoHelper().getAccountDao();
//Remove Spaces
String result = StringUtils.deleteWhitespace(accountsNumberList);
StringTokenizer stQuote = new StringTokenizer(result, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
- //List<Account> accountsList = accountTopiaDao.stringToListAccounts(s, false);
List<Account> accountsList = accountService.stringToListAccounts(s);
BigDecimal debitTemp = new BigDecimal(0);
BigDecimal creditTemp = new BigDecimal(0);
for (Account account : accountsList) {
- ReportsDatas reportsDatas = reportService.
- generateAccountsReports(
+ ReportsDatas reportsDatas =
+ reportService.generateAccountsReports(
account,
true,
- selectedBeginDate, selectedEndDate);
+ selectedBeginDate,
+ selectedEndDate);
if (reportsDatas.getSoldeDebit()) {
debitTemp = debitTemp.add(reportsDatas.getAmountSolde());
} else {
@@ -419,35 +399,24 @@
@Override
public String checkFinancialStatementChart() {
- StringBuilder result =
- new StringBuilder(t("lima-business.financialstatement.check.warn"));
+ StringBuilder result = new StringBuilder(t("lima-business.financialstatement.check.warn"));
AccountTopiaDao accountTopiaDao = getDaoHelper().getAccountDao();
FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao();
List<Account> accountsList = accountTopiaDao.findAllLeafAccounts();
- List<FinancialStatement> financialStatementsList =
- financialStatementTopiaDao.findAll();
+ List<FinancialStatement> financialStatementsList = financialStatementTopiaDao.findAll();
-
for (FinancialStatement financialStatement : financialStatementsList) {
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getAccounts()));
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getCreditAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getCreditAccounts()));
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getDebitAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getDebitAccounts()));
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getProvisionDeprecationAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getProvisionDeprecationAccounts()));
}
for (Account account : accountsList) {
@@ -471,7 +440,7 @@
@Override
public FinancialStatement getFinancialStatementByLabel(String label) {
FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao();
- FinancialStatement result = financialStatementTopiaDao.findByLabel(label);
+ FinancialStatement result = financialStatementTopiaDao.forLabelEquals(label).findUniqueOrNull();
return result;
}
1
0
r3851 - in trunk: . lima-business/src/main/java/org/chorem/lima/business/migration lima-callao/src/main/java/org/chorem/lima/entity
by athimel@users.chorem.org 11 Jul '14
by athimel@users.chorem.org 11 Jul '14
11 Jul '14
Author: athimel
Date: 2014-07-11 15:27:33 +0200 (Fri, 11 Jul 2014)
New Revision: 3851
Url: http://forge.chorem.org/projects/lima/repository/revisions/3851
Log:
upgrade versions (mavenpom, eugene, topia, openEJB, pdfbox, nuiton-csv)
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java
trunk/pom.xml
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -24,20 +24,13 @@
*/
package org.chorem.lima.business.migration;
-import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
-import org.nuiton.topia.persistence.TopiaApplicationContext;
-import org.nuiton.topia.persistence.TopiaMigrationService;
-import org.nuiton.topia.persistence.TopiaMigrationServiceException;
-import org.nuiton.topia.persistence.TopiaService;
-import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
import java.util.List;
-import java.util.Map;
import java.util.Set;
-public class DatabaseMigrationClass extends TopiaMigrationCallbackByClassNG<LimaCallaoTopiaPersistenceContext> {
+public class DatabaseMigrationClass extends TopiaMigrationCallbackByClassNG {
protected static final Version VERSION_0_5 = new Version("0.5");
protected static final Version VERSION_0_6 = new Version("0.6");
@@ -53,11 +46,6 @@
return false;
}
- @Override
- protected TopiaSqlSupport getSqlSupport(LimaCallaoTopiaPersistenceContext limaCallaoTopiaPersistenceContext) {
- return null;
- }
-
static class MigrationResolver implements MigrationCallBackForVersionResolver {
@Override
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -26,7 +26,7 @@
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion;
import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaPersistenceContext;
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
import java.util.List;
@@ -37,7 +37,7 @@
}
@Override
- protected void prepareMigrationScript(TopiaPersistenceContext tx,
+ protected void prepareMigrationScript(TopiaSqlSupport sqlSupport,
List queries,
boolean showSql,
boolean showProgression) throws TopiaException {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -27,10 +27,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.migration.TopiaMigrationCallbackByClass;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaPersistenceContext;
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
@@ -52,7 +51,7 @@
}
@Override
- protected void prepareMigrationScript(TopiaPersistenceContext tx,
+ protected void prepareMigrationScript(TopiaSqlSupport sqlSupport,
List queries,
boolean showSql,
boolean showProgression) throws TopiaException {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -26,7 +26,7 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaPersistenceContext;
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
import java.util.List;
@@ -47,7 +47,7 @@
}
@Override
- protected void prepareMigrationScript(TopiaPersistenceContext tx,
+ protected void prepareMigrationScript(TopiaSqlSupport sqlSupport,
List queries,
boolean showSql,
boolean showProgression) throws TopiaException {
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -28,8 +28,8 @@
import org.nuiton.topia.persistence.TopiaIdFactory;
import org.nuiton.topia.persistence.internal.HibernateProvider;
import org.nuiton.topia.persistence.internal.TopiaHibernateSessionRegistry;
+import org.nuiton.topia.persistence.internal.support.TopiaFiresSupport;
import org.nuiton.topia.persistence.support.TopiaHibernateSupport;
-import org.nuiton.topia.persistence.support.TopiaListenableSupport;
import org.nuiton.topia.persistence.support.TopiaSqlQuery;
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.topia.persistence.support.TopiaSqlWork;
@@ -38,8 +38,8 @@
public class LimaCallaoTopiaPersistenceContext extends AbstractLimaCallaoTopiaPersistenceContext implements TopiaHibernateSupport, TopiaSqlSupport {
- public LimaCallaoTopiaPersistenceContext(HibernateProvider hibernateProvider, TopiaListenableSupport listenableSupport, TopiaIdFactory topiaIdFactory, TopiaHibernateSessionRegistry sessionRegistry) {
- super(hibernateProvider, listenableSupport, topiaIdFactory, sessionRegistry);
+ public LimaCallaoTopiaPersistenceContext(HibernateProvider hibernateProvider, TopiaFiresSupport applicationFiresSupport, TopiaIdFactory topiaIdFactory, TopiaHibernateSessionRegistry sessionRegistry) {
+ super(hibernateProvider, applicationFiresSupport, topiaIdFactory, sessionRegistry);
}
@Override
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/pom.xml 2014-07-11 13:27:33 UTC (rev 3851)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>5.0.7</version>
+ <version>5.0.9</version>
</parent>
<groupId>org.chorem</groupId>
@@ -176,15 +176,15 @@
<nuitonConfigVersion>3.0-alpha-2</nuitonConfigVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
<nuitonProfilingVersion>2.7.1</nuitonProfilingVersion>
- <nuitonCsvVersion>3.0-rc-1</nuitonCsvVersion>
- <eugeneVersion>2.10</eugeneVersion>
+ <nuitonCsvVersion>3.0-rc-2</nuitonCsvVersion>
+ <eugeneVersion>2.12-SNAPSHOT</eugeneVersion>
<nuitonI18nVersion>3.1</nuitonI18nVersion>
- <topiaVersion>3.0-beta-5</topiaVersion>
+ <topiaVersion>3.0-SNAPSHOT</topiaVersion>
<swinglabsVersion>3.0.4</swinglabsVersion>
<h2Version>1.3.176</h2Version>
<hibernateVersion>4.3.5.Final</hibernateVersion>
- <openejbJavaeeApiVersion>6.0-5</openejbJavaeeApiVersion>
+ <openejbJavaeeApiVersion>6.0-6</openejbJavaeeApiVersion>
<dom4jVersion>1.6.1</dom4jVersion>
<jdomVersion>2.0.2</jdomVersion>
<openCsvVersion>2.3</openCsvVersion>
@@ -195,7 +195,7 @@
<openEjbVersion>4.6.0.2</openEjbVersion>
<slf4jVersion>1.7.7</slf4jVersion>
<swingxVersion>1.6.5-1</swingxVersion>
- <pdfboxVersion>1.8.5</pdfboxVersion>
+ <pdfboxVersion>1.8.6</pdfboxVersion>
<jbossTransactionVersion>1.0.0.Final</jbossTransactionVersion>
<commonsCodecVersion>1.9</commonsCodecVersion>
1
0
r3850 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-callao/src/main/java/org/chorem/lima lima-callao/src/main/java/org/chorem/lima/clause lima-callao/src/main/java/org/chorem/lima/entity lima-callao/src/main/java/org/chorem/lima/filter
by athimel@users.chorem.org 11 Jul '14
by athimel@users.chorem.org 11 Jul '14
11 Jul '14
Author: athimel
Date: 2014-07-11 15:19:35 +0200 (Fri, 11 Jul 2014)
New Revision: 3850
Url: http://forge.chorem.org/projects/lima/repository/revisions/3850
Log:
Rename package "Filter" to "filter"
Added:
trunk/lima-callao/src/main/java/org/chorem/lima/filter/
Removed:
trunk/lima-callao/src/main/java/org/chorem/lima/Filter/
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/AbstractFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/AccountFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryBookFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/Filter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/FilterGenerator.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/FinancialTransactionFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/VisitorFilter.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -30,8 +30,8 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.Filter.FilterGenerator;
-import org.chorem.lima.Filter.FinancialTransactionFilter;
+import org.chorem.lima.filter.FilterGenerator;
+import org.chorem.lima.filter.FinancialTransactionFilter;
import org.chorem.lima.beans.FinancialTransactionCondition;
import org.chorem.lima.beans.LetteringFilter;
import org.chorem.lima.business.AccountingRules;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -24,7 +24,7 @@
* #L%
*/
-import org.chorem.lima.Filter.Filter;
+import org.chorem.lima.filter.Filter;
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -28,7 +28,7 @@
import com.google.common.collect.Maps;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.Filter.Filter;
+import org.chorem.lima.filter.Filter;
import org.nuiton.topia.persistence.HqlAndParametersBuilder;
import java.util.Date;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -36,12 +36,12 @@
import org.chorem.lima.clause.StringClause;
import org.chorem.lima.clause.SubFilterClause;
import org.chorem.lima.clause.VisitorClause;
-import org.chorem.lima.Filter.AccountFilter;
-import org.chorem.lima.Filter.EntryBookFilter;
-import org.chorem.lima.Filter.EntryFilter;
-import org.chorem.lima.Filter.Filter;
-import org.chorem.lima.Filter.FinancialTransactionFilter;
-import org.chorem.lima.Filter.VisitorFilter;
+import org.chorem.lima.filter.AccountFilter;
+import org.chorem.lima.filter.EntryBookFilter;
+import org.chorem.lima.filter.EntryFilter;
+import org.chorem.lima.filter.Filter;
+import org.chorem.lima.filter.FinancialTransactionFilter;
+import org.chorem.lima.filter.VisitorFilter;
import java.util.ArrayList;
import java.util.Deque;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/AbstractFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/AbstractFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/AbstractFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/AccountFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/AccountFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/AccountFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryBookFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/EntryBookFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryBookFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/EntryFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/Filter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/Filter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/Filter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/FilterGenerator.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/FilterGenerator.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/FilterGenerator.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/FinancialTransactionFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/FinancialTransactionFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/FinancialTransactionFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/VisitorFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/VisitorFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/VisitorFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
1
0
r3849 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced
by sbavencoff@users.chorem.org 11 Jul '14
by sbavencoff@users.chorem.org 11 Jul '14
11 Jul '14
Author: sbavencoff
Date: 2014-07-11 08:56:57 +0200 (Fri, 11 Jul 2014)
New Revision: 3849
Url: http://forge.chorem.org/projects/lima/repository/revisions/3849
Log:
fixes #975 : Entr?\195?\169es Incorretes : Suppression colone lettre
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2014-07-11 06:50:04 UTC (rev 3848)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2014-07-11 06:56:57 UTC (rev 3849)
@@ -36,7 +36,6 @@
import org.chorem.lima.ui.financialtransaction.DebitColumn;
import org.chorem.lima.ui.financialtransaction.DescriptionColumn;
import org.chorem.lima.ui.financialtransaction.EntryBookColumn;
-import org.chorem.lima.ui.financialtransaction.LetterColumn;
import org.chorem.lima.ui.financialtransaction.VoucherColumn;
import java.util.List;
@@ -66,7 +65,6 @@
addColumn(new DescriptionColumn());
addColumn(new DebitColumn());
addColumn(new CreditColumn());
- addColumn(new LetterColumn());
}
/**
1
0
11 Jul '14
Author: sbavencoff
Date: 2014-07-11 08:50:04 +0200 (Fri, 11 Jul 2014)
New Revision: 3848
Url: http://forge.chorem.org/projects/lima/repository/revisions/3848
Log:
fixes #977 : Rapport : suppression des menus
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-07-10 15:28:04 UTC (rev 3847)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-07-11 06:50:04 UTC (rev 3848)
@@ -164,29 +164,7 @@
onActionPerformed='getHandler().showLetteringView(this)'
actionIcon='lettering'/>
</JMenu>
- <JMenu text="lima.reports" mnemonic="{'R'}">
- <JMenuItem text="lima.reports.accounts"
- onActionPerformed='getHandler().showAccountReports(this)'
- actionIcon='reports-account'/>
- <JMenuItem text="lima.reports.entrybooks"
- onActionPerformed='getHandler().showEntryBookReports(this)'
- actionIcon='reports-entrybook'/>
- <JMenuItem text="lima.reports.balance"
- onActionPerformed='getHandler().showBalanceView(this)'
- actionIcon='reports-balance'/>
- <JMenuItem text="lima.reports.ledger"
- onActionPerformed='getHandler().showLedgerView(this)'
- actionIcon='reports-ledger'/>
- <JMenuItem text="lima.reports.financialstatement"
- onActionPerformed='getHandler().showFinancialStatementReportsView(this)'
- actionIcon='reports-financialstatement'/>
- <!-- useless #669-->
- <!--<JMenuItem text="lima.reports.vat"-->
- <!--onActionPerformed='getHandler().showVatReportView(this)'-->
- <!--actionIcon='reports-vatstatement'/>-->
- </JMenu>
-
<JMenu text="lima.menu.help" mnemonic="{'H'}">
<!--<JMenuItem id="help" text='lima.menu.help.help' actionIcon="help"-->
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2014-07-10 15:28:04 UTC (rev 3847)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2014-07-11 06:50:04 UTC (rev 3848)
@@ -37,15 +37,11 @@
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.account.AccountView;
-import org.chorem.lima.ui.accountsreports.AccountsReportsView;
-import org.chorem.lima.ui.balance.BalanceReportsView;
import org.chorem.lima.ui.celleditor.NumberSeparatorCellRenderer;
import org.chorem.lima.ui.celleditor.NumberSeparatorTableCellRenderer;
import org.chorem.lima.ui.entrybook.EntryBookView;
-import org.chorem.lima.ui.entrybooksreports.EntryBooksReportsView;
import org.chorem.lima.ui.financialperiod.FinancialPeriodView;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementChartView;
-import org.chorem.lima.ui.financialstatementreport.FinancialStatementReportView;
import org.chorem.lima.ui.financialtransaction.FinancialTransactionView;
import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchView;
import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView;
@@ -53,17 +49,22 @@
import org.chorem.lima.ui.home.HomeView;
import org.chorem.lima.ui.identity.IdentityForm;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.ui.ledger.LedgerView;
import org.chorem.lima.ui.lettering.LetteringView;
import org.chorem.lima.ui.vatchart.VatChartView;
-import org.chorem.lima.ui.vatreports.VatReportView;
import org.nuiton.util.DesktopUtil;
import org.nuiton.widget.SwingSession;
-import javax.swing.*;
+import javax.swing.DefaultCellEditor;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JEditorPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import javax.swing.plaf.BorderUIResource;
-import java.awt.*;
+import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
@@ -446,33 +447,6 @@
}
/**
- * Show account table report to view an account on a period
- *
- * @param rootContext the root application context
- */
- public void showAccountReports(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- AccountsReportsView accountsReportsView =
- new AccountsReportsView(mainView);
- showTab(mainView, t("lima.reports.accounts"), accountsReportsView);
- swingSession.add(accountsReportsView);
- }
-
- /**
- * Show entry book table report to view an account on a period
- *
- * @param rootContext the root application context
- */
- public void showEntryBookReports(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- EntryBooksReportsView entryBooksReportsView =
- new EntryBooksReportsView(mainView);
- showTab(mainView, t("lima.reports.entrybooks"), entryBooksReportsView);
- swingSession.add(entryBooksReportsView);
- }
-
-
- /**
* Show financial transactions view to create entries
*
* @param rootContext the root application context
@@ -510,36 +484,6 @@
swingSession.add(letteringView);
}
- public void showBalanceView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- BalanceReportsView balanceView = new BalanceReportsView(mainView);
- showTab(mainView, t("lima.reports.balance"), balanceView);
- swingSession.add(balanceView);
- }
-
- public void showLedgerView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- LedgerView ledgerView = new LedgerView(mainView);
- showTab(mainView, t("lima.reports.ledger"), ledgerView);
- swingSession.add(ledgerView);
- }
-
- public void showFinancialStatementReportsView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- FinancialStatementReportView financialStatementReportView =
- new FinancialStatementReportView(mainView);
- showTab(mainView, t("lima.reports.financialstatement"),
- financialStatementReportView);
- swingSession.add(financialStatementReportView);
- }
-
- public void showVatReportView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- VatReportView vatReportView = new VatReportView(mainView);
- showTab(mainView, t("lima.reports.vat"), vatReportView);
- swingSession.add(vatReportView);
- }
-
public void showImportExportView(JAXXContext rootContext,
ImportExportEnum type) {
MainView mainView = getUI(rootContext);
1
0
r3847 - in trunk/lima-swing/src/main: java/org/chorem/lima java/org/chorem/lima/ui resources/i18n resources/icons
by sbavencoff@users.chorem.org 10 Jul '14
by sbavencoff@users.chorem.org 10 Jul '14
10 Jul '14
Author: sbavencoff
Date: 2014-07-10 17:28:04 +0200 (Thu, 10 Jul 2014)
New Revision: 3847
Url: http://forge.chorem.org/projects/lima/repository/revisions/3847
Log:
fixes #557 : remove fullscreen option
Removed:
trunk/lima-swing/src/main/resources/icons/action-fullscreen.png
trunk/lima-swing/src/main/resources/icons/action-leave-fullscreen.png
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2014-07-10 13:16:39 UTC (rev 3846)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2014-07-10 15:28:04 UTC (rev 3847)
@@ -309,24 +309,6 @@
}
/**
- * Change full screen mode.
- * Save user file.
- *
- * @param fullscreen new fullscreen mode
- */
- public void setFullscreen(boolean fullscreen) {
- boolean oldValue = isFullScreen();
- setOption(Option.FULL_SCREEN.key, fullscreen + "");
- saveForUser();
- firePropertyChange("fullscreen", oldValue, fullscreen);
- }
-
- public boolean isFullScreen() {
- Boolean result = getOptionAsBoolean(Option.FULL_SCREEN.key);
- return result != null && result;
- }
-
- /**
* Get support email address.
*
* @return support email
@@ -471,12 +453,6 @@
"false",
Boolean.class, false, false),
- FULL_SCREEN("lima.ui.fullscreen",
- t("lima.config.ui.fullscreen.label"),
- n("lima.config.ui.fullscreen.description"),
- "false",
- Boolean.class, false, false),
-
LAUNCH_UI("lima.ui.launchui",
t("lima.config.ui.flaunchui.label"),
n("lima.config.ui.flaunchui.description"),
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2014-07-10 13:16:39 UTC (rev 3846)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2014-07-10 15:28:04 UTC (rev 3847)
@@ -137,7 +137,7 @@
// do init ui
MainViewHandler uiHandler = context.getContextValue(MainViewHandler.class);
- final MainView ui = uiHandler.initUI(context, context.getConfig().isFullScreen());
+ final MainView ui = uiHandler.initUI(context);
ui.setLocationRelativeTo(null);
// defaut display home view (not closeable, but might be !)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-07-10 13:16:39 UTC (rev 3846)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-07-10 15:28:04 UTC (rev 3847)
@@ -25,7 +25,6 @@
<JFrame title="lima.ui.mainview.title" onWindowClosing="getHandler().close(this)"
defaultCloseOperation="do_nothing_on_close"
- undecorated='{getConfig().isFullScreen()}'
resizable="true" width="800" height="600"
extendedState='{this.MAXIMIZED_BOTH}'
iconImage='puzzle_icon.png'>
@@ -188,23 +187,6 @@
</JMenu>
- <JMenu text="lima.menu.window" mnemonic="{'W'}">
- <JMenuItem id='menuFileFullscreen'
- text="lima.action.fullscreen"
- toolTipText="lima.action.fullscreen.tip"
- actionIcon="fullscreen"
- mnemonic="P"
- visible="{!isUndecorated()}"
- onActionPerformed="getHandler().changeScreen(this, true)"/>
- <JMenuItem id='menuFileNormalscreen'
- text="lima.action.normalscreen"
- toolTipText="lima.action.normalscreen.tip"
- actionIcon="leave-fullscreen"
- mnemonic="N"
- visible="{isUndecorated()}"
- onActionPerformed="getHandler().changeScreen(this, false)"/>
- </JMenu>
-
<JMenu text="lima.menu.help" mnemonic="{'H'}">
<!--<JMenuItem id="help" text='lima.menu.help.help' actionIcon="help"-->
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2014-07-10 13:16:39 UTC (rev 3846)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2014-07-10 15:28:04 UTC (rev 3847)
@@ -95,10 +95,9 @@
* Methode pour initialiser l'ui principale sans l'afficher.
*
* @param rootContext le context applicatif
- * @param fullscreen flag pour indiquer si on doit ouvrir l'ui en model console (pleine ecran).
* @return l'ui instancie et initialisee mais non visible encore
*/
- public MainView initUI(LimaContext rootContext, boolean fullscreen) {
+ public MainView initUI(LimaContext rootContext) {
// show main ui
MainView ui = new MainView(rootContext);
@@ -106,9 +105,6 @@
LimaContext.MAIN_UI_ENTRY_DEF.setContextValue(rootContext, ui);
- // set fullscreen propery on main ui
- ui.getGraphicsConfiguration().getDevice().setFullScreenWindow(fullscreen ? ui : null);
-
return ui;
}
@@ -132,7 +128,7 @@
LimaContext.get().initI18n(config);
// on recharge l'ui
- reloadUI(LimaContext.get(), config.isFullScreen());
+ reloadUI(LimaContext.get());
}
/**
@@ -163,27 +159,6 @@
}
}
- /**
- * Méthode pour changer de mode d'affichage.
- * <p/>
- * Si <code>fullscreen</code> est à <code>true</code> alors on passe en
- * mode console (c'est à dire en mode plein écran exclusif), sinon on
- * passe en mode fenetré normal.
- *
- * @param ui l'ui principale de l'application
- * @param fullscreen le nouvel état requis.
- */
- public void changeScreen(MainView ui, boolean fullscreen) {
- boolean canContinue = ensureModification(ui);
- if (!canContinue) {
- return;
- }
-
- ui.getConfig().setFullscreen(fullscreen);
-
- reloadUI(LimaContext.get(), fullscreen);
- }
-
public void showConfig(JAXXContext context) {
MainView ui = getUI(context);
final LimaConfig config = ui.getConfig();
@@ -255,8 +230,6 @@
helper.addCategory(t("lima.config.category.other"), t("lima.config.category.other.description"));
- helper.addOption(LimaConfig.Option.FULL_SCREEN);
- helper.setOptionShortLabel(LimaConfig.Option.FULL_SCREEN.getLabel());
helper.addOption(LimaConfig.Option.LOCALE);
helper.setOptionShortLabel(LimaConfig.Option.LOCALE.getLabel());
@@ -333,9 +306,8 @@
* Permet de recharger l'ui principale et de changer de le mode d'affichage.
*
* @param rootContext le contexte applicatif
- * @param fullscreen le type de fenetre à reouvrir
*/
- protected void reloadUI(LimaContext rootContext, boolean fullscreen) {
+ protected void reloadUI(LimaContext rootContext) {
// must remove all properties listener on config
LimaContext.CONFIG_DEF.getContextValue(rootContext).removeJaxxPropertyChangeListener();
@@ -351,7 +323,7 @@
ui.setVisible(false);
}
- ui = initUI(rootContext, fullscreen);
+ ui = initUI(rootContext);
// show ui
ui.setVisible(true);
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-10 13:16:39 UTC (rev 3846)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-10 15:28:04 UTC (rev 3847)
@@ -15,10 +15,6 @@
lima.about.translate.content=<h3>How to translate Lima</h3>You can help us to translate or improve label in Lima.<br/><ul><li>Get the <strong>lima-i18n.csv</strong> file in the <strong>i18n</strong> directory</li><li>open it in Libre office (separator caracter is <strong>Tab</strong>)</li><li>Do you work \:)</li><li>At last, send us back the modified file</li></ul><br/>We will apply the patch before next release.
lima.accountsreports.listerror=Can't get entries list
lima.action.commandline.help=Show help in console
-lima.action.fullscreen=Full screen
-lima.action.fullscreen.tip=Open ui in full screen
-lima.action.normalscreen=Normal screen
-lima.action.normalscreen.tip=Open ui in normal screen
lima.balance.documentcreationerror=Enable to create document
lima.balance.documentcreationfiscalerror=Can't create document on an open fiscal year
lima.balance.listerror=Can't get entries list
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-10 13:16:39 UTC (rev 3846)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-10 15:28:04 UTC (rev 3847)
@@ -5,10 +5,6 @@
lima.about.translate.content=<h2>Comment traduire Lima</h2>Vous pouvez nous aider à traduire Lima.<hr/><br/><ul><li>Récupérer le fichier <strong>lima-i18n.csv</strong> dans le répertoire <strong>i18n</strong></li><li>ouvrez le avec un tableur (le caractère séprateur est une Tabultation)</li><li>Traduisez, Améliorer, ...</li><li>Enfin renvoyez-le nous</li></ul><br/>Nous intégrerons vos modifications avant la prochaine version.
lima.accountsreports.listerror=Erreur lors de la récupération des données de la liste
lima.action.commandline.help=Afficher l'aide en console
-lima.action.fullscreen=Plein Ecran
-lima.action.fullscreen.tip=Passer en mode plein écran
-lima.action.normalscreen=Ecran normal
-lima.action.normalscreen.tip=Revenir en écran normal
lima.balance.documentcreationerror=Erreur lors de la création du document
lima.balance.documentcreationfiscalerror=Impossible de créer le document quand la période fiscale est ouverte
lima.balance.listerror=Erreur lors de la récupération des données de la liste
Deleted: trunk/lima-swing/src/main/resources/icons/action-fullscreen.png
===================================================================
(Binary files differ)
Deleted: trunk/lima-swing/src/main/resources/icons/action-leave-fullscreen.png
===================================================================
(Binary files differ)
1
0
r3846 - trunk/lima-business/src/test/java/org/chorem/lima/business
by sbavencoff@users.chorem.org 10 Jul '14
by sbavencoff@users.chorem.org 10 Jul '14
10 Jul '14
Author: sbavencoff
Date: 2014-07-10 15:16:39 +0200 (Thu, 10 Jul 2014)
New Revision: 3846
Url: http://forge.chorem.org/projects/lima/repository/revisions/3846
Log:
fixes #557 : fix refactor exception
Modified:
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-10 12:26:56 UTC (rev 3845)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-10 13:16:39 UTC (rev 3846)
@@ -23,10 +23,6 @@
package org.chorem.lima.business;
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.ParseException;
-
import org.apache.commons.io.IOUtils;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
@@ -35,6 +31,10 @@
import org.junit.Assert;
import org.junit.Test;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.ParseException;
+
/**
* Test du service d'import en faisant des import/export EBP et xml.
*
@@ -50,10 +50,14 @@
* Import files available in src/test/resources/ebp.
*
* @throws IOException
- * @throws LimaException
- * @throws ParseException
+ * @throws ParseException
+ * @throws BeginAfterEndFiscalPeriodException
+ * @throws NotBeginNextDayOfLastFiscalPeriodException
+ * @throws MoreOneUnlockFiscalPeriodException
+ * @throws ImportEbpException
*/
- protected void importEBPData() throws IOException, LimaException, ParseException {
+ protected void importEBPData() throws IOException, ParseException, BeginAfterEndFiscalPeriodException,
+ NotBeginNextDayOfLastFiscalPeriodException, MoreOneUnlockFiscalPeriodException, ImportEbpException {
// create fiscal period (mandatory for import)
FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
1
0
Author: sbavencoff
Date: 2014-07-10 14:26:56 +0200 (Thu, 10 Jul 2014)
New Revision: 3845
Url: http://forge.chorem.org/projects/lima/repository/revisions/3845
Log:
fixes #557 : fix refactor exception
Removed:
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
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/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.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
trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -1,61 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id: LimaBusinessException.java 3290 2011-09-17 12:55:34Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business;
-
-/**
- * Lima business exception throw by a business service method
- * that cannot execute successfully.
- *
- * @author chatellier
- * @version $Revision: 3290 $
- * <p/>
- * Last update : $Date: 2011-09-17 14:55:34 +0200 (sam. 17 sept. 2011) $
- * By : $Author: tchemit $
- */
-public class LimaBusinessException extends LimaException {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = -6876236663940184462L;
-
- /**
- * Constructs a new exception with the specified detail message.
- *
- * @param message message
- */
- public LimaBusinessException(String message) {
- super(message);
- }
-
- /**
- * Constructs a new exception with the specified detail message and cause.
- *
- * @param message message
- * @param cause cause
- */
- public LimaBusinessException(String message, Throwable cause) {
- super(message, cause);
- }
-}
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 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -96,7 +96,7 @@
// Check if the numberaccount is not blank
if (StringUtils.isBlank(account.getAccountNumber())) {
- throw new InvalidAccountNumberException(account.getAccountNumber(), "lima-business.defaultaccountingrules.invalidaccountnumber");
+ throw new InvalidAccountNumberException(account.getAccountNumber());
}
}
@@ -104,7 +104,7 @@
public void updateAccountRules(Account account) throws InvalidAccountNumberException {
// Check if the numberaccount is not blank
if (StringUtils.isBlank(account.getAccountNumber())) {
- throw new InvalidAccountNumberException(account.getAccountNumber(), "lima-business.defaultaccountingrules.invalidaccountnumber");
+ throw new InvalidAccountNumberException(account.getAccountNumber());
}
}
@@ -143,7 +143,7 @@
EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao();
// Check if account have entries
if (entryTopiaDao.forAccountEquals(account).exists()) {
- throw new UsedAccountException(account.getAccountNumber(), "lima-business.defaultaccountingrules.deleteaccounterror");
+ throw new UsedAccountException(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 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -82,7 +82,7 @@
// Check root account starts with 1 to 8
if (accountNumber.length() >= 1 && !accountNumber.substring(0, 1).matches("[1-8]")) {
- throw new InvalidAccountNumberException(account.getAccountNumber(), "lima-business.franceaccountingrules.accountstartnumbererror");
+ throw new InvalidAccountNumberException(account.getAccountNumber());
}
}
@@ -95,12 +95,12 @@
// Check if the number account is type numeric
if (!StringUtils.isNumeric(account.getAccountNumber())) {
- throw new InvalidAccountNumberException(account.getAccountNumber(), "lima-business.franceaccountingrules.accountnumbernotnumeric");
+ throw new InvalidAccountNumberException(account.getAccountNumber());
}
// Check root account starts with 1 to 8
if (accountNumber.length() >= 1 && !accountNumber.substring(0, 1).matches("[1-8]")) {
- throw new InvalidAccountNumberException(account.getAccountNumber(), "lima-business.franceaccountingrules.accountstartnumbererror");
+ throw new InvalidAccountNumberException(account.getAccountNumber());
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -26,7 +26,6 @@
package org.chorem.lima.business.ejb;
import org.apache.commons.lang.StringUtils;
-import org.chorem.lima.business.AccountException;
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.InvalidAccountNumberException;
@@ -76,7 +75,7 @@
* @throws LimaException
*/
@Override
- public Account createAccount(Account account) throws AccountException {
+ public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException {
// check rules before create the account
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
@@ -89,7 +88,7 @@
AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
if (AccountTopiaDao.existByNaturalId(account.getAccountNumber())) {
- throw new AlreadyExistAccountException(account.getAccountNumber(), "lima-business.account.accountalreardyexist");
+ throw new AlreadyExistAccountException(account.getAccountNumber());
}
//create it
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 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -29,10 +29,11 @@
import org.apache.commons.lang3.time.DateUtils;
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.AccountException;
import org.chorem.lima.business.AccountingRules;
+import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LockedEntryBookException;
@@ -281,12 +282,13 @@
@Override
public FiscalPeriod retainedEarningsAndBlockFiscalPeriod(FiscalPeriod fiscalPeriod, EntryBook entryBook,
boolean retainedEarnings)
- throws AccountException,
- LockedFinancialPeriodException,
+ throws LockedFinancialPeriodException,
LockedEntryBookException,
NoFoundFinancialPeriodException,
LastUnlockedFiscalPeriodException,
- AlreadyLockedFiscalPeriodException {
+ AlreadyLockedFiscalPeriodException,
+ AlreadyExistAccountException,
+ InvalidAccountNumberException {
if (entryBook != null && retainedEarnings) {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -50,9 +50,10 @@
import org.chorem.lima.beans.FinancialTransactionImportImpl;
import org.chorem.lima.beans.VatStatementImport;
import org.chorem.lima.beans.VatStatementImportImpl;
-import org.chorem.lima.business.AccountException;
+import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.ImportEbpException;
+import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
@@ -329,29 +330,42 @@
"lima-business.import.entrybooknotexist",
entryBook));
}
+ try {
- // create transaction
- if (financialTransaction == null
- || !(dateEcr.equals(financialTransaction
- .getTransactionDate()) && entryBook
- .getCode().equals(
- financialTransaction.getEntryBook()
- .getCode()))) {
- // create financial transaction
- financialTransaction = new FinancialTransactionImpl();
- financialTransaction.setEntryBook(entryBook);
- financialTransaction.setTransactionDate(dateEcr);
- financialTransaction = financialTransactionService
- .createFinancialTransaction(financialTransaction);
- result.append(t(
- "lima-business.import.transactionadded", dateEcr,
- entryBook.getCode()));
+ // create transaction
+ if (financialTransaction == null
+ || !(dateEcr.equals(financialTransaction
+ .getTransactionDate()) && entryBook
+ .getCode().equals(
+ financialTransaction.getEntryBook()
+ .getCode()))) {
+ // create financial transaction
+ financialTransaction = new FinancialTransactionImpl();
+ financialTransaction.setEntryBook(entryBook);
+ financialTransaction.setTransactionDate(dateEcr);
+ financialTransaction = financialTransactionService
+ .createFinancialTransaction(financialTransaction);
+ result.append(t(
+ "lima-business.import.transactionadded", dateEcr,
+ entryBook.getCode()));
+ }
+ // Inside the db, the entries reference the financialTransaction
+ entry.setFinancialTransaction(financialTransaction);
+ entry = financialTransactionService.createEntry(entry);
+ result.append(t("lima-business.import.entryadded",
+ entry.getDescription(), entry.getAmount()));
+
+ } catch (LockedFinancialPeriodException e) {
+ result.append(t("lima-business.import.entries.error.lockedFinancialPeriod",
+ e.getFinancialPeriod().getBeginDate(),
+ e.getFinancialPeriod().getEndDate()));
+ } catch (LockedEntryBookException e) {
+ result.append(t("lima-business.import.entries.error.lockedEntryBook",
+ e.getClosedPeriodicEntryBook().getEntryBook().getCode(),
+ e.getClosedPeriodicEntryBook().getEntryBook().getLabel(),
+ e.getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(),
+ e.getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate()));
}
- // Inside the db, the entries reference the financialTransaction
- entry.setFinancialTransaction(financialTransaction);
- entry = financialTransactionService.createEntry(entry);
- result.append(t("lima-business.import.entryadded",
- entry.getDescription(), entry.getAmount()));
}
}
@@ -365,10 +379,6 @@
throw new ImportEbpException("Can't import ", e);
} catch (IOException e) {
throw new ImportEbpException("Can't import ", e);
- } catch (LockedFinancialPeriodException e) {
- throw new ImportEbpException("Can't import " + t("lima-business.import.FinancialTransaction.error.LockedFinancialPeriod"));
- } catch (LockedEntryBookException e) {
- throw new ImportEbpException("Can't import " + t("lima-business.import.FinancialTransaction.error.LockedEntryBook"));
} finally {
if (csvReader != null) {
try {
@@ -422,10 +432,18 @@
account = new AccountImpl();
account.setAccountNumber(accountNumber);
account.setLabel(label);
- accountService.createAccount(account);
- result.append(t("lima-business.import.accountadded",
- accountNumber, label));
- nbAccountCreated++;
+ try {
+ accountService.createAccount(account);
+ result.append(t("lima-business.import.account.added",
+ accountNumber, label));
+ nbAccountCreated++;
+ } catch (AlreadyExistAccountException e) {
+ result.append(t("lima-business.import.account.alreadyExist",
+ accountNumber, label));
+ } catch (InvalidAccountNumberException e) {
+ result.append(t("lima-business.import.account.InvalidAccountNumber",
+ accountNumber, label));
+ }
}
line = csvReader.readNext();
}
@@ -440,8 +458,6 @@
+ (after - before) + " ms");
}
- } catch (AccountException e) {
- throw new ImportEbpException("Can't import", e);
} catch (IOException e) {
throw new ImportEbpException("Can't import", e);
} finally {
@@ -826,8 +842,10 @@
try {
accountService.createAccount(account);
- } catch (AccountException e) {
- result.append(t("lima-business.import.accountalreadyexist", accountNumber));
+ } catch (AlreadyExistAccountException e) {
+ result.append(t("lima-business.import.account.alreadyexist", accountNumber));
+ } catch (InvalidAccountNumberException e) {
+ result.append(t("lima-business.import.account.InvalidAccountNumber", accountNumber));
}
result.append(t("lima-business.import.accountadded",
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 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2014-07-10 12:26:56 UTC (rev 3845)
@@ -90,12 +90,21 @@
lima-business.import.FiscalPeriod.error.beginAfterEndFiscalPeriod=
lima-business.import.FiscalPeriod.error.moreOneUnlockFiscalPeriod=
lima-business.import.FiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod=
+lima-business.import.account.InvalidAccountNumber=
+lima-business.import.account.added=
+lima-business.import.account.alreadyExist=
+lima-business.import.account.alreadyexist=
+lima-business.import.accountInvalidAccountNumber=
lima-business.import.accountadded=SUCCES \: Account %s - %s added\n
lima-business.import.accountalreadyexist=FAILED \: Account %s already exist \n
lima-business.import.closedperiodicentrybookupdated=SUCCESS \: The blockClosedPeriodicEntryBook %s - %s - %s is updated \! \n
lima-business.import.ebpmissingaccount=FAILED \: Account %s already exist, import aborted. \nCreate all accounts before import entries.
lima-business.import.ebpnoentry=FAILED \: This file contains no entries.
lima-business.import.ebpnoheader=FAILED \: This file has no header datas.
+lima-business.import.entries.error.FinancialPeriod=
+lima-business.import.entries.error.LockedEntryBook=
+lima-business.import.entries.error.lockedEntryBook=
+lima-business.import.entries.error.lockedFinancialPeriod=
lima-business.import.entriesoutofdatesrange=WARNING \: %s entries is out of range of opened fiscal periods. Entry was skip \!\n
lima-business.import.entryadded=SUCCES \: Entry %s %s added\n"
lima-business.import.entrybookalreadyexist=FAILED \: The entrybook %s already exists \!\n
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 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-07-10 12:26:56 UTC (rev 3845)
@@ -87,6 +87,10 @@
lima-business.import.FiscalPeriod.error.beginAfterEndFiscalPeriod=La date de début doit être avant la date de fin
lima-business.import.FiscalPeriod.error.moreOneUnlockFiscalPeriod=Seul deux exercices non clôturés sont autorisés
lima-business.import.FiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod=la date de début doit suivre la date de fin du précédent exercice
+lima-business.import.account.InvalidAccountNumber=Le numéro de compt %1$s n'est pas valide\n
+lima-business.import.account.added=Succès \: Compte %s - %s ajouté\n
+lima-business.import.account.alreadyExist=Le compte %1$s - existe déjà \n
+lima-business.import.account.alreadyexist=
lima-business.import.accountadded=Succès \: Compte %s - %s ajouté\n
lima-business.import.accountalreadyexist=Échec \: Le compte %s existe déjà \n
lima-business.import.closedPeriodicEntryBook.error.NotLockedPreviousEntryBook=Les périodes financières précédentes pour ce journal doivent être bloquées avant
@@ -97,6 +101,8 @@
lima-business.import.ebpmissingaccount=Échec \: Compte %s inexistant. \nImportation annulée. \nCréer tous les comptes avant d'importer les écritures.
lima-business.import.ebpnoentry=Échec \: Ce fichier ne contient aucune entrée.
lima-business.import.ebpnoheader=Échec \: Ce fichier ne contient aucun entête.
+lima-business.import.entries.error.lockedEntryBook=
+lima-business.import.entries.error.lockedFinancialPeriod=
lima-business.import.entriesoutofdatesrange=Attention \: Cette entrée %s ne fait partie d'aucune période ouverte. Entrée non importée \!\n
lima-business.import.entryadded=Succès \: Entrée %s %s ajoutée \n
lima-business.import.entrybookalreadyexist=Échec \: Le journal %s exist déjà \!\n
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -29,13 +29,12 @@
protected String accountNumber;
- public AccountException(String accountNumber, String message) {
- super(message);
+ public AccountException(String accountNumber) {
this.accountNumber = accountNumber;
}
- public AccountException(String accountNumber, String message, Throwable cause) {
- super(message, cause);
+ public AccountException(String accountNumber, Throwable cause) {
+ super(cause);
this.accountNumber = accountNumber;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -26,11 +26,12 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class AlreadyExistAccountException extends AccountException {
- public AlreadyExistAccountException(String accountNumber, String message) {
- super(accountNumber, message);
+
+ public AlreadyExistAccountException(String accountNumber) {
+ super(accountNumber);
}
- public AlreadyExistAccountException(String accountNumber, String message, Throwable cause) {
- super(accountNumber, message, cause);
+ public AlreadyExistAccountException(String accountNumber, Throwable cause) {
+ super(accountNumber, cause);
}
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -31,21 +31,12 @@
protected ClosedPeriodicEntryBook closedPeriodicEntryBook;
- public ClosedPeriodicEntryBookException(String message) {
- super(message);
- }
-
- public ClosedPeriodicEntryBookException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message) {
- super(message);
+ public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) {
this.closedPeriodicEntryBook = closedPeriodicEntryBook;
}
- public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message, Throwable cause) {
- super(message, cause);
+ public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
+ super(cause);
this.closedPeriodicEntryBook = closedPeriodicEntryBook;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -12,12 +12,11 @@
protected Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks;
public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) {
- super("");
this.closedPeriodicEntryBooks = closedPeriodicEntryBooks;
}
public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks, Throwable cause) {
- super("", cause);
+ super(cause);
this.closedPeriodicEntryBooks = closedPeriodicEntryBooks;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -10,12 +10,11 @@
protected Date date;
public DateException(Date date) {
- super("");
this.date = date;
}
public DateException(Date date, Throwable cause) {
- super("", cause);
+ super(cause);
this.date = date;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -12,12 +12,11 @@
protected Collection<Entry> entries;
public EntriesException(Collection<Entry> entries) {
- super("");
this.entries = entries;
}
public EntriesException(Collection<Entry> entries, Throwable cause) {
- super("", cause);
+ super(cause);
this.entries = entries;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -31,13 +31,12 @@
protected EntryBook entryBook;
- public EntryBookException(EntryBook entryBook, String message) {
- super(message);
+ public EntryBookException(EntryBook entryBook) {
this.entryBook = entryBook;
}
- public EntryBookException(EntryBook entryBook, String message, Throwable cause) {
- super(message, cause);
+ public EntryBookException(EntryBook entryBook, Throwable cause) {
+ super(cause);
this.entryBook = entryBook;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -10,12 +10,11 @@
protected FinancialPeriod financialPeriod;
public FinancialPeriodException(FinancialPeriod financialPeriod) {
- super("");
this.financialPeriod = financialPeriod;
}
public FinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) {
- super("", cause);
+ super(cause);
this.financialPeriod = financialPeriod;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -12,12 +12,11 @@
protected Collection<FinancialTransaction> financialTransactions;
public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
- super("");
this.financialTransactions = financialTransactions;
}
public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
- super("", cause);
+ super(cause);
this.financialTransactions = financialTransactions;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -32,12 +32,11 @@
protected FiscalPeriod fiscalPeriod;
public FiscalPeriodException(FiscalPeriod fiscalPeriod) {
- super("");
this.fiscalPeriod = fiscalPeriod;
}
public FiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
- super("", cause);
+ super(cause);
this.fiscalPeriod = fiscalPeriod;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -25,7 +25,8 @@
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
-public class ImportEbpException extends LimaException {
+public class ImportEbpException extends Exception {
+
public ImportEbpException(String message) {
super(message);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -26,11 +26,12 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class InvalidAccountNumberException extends AccountException {
- public InvalidAccountNumberException(String accountNumber, String message) {
- super(accountNumber, message);
+
+ public InvalidAccountNumberException(String accountNumber) {
+ super(accountNumber);
}
- public InvalidAccountNumberException(String accountNumber, String message, Throwable cause) {
- super(accountNumber, message, cause);
+ public InvalidAccountNumberException(String accountNumber, Throwable cause) {
+ super(accountNumber, cause);
}
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -37,7 +37,7 @@
* By : $Author$
*/
@ApplicationException
-public class LimaException extends Exception {
+public abstract class LimaException extends Exception {
/**
* serialVersionUID.
@@ -45,21 +45,19 @@
private static final long serialVersionUID = -6876236663940184462L;
/**
- * Constructs a new exception with the specified detail message.
+ * Constructs a new exception
*
- * @param message message
*/
- public LimaException(String message) {
- super(message);
+ public LimaException() {
+ super();
}
/**
- * Constructs a new exception with the specified detail message and cause.
+ * Constructs a new exception with the specified cause.
*
- * @param message message
* @param cause cause
*/
- public LimaException(String message, Throwable cause) {
- super(message, cause);
+ public LimaException(Throwable cause) {
+ super(cause);
}
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -8,10 +8,10 @@
public class LockedEntryBookException extends ClosedPeriodicEntryBookException {
public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) {
- super(closedPeriodicEntryBook, "");
+ super(closedPeriodicEntryBook);
}
public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
- super(closedPeriodicEntryBook, "", cause);
+ super(closedPeriodicEntryBook, cause);
}
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -6,6 +6,7 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class LockedFinancialPeriodException extends FinancialPeriodException{
+
public LockedFinancialPeriodException(FinancialPeriod financialPeriod) {
super(financialPeriod);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -8,12 +8,11 @@
int countUnlockFiscalPeriod;
public MoreOneUnlockFiscalPeriodException(int countUnlockFiscalPeriod) {
- super("");
this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
}
public MoreOneUnlockFiscalPeriodException(int countUnlockFiscalPeriod, Throwable cause) {
- super("", cause);
+ super(cause);
this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -8,6 +8,7 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class NoEmptyFiscalPeriodException extends FinancialTransactionsException {
+
public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions) {
super(financialTransactions);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -8,6 +8,7 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class NotLockedClosedPeriodicEntryBooksException extends ClosedPeriodicEntryBooksException {
+
public NotLockedClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) {
super(closedPeriodicEntryBooks);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -8,6 +8,7 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class UnfilledEntriesException extends EntriesException {
+
public UnfilledEntriesException(Collection<Entry> entries) {
super(entries);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -26,11 +26,12 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class UsedAccountException extends AccountException {
- public UsedAccountException(String accountNumber, String message) {
- super(accountNumber, message);
+
+ public UsedAccountException(String accountNumber) {
+ super(accountNumber);
}
- public UsedAccountException(String accountNumber, String message, Throwable cause) {
- super(accountNumber, message, cause);
+ public UsedAccountException(String accountNumber, Throwable cause) {
+ super(accountNumber, cause);
}
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -30,10 +30,10 @@
public class UsedEntryBookException extends EntryBookException {
public UsedEntryBookException(EntryBook entryBook) {
- super(entryBook, "");
+ super(entryBook);
}
public UsedEntryBookException(EntryBook entryBook, Throwable cause) {
- super(entryBook, "", cause);
+ super(entryBook, cause);
}
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -8,6 +8,7 @@
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class WithoutEntryBookFinancialTransactionsException extends FinancialTransactionsException {
+
public WithoutEntryBookFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
super(financialTransactions);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -25,7 +25,7 @@
package org.chorem.lima.business.api;
-import org.chorem.lima.business.AccountException;
+import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.UsedAccountException;
@@ -93,7 +93,7 @@
* @param account account
* @throws LimaException
*/
- Account createAccount(Account account) throws AccountException;
+ Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException;
Account updateAccount(Account account) throws InvalidAccountNumberException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -25,9 +25,10 @@
package org.chorem.lima.business.api;
-import org.chorem.lima.business.AccountException;
+import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
@@ -79,7 +80,13 @@
* */
FiscalPeriod retainedEarningsAndBlockFiscalPeriod(FiscalPeriod fiscalPeriod, EntryBook entryBook,
boolean retainedEarnings)
- throws AccountException, LockedFinancialPeriodException, LockedEntryBookException, NoFoundFinancialPeriodException, LastUnlockedFiscalPeriodException, AlreadyLockedFiscalPeriodException;
+ throws LockedFinancialPeriodException,
+ LockedEntryBookException,
+ NoFoundFinancialPeriodException,
+ LastUnlockedFiscalPeriodException,
+ AlreadyLockedFiscalPeriodException,
+ AlreadyExistAccountException,
+ InvalidAccountNumberException;
/**
* Test if we have retained earnings on a fiscal period
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -25,13 +25,8 @@
package org.chorem.lima;
-import static org.nuiton.i18n.I18n.t;
-
-import javax.swing.JOptionPane;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.util.ErrorHelper;
/**
@@ -64,18 +59,8 @@
log.error("Global application exception", ex);
}
- Throwable cause = ex;
- while (cause != null && !(cause instanceof LimaBusinessException)) {
- cause = cause.getCause();
- }
-
- if (cause instanceof LimaBusinessException) {
- JOptionPane.showMessageDialog(null, cause.getMessage(),
- t("lima.ui.common.error"), JOptionPane.ERROR_MESSAGE);
- } else {
- ErrorHelper errorHelper = new ErrorHelper(LimaConfig.getInstance());
- errorHelper.showErrorDialog(null, ex.getMessage(), ex);
- }
+ ErrorHelper errorHelper = new ErrorHelper(LimaConfig.getInstance());
+ errorHelper.showErrorDialog(null, ex.getMessage(), ex);
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-07-10 12:26:56 UTC (rev 3845)
@@ -28,7 +28,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.AccountException;
+import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.UsedAccountException;
@@ -46,7 +46,12 @@
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;
@@ -271,8 +276,10 @@
model.insertNodeInto(newNode, node, node.getChildCount());
treeTable.expandPath(new TreePath(model.getPathToRoot(node)));
- } catch (AccountException e) {
- errorHelper.showErrorMessage(t(e.getMessage()));
+ } catch (AlreadyExistAccountException e) {
+ errorHelper.showErrorMessage(t("lima.ui.account.add.error.alreadyExist", e.getAccountNumber()));
+ } catch (InvalidAccountNumberException e) {
+ errorHelper.showErrorMessage(t("lima.ui.account.add.error.InvalidAccountNumber", e.getAccountNumber()));
} finally {
dialog.dispose();
}
@@ -378,7 +385,7 @@
model.valueForPathChanged(treePath, account);
} catch (InvalidAccountNumberException e) {
- errorHelper.showErrorMessage(t(e.getMessage()));
+ errorHelper.showErrorMessage(t("lima.ui.account.update.error.invalidAccountNumber", e.getAccountNumber()));
} finally {
// close dialog
dialog.dispose();
@@ -417,7 +424,7 @@
// remove node
model.removeNodeFromParent(lastNode);
} catch (UsedAccountException e) {
- errorHelper.showErrorMessage(t(e.getMessage()));
+ errorHelper.showErrorMessage(t("lima.ui.account.remove.error.usedAccount", e.getAccountNumber()));
}
}
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-10 12:26:56 UTC (rev 3845)
@@ -337,6 +337,8 @@
lima.tooltip.Filter=
lima.tooltip.filter=<html>Regular expression \:<br/>- accounts interval i..j <br/>- accounts list i,j,k <br/>- Exclude an account -i</html>
lima.tooltip.lettering=<html>Add a letter on many entries <br/>Select many rows with combination ctrl + click</html>
+lima.ui.account.add.error.InvalidAccountNumber=
+lima.ui.account.add.error.alreadyExist=
lima.ui.account.addaccount=
lima.ui.account.addaccounttitle=
lima.ui.account.base=
@@ -346,9 +348,11 @@
lima.ui.account.importtitle=
lima.ui.account.label=
lima.ui.account.number=
+lima.ui.account.remove.error.usedAccount=
lima.ui.account.removeaccountconfirm=
lima.ui.account.removeaccounttitle=
lima.ui.account.shortened=
+lima.ui.account.update.error.invalidAccountNumber=
lima.ui.account.updateaccounttitle=
lima.ui.common.amountcredit=
lima.ui.common.amountdebit=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-10 09:15:31 UTC (rev 3844)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-10 12:26:56 UTC (rev 3845)
@@ -319,6 +319,8 @@
lima.tooltip.Filter=
lima.tooltip.filter=<html>Expression régulière \:<br/>- intervalle de compte i..j <br/>- liste de compte i,j,k <br/>- Exclure un compte -i</html>
lima.tooltip.lettering=<html>Pour ajouter une lettre à plusieurs écritures <br/>Sélectionner plusieurs lignes avec la combinaison ctrl + click</html>
+lima.ui.account.add.error.InvalidAccountNumber=Le numéro du compt %1$s n'est pas valide
+lima.ui.account.add.error.alreadyExist=Le compt %1$s existe déjà
lima.ui.account.addaccount=Nouveau compte
lima.ui.account.addaccounttitle=Ajout d'un compte
lima.ui.account.base=Plan comptable de base
@@ -328,9 +330,11 @@
lima.ui.account.importtitle=Importer
lima.ui.account.label=Libellé
lima.ui.account.number=Numéro de compte
+lima.ui.account.remove.error.usedAccount=Il exist des transactions sur ce compte
lima.ui.account.removeaccountconfirm=Voulez-vous supprimer le compte %s ?
lima.ui.account.removeaccounttitle=Suppression d'un compte
lima.ui.account.shortened=Plan comptable abrégé
+lima.ui.account.update.error.invalidAccountNumber=Le numéro du compt %1$s n'est pas valide
lima.ui.account.updateaccounttitle=Modification d'un compte
lima.ui.common.amountcredit=Total Crédit
lima.ui.common.amountdebit=Total Débit
1
0
Author: sbavencoff
Date: 2014-07-10 11:15:31 +0200 (Thu, 10 Jul 2014)
New Revision: 3844
Url: http://forge.chorem.org/projects/lima/repository/revisions/3844
Log:
refs #557 : fix fiscal period exception
Added:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
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/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.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
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -68,11 +68,14 @@
* @param fiscalPeriod
* @throws LimaException
*/
- List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException;
+ List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod)
+ throws BeginAfterEndFiscalPeriodException,
+ NotBeginNextDayOfLastFiscalPeriodException,
+ MoreOneUnlockFiscalPeriodException;
- void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException;
+ void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws LastUnlockedFiscalPeriodException;
- void deleteFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException;
+ void deleteFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws NoEmptyFiscalPeriodException;
/**
* Entry rules
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 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -31,11 +31,15 @@
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.AfterLastFiscalPeriodException;
import org.chorem.lima.business.BeforeFirstFiscalPeriodException;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.InvalidAccountNumberException;
+import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.LimaInterceptor;
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
import org.chorem.lima.business.UnfilledEntriesException;
@@ -106,24 +110,27 @@
/** Rules to check before create fiscals periods */
@Override
- public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod)
+ throws BeginAfterEndFiscalPeriodException,
+ NotBeginNextDayOfLastFiscalPeriodException,
+ MoreOneUnlockFiscalPeriodException {
//check if the enddate period is after the begindate period
if (fiscalPeriod.getEndDate().before(fiscalPeriod.getBeginDate())) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.defaultaccountingrules.enddateerror");
+ throw new BeginAfterEndFiscalPeriodException(fiscalPeriod);
}
return null;
}
/** Rules to check before block fiscals periods */
@Override
- public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException{
+ public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws LastUnlockedFiscalPeriodException {
}
/** Rules to check before delete fiscals periods */
@Override
public void deleteFiscalPeriodRules(FiscalPeriod fiscalPeriod)
- throws FiscalPeriodException {
+ throws NoEmptyFiscalPeriodException {
}
/**
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 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -29,8 +29,12 @@
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.InvalidAccountNumberException;
+import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
import org.chorem.lima.business.UnfilledEntriesException;
@@ -40,6 +44,7 @@
import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao;
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialPeriodImpl;
+import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionTopiaDao;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodTopiaDao;
@@ -113,7 +118,11 @@
* Pas plus de deux exercices fiscaux ne peuvent-être ouvert en même temps
*/
@Override
- public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod)
+ throws NotBeginNextDayOfLastFiscalPeriodException,
+ MoreOneUnlockFiscalPeriodException,
+ BeginAfterEndFiscalPeriodException {
+
super.createFiscalPeriodRules(fiscalPeriod);
List<FinancialPeriod> financialPeriods = new ArrayList<FinancialPeriod>();
@@ -132,15 +141,14 @@
Date dateFiscalPeriod = fiscalPeriod.getBeginDate();
if (dateLastFiscalPeriod.compareTo(dateFiscalPeriod) != 0) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.franceaccountingrules.newfiscalperiodadjoiningerror");
+ throw new NotBeginNextDayOfLastFiscalPeriodException(lastFiscalPeriod);
}
//We can create a new fiscal period meantime the last fiscal period was not locked
//But not the ante periodfiscal
- int unblockedFiscalPeriod =
- fiscalPeriodTopiaDao.findAllByLocked(false).size();
+ int unblockedFiscalPeriod = (int) fiscalPeriodTopiaDao.forLockedEquals(false).count();
if (unblockedFiscalPeriod > 1) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.franceaccountingrules.antefiscalperiodnotblocked");
+ throw new MoreOneUnlockFiscalPeriodException(unblockedFiscalPeriod);
}
}
@@ -175,7 +183,7 @@
* On ne peut pas clore la dernière periode comptable ouverte.
*/
@Override
- public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws LastUnlockedFiscalPeriodException {
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
FiscalPeriod oldestUnBlockedFiscalPeriod =
@@ -183,7 +191,7 @@
//Check if the fiscal period to block is the oldest
if (oldestUnBlockedFiscalPeriod.equals(fiscalPeriod)) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.franceaccountingrules.lastFiscalPeriodCantBlocked");
+ throw new LastUnlockedFiscalPeriodException(fiscalPeriod);
}
}
@@ -193,13 +201,14 @@
* On ne peut supprimer qu'une periode comptable ouverte vide.
*/
@Override
- public void deleteFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public void deleteFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws NoEmptyFiscalPeriodException {
FinancialTransactionTopiaDao financialTransactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
//Check if the fiscal period to delete is empty
- if (financialTransactionTopiaDao.findAllByDates(fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate()).size() != 0) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.franceaccountingrules.fiscalperiodnotempty");
+ List<FinancialTransaction> financialTransactions = financialTransactionTopiaDao.findAllByDates(fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate());
+ if (!financialTransactions.isEmpty()) {
+ throw new NoEmptyFiscalPeriodException(financialTransactions);
}
}
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 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -31,17 +31,22 @@
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.AccountException;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.NoFoundFinancialPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.FinancialPeriodService;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.api.ReportService;
-import org.chorem.lima.business.utils.FinancialPeriodComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
@@ -57,16 +62,15 @@
import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodTopiaDao;
+import org.nuiton.topia.persistence.TopiaNoResultException;
import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import java.math.BigDecimal;
-import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
-import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
@@ -100,7 +104,10 @@
protected FinancialTransactionService financialTransactionService;
@Override
- public FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod)
+ throws BeginAfterEndFiscalPeriodException,
+ NotBeginNextDayOfLastFiscalPeriodException,
+ MoreOneUnlockFiscalPeriodException {
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
FinancialPeriodTopiaDao financialPeriodTopiaDao = getDaoHelper().getFinancialPeriodDao();
@@ -201,12 +208,13 @@
* check localized rules before block it
*/
@Override
- public FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod)
+ throws AlreadyLockedFiscalPeriodException, LastUnlockedFiscalPeriodException {
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
if (fiscalPeriod.isLocked()) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.fiscalperiod.fiscalperiodalreadyblocked");
+ throw new AlreadyLockedFiscalPeriodException(fiscalPeriod);
}
//check rules
accountingRules.blockFiscalPeriodRules(fiscalPeriod);
@@ -273,7 +281,12 @@
@Override
public FiscalPeriod retainedEarningsAndBlockFiscalPeriod(FiscalPeriod fiscalPeriod, EntryBook entryBook,
boolean retainedEarnings)
- throws AccountException, LockedFinancialPeriodException, LockedEntryBookException, FiscalPeriodException {
+ throws AccountException,
+ LockedFinancialPeriodException,
+ LockedEntryBookException,
+ NoFoundFinancialPeriodException,
+ LastUnlockedFiscalPeriodException,
+ AlreadyLockedFiscalPeriodException {
if (entryBook != null && retainedEarnings) {
@@ -330,34 +343,28 @@
lastFPeriod = itr.next();
}
- FinancialPeriod beginfinancialPeriod = null;
- //look for the first financial period on the new fiscal year which is unlocked
- List<ClosedPeriodicEntryBook> resultsArray =
- new ArrayList<ClosedPeriodicEntryBook>();
- List<ClosedPeriodicEntryBook> closedPeriodicEntryBook =
- financialPeriodService.getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod();
- Collections.sort(closedPeriodicEntryBook, new FinancialPeriodComparator());
- resultsArray.addAll(closedPeriodicEntryBook);
- for (ClosedPeriodicEntryBook cPeriodicEntryBook : resultsArray) {
+ Date beginDateNextFiscalPeriod = DateUtils.addDays(localFiscalPeriod.getEndDate(), 1);
- //check for - unlocked financial period
- // - date after the closing fiscal year
- // - unlocked entrybook
- // - right code and label
- if (!cPeriodicEntryBook.getFinancialPeriod().isLocked()
- && cPeriodicEntryBook.getFinancialPeriod().getBeginDate().after(localFiscalPeriod.getEndDate())
- && !cPeriodicEntryBook.isLocked()
- && cPeriodicEntryBook.getEntryBook().getCode().equals(entryBook.getCode())
- && cPeriodicEntryBook.getEntryBook().getLabel().equals(entryBook.getLabel())) {
- beginfinancialPeriod = cPeriodicEntryBook.getFinancialPeriod();
- break;
- }
+ FinancialPeriodTopiaDao financialPeriodDao = getDaoHelper().getFinancialPeriodDao();
+ FinancialPeriod beginfinancialPeriod = null;
+ try {
+ beginfinancialPeriod = financialPeriodDao.findByDate(beginDateNextFiscalPeriod);
+ } catch (TopiaNoResultException e) {
+ throw new NoFoundFinancialPeriodException(beginDateNextFiscalPeriod, e);
}
- if (beginfinancialPeriod == null) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.fiscalperiod.newfinancialperioderror");
+
+ if (beginfinancialPeriod.isLocked()) {
+ throw new LockedFinancialPeriodException(beginfinancialPeriod);
}
+ ClosedPeriodicEntryBookTopiaDao closedPeriodicEntryBookDao = getDaoHelper().getClosedPeriodicEntryBookDao();
+ ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookDao.findByEntryBookAndFinancialPeriod(entryBook, beginfinancialPeriod);
+
+ if (closedPeriodicEntryBook.isLocked()) {
+ throw new LockedEntryBookException(closedPeriodicEntryBook);
+ }
+
//holds entries of all closing transactions
FinancialTransaction endfinancialTransaction = new FinancialTransactionImpl();
if (lastFPeriod != null) {
@@ -445,7 +452,7 @@
* check localized rules before delete it
*/
@Override
- public void deleteFiscalPeriod(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public void deleteFiscalPeriod(FiscalPeriod fiscalPeriod) throws NoEmptyFiscalPeriodException {
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
//get entities with TopiaDao
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -51,11 +51,13 @@
import org.chorem.lima.beans.VatStatementImport;
import org.chorem.lima.beans.VatStatementImportImpl;
import org.chorem.lima.business.AccountException;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
import org.chorem.lima.business.UnfilledEntriesException;
@@ -1228,8 +1230,12 @@
result.append(t("lima-business.import.fiscalperiodadded",
fiscalPeriod.getBeginDate(),
fiscalPeriod.getEndDate()));
- } catch (FiscalPeriodException e) {
- result.append(t("lima-business.common.failed", e.getMessage()));
+ } catch (BeginAfterEndFiscalPeriodException e) {
+ result.append("Can't import " + t("lima-business.import.FiscalPeriod.error.beginAfterEndFiscalPeriod"));
+ } catch (MoreOneUnlockFiscalPeriodException e) {
+ result.append("Can't import " + t("lima-business.import.FiscalPeriod.error.moreOneUnlockFiscalPeriod"));
+ } catch (NotBeginNextDayOfLastFiscalPeriodException e) {
+ result.append("Can't import " + t("lima-business.import.FiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod"));
}
}
return result.toString();
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 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2014-07-10 09:15:31 UTC (rev 3844)
@@ -87,6 +87,9 @@
lima-business.franceaccountingrules.newfiscalperiodadjoiningerror=The new fiscal period must adjoining the last
lima-business.import.FinancialTransaction.error.LockedEntryBook=
lima-business.import.FinancialTransaction.error.LockedFinancialPeriod=
+lima-business.import.FiscalPeriod.error.beginAfterEndFiscalPeriod=
+lima-business.import.FiscalPeriod.error.moreOneUnlockFiscalPeriod=
+lima-business.import.FiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod=
lima-business.import.accountadded=SUCCES \: Account %s - %s added\n
lima-business.import.accountalreadyexist=FAILED \: Account %s already exist \n
lima-business.import.closedperiodicentrybookupdated=SUCCESS \: The blockClosedPeriodicEntryBook %s - %s - %s is updated \! \n
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 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-07-10 09:15:31 UTC (rev 3844)
@@ -84,6 +84,9 @@
lima-business.franceaccountingrules.newfiscalperiodadjoiningerror=La nouvelle période fiscale doit suivre la précédente
lima-business.import.FinancialTransaction.error.LockedEntryBook=Impossible de mettre à jour la transaction \: la période financière de ce nouveau journal est bloquée
lima-business.import.FinancialTransaction.error.LockedFinancialPeriod=La période financière est bloquée
+lima-business.import.FiscalPeriod.error.beginAfterEndFiscalPeriod=La date de début doit être avant la date de fin
+lima-business.import.FiscalPeriod.error.moreOneUnlockFiscalPeriod=Seul deux exercices non clôturés sont autorisés
+lima-business.import.FiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod=la date de début doit suivre la date de fin du précédent exercice
lima-business.import.accountadded=Succès \: Compte %s - %s ajouté\n
lima-business.import.accountalreadyexist=Échec \: Le compte %s existe déjà \n
lima-business.import.closedPeriodicEntryBook.error.NotLockedPreviousEntryBook=Les périodes financières précédentes pour ce journal doivent être bloquées avant
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -24,7 +24,9 @@
package org.chorem.lima.business.accountingrules;
import org.apache.commons.lang3.time.DateUtils;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialPeriodImpl;
import org.chorem.lima.entity.FiscalPeriod;
@@ -59,7 +61,10 @@
* Copier/coller de la methode france.
* Le probleme ici est que le default n'en creer aucune.
*/
- public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws FiscalPeriodException {
+ public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod)
+ throws MoreOneUnlockFiscalPeriodException,
+ NotBeginNextDayOfLastFiscalPeriodException,
+ BeginAfterEndFiscalPeriodException {
super.createFiscalPeriodRules(fiscalPeriod);
List<FinancialPeriod> financialPeriods = new ArrayList<FinancialPeriod>();
FiscalPeriodTopiaDao fiscalPeriodDAO = getDaoHelper().getFiscalPeriodDao();
@@ -75,14 +80,14 @@
dateLastFiscalPeriod = DateUtils.truncate(dateLastFiscalPeriod, Calendar.DATE);
Date dateFiscalPeriod = fiscalPeriod.getBeginDate();
if (dateLastFiscalPeriod.compareTo(dateFiscalPeriod) != 0) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.franceaccountingrules.newfiscalperiodadjoiningerror");
+ throw new NotBeginNextDayOfLastFiscalPeriodException(lastFiscalPeriod);
}
//We can create a new fiscal period meantime the last fiscal period was not locked
//But not the ante periodfiscal
int unblockedFiscalPeriod = fiscalPeriodDAO.forLockedEquals(false).findAll().size();
if (unblockedFiscalPeriod > 1) {
- throw new FiscalPeriodException(fiscalPeriod, "lima-business.franceaccountingrules.antefiscalperiodnotblocked");
+ throw new MoreOneUnlockFiscalPeriodException(unblockedFiscalPeriod);
}
}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -0,0 +1,17 @@
+package org.chorem.lima.business;
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class AlreadyLockedFiscalPeriodException extends FiscalPeriodException {
+
+ public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+
+ public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super(fiscalPeriod, cause);
+ }
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -0,0 +1,17 @@
+package org.chorem.lima.business;
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class BeginAfterEndFiscalPeriodException extends FiscalPeriodException {
+
+ public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+
+ public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super(fiscalPeriod, cause);
+ }
+}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -5,7 +5,7 @@
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
-public class DateException extends LimaException {
+public abstract class DateException extends LimaException {
protected Date date;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -27,25 +27,17 @@
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
-public class FiscalPeriodException extends LimaException {
+public abstract class FiscalPeriodException extends LimaException {
protected FiscalPeriod fiscalPeriod;
- public FiscalPeriodException(String message) {
- super(message);
- }
-
- public FiscalPeriodException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FiscalPeriodException(FiscalPeriod fiscalPeriod, String message) {
- super(message);
+ public FiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super("");
this.fiscalPeriod = fiscalPeriod;
}
- public FiscalPeriodException(FiscalPeriod fiscalPeriod, String message, Throwable cause) {
- super(message, cause);
+ public FiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super("", cause);
this.fiscalPeriod = fiscalPeriod;
}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -0,0 +1,17 @@
+package org.chorem.lima.business;
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class LastUnlockedFiscalPeriodException extends FiscalPeriodException {
+
+ public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+
+ public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super(fiscalPeriod, cause);
+ }
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -0,0 +1,23 @@
+package org.chorem.lima.business;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class MoreOneUnlockFiscalPeriodException extends LimaException {
+
+ int countUnlockFiscalPeriod;
+
+ public MoreOneUnlockFiscalPeriodException(int countUnlockFiscalPeriod) {
+ super("");
+ this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
+ }
+
+ public MoreOneUnlockFiscalPeriodException(int countUnlockFiscalPeriod, Throwable cause) {
+ super("", cause);
+ this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
+ }
+
+ public int getCountUnlockFiscalPeriod() {
+ return countUnlockFiscalPeriod;
+ }
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -0,0 +1,18 @@
+package org.chorem.lima.business;
+
+import org.chorem.lima.entity.FinancialTransaction;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NoEmptyFiscalPeriodException extends FinancialTransactionsException {
+ public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions) {
+ super(financialTransactions);
+ }
+
+ public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
+ super(financialTransactions, cause);
+ }
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -0,0 +1,17 @@
+package org.chorem.lima.business;
+
+import java.util.Date;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NoFoundFinancialPeriodException extends DateException {
+
+ public NoFoundFinancialPeriodException(Date date) {
+ super(date);
+ }
+
+ public NoFoundFinancialPeriodException(Date date, Throwable cause) {
+ super(date, cause);
+ }
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -0,0 +1,17 @@
+package org.chorem.lima.business;
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NotBeginNextDayOfLastFiscalPeriodException extends FiscalPeriodException {
+
+ public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+
+ public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super(fiscalPeriod, cause);
+ }
+}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -26,9 +26,15 @@
package org.chorem.lima.business.api;
import org.chorem.lima.business.AccountException;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.NoFoundFinancialPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FiscalPeriod;
@@ -53,11 +59,15 @@
FiscalPeriod getLastFiscalPeriod();
- FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) throws FiscalPeriodException;
+ FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod)
+ throws BeginAfterEndFiscalPeriodException,
+ NotBeginNextDayOfLastFiscalPeriodException,
+ MoreOneUnlockFiscalPeriodException;
- FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws FiscalPeriodException;
+ FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod)
+ throws AlreadyLockedFiscalPeriodException, LastUnlockedFiscalPeriodException;
- void deleteFiscalPeriod(FiscalPeriod fiscalPeriod) throws FiscalPeriodException;
+ void deleteFiscalPeriod(FiscalPeriod fiscalPeriod) throws NoEmptyFiscalPeriodException;
/**
* Eventually add retained earnings on last unclosed fiscal period,
@@ -69,7 +79,7 @@
* */
FiscalPeriod retainedEarningsAndBlockFiscalPeriod(FiscalPeriod fiscalPeriod, EntryBook entryBook,
boolean retainedEarnings)
- throws AccountException, FiscalPeriodException, LockedFinancialPeriodException, LockedEntryBookException;
+ throws AccountException, LockedFinancialPeriodException, LockedEntryBookException, NoFoundFinancialPeriodException, LastUnlockedFiscalPeriodException, AlreadyLockedFiscalPeriodException;
/**
* Test if we have retained earnings on a fiscal period
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-07-10 09:15:31 UTC (rev 3844)
@@ -30,7 +30,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
@@ -196,8 +201,16 @@
fiscalPeriod.setEndDate(addPeriodDialog.getEndDatePicker().getDate());
fiscalPeriod = fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
tableModel.addValue(fiscalPeriod);
- } catch (FiscalPeriodException e) {
- errorHelper.showErrorMessage(t(e.getMessage()));
+ } catch (BeginAfterEndFiscalPeriodException e) {
+ errorHelper.showErrorMessage(t("lima.ui.fiscalPeriod.add.error.beginAfterEndFiscalPeriod",
+ e.getFiscalPeriod().getBeginDate(),
+ e.getFiscalPeriod().getEndDate()));
+ } catch (MoreOneUnlockFiscalPeriodException e) {
+ errorHelper.showErrorMessage(t("lima.ui.fiscalPeriod.add.error.moreOneUnlockFiscalPeriod",
+ e.getCountUnlockFiscalPeriod()));
+ } catch (NotBeginNextDayOfLastFiscalPeriodException e) {
+ errorHelper.showErrorMessage(t("lima.ui.fiscalPeriod.add.error.notBeginNextDayOfLastFiscalPeriod",
+ e.getFiscalPeriod().getEndDate()));
}
}
}
@@ -211,10 +224,9 @@
if (!addPeriodDialog.isValidate()) {
return false;
} else if (endDate.before(beginDate)) {
- JOptionPane.showMessageDialog(view,
- t("lima.ui.fiscalperiod.addfiscalperiod.endAfterBegin"),
- title,
- JOptionPane.ERROR_MESSAGE);
+ errorHelper.showErrorMessage(t("lima.ui.fiscalPeriod.add.error.beginAfterEndFiscalPeriod",
+ beginDate,
+ endDate));
return false;
} else {
//check if fiscalperiod have 12 months, ask a confirmation
@@ -297,8 +309,9 @@
tableModel.remove(selectedFiscalPeriod);
view.setBlockEnabled(false);
view.setDeleteEnabled(false);
- } catch (FiscalPeriodException e) {
- errorHelper.showErrorMessage(t(e.getMessage()));
+ } catch (NoEmptyFiscalPeriodException e) {
+ errorHelper.showErrorMessage(t("lima.ui.fiscalPeriod.delete.error.noEmptyFiscalPeriod",
+ e.getFinancialTransactions().size()));
}
}
}
@@ -427,8 +440,12 @@
view.setBlockEnabled(false);
view.setDeleteEnabled(false);
- } catch (FiscalPeriodException e) {
- errorHelper.showErrorMessage(t(e.getMessage()));
+ } catch (LastUnlockedFiscalPeriodException e) {
+ errorHelper.showErrorMessage(t("lima.ui.fiscalPeriod.block.error.lastUnlockedFiscalPeriod",
+ e.getFiscalPeriod().getBeginDate(),
+ e.getFiscalPeriod().getEndDate()));
+ } catch (AlreadyLockedFiscalPeriodException e) {
+ errorHelper.showErrorMessage(t("lima.ui.fiscalPeriod.block.error.AlreadyLockedFiscalPeriod"));
}
}
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-10 09:15:31 UTC (rev 3844)
@@ -440,8 +440,17 @@
lima.ui.financialtransaction.titleremoveentry=
lima.ui.financialtransaction.titleremovetransaction=
lima.ui.financialtransaction.voucher=
+lima.ui.fiscalPeriod.add.beginAfterEndFiscalPeriod=
+lima.ui.fiscalPeriod.add.error.beginAfterEndFiscalPeriod=
+lima.ui.fiscalPeriod.add.error.moreOneUnlockFiscalPeriod=
+lima.ui.fiscalPeriod.add.error.notBeginNextDayOfLastFiscalPeriod=
+lima.ui.fiscalPeriod.add.moreOneUnlockFiscalPeriod=
+lima.ui.fiscalPeriod.add.notBeginNextDayOfLastFiscalPeriod=
+lima.ui.fiscalPeriod.block.error.AlreadyLockedFiscalPeriod=
+lima.ui.fiscalPeriod.block.error.lastUnlockedFiscalPeriod=
lima.ui.fiscalPeriod.buttonback=
lima.ui.fiscalPeriod.buttonnext=
+lima.ui.fiscalPeriod.delete.error.noEmptyFiscalPeriod=
lima.ui.fiscalperiod.addfiscalperiod.addfiscalperiodtitle=
lima.ui.fiscalperiod.addfiscalperiod.endAfterBegin=
lima.ui.fiscalperiod.addfiscalperiod.morethan12=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-10 06:31:00 UTC (rev 3843)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-10 09:15:31 UTC (rev 3844)
@@ -419,9 +419,14 @@
lima.ui.financialtransaction.titleremoveentry=Suppression
lima.ui.financialtransaction.titleremovetransaction=Suppression
lima.ui.financialtransaction.voucher=Pièce comptable
+lima.ui.fiscalPeriod.add.error.beginAfterEndFiscalPeriod=Le date de fin de l'exercice (%2$te/%2$tm/%2$tY) doit être postérieur à la date de début (%1$te/%1$tm/%1$tY)
+lima.ui.fiscalPeriod.add.error.moreOneUnlockFiscalPeriod=Il existe déjà %1s exercices non clôturés.
+lima.ui.fiscalPeriod.add.error.notBeginNextDayOfLastFiscalPeriod=La date de début de l'exercice doit suivre la date de fin de l'exercice précédent le %1$te/%1$tm/%1$tY
+lima.ui.fiscalPeriod.block.error.AlreadyLockedFiscalPeriod=L'exercice est déjà clôturés
+lima.ui.fiscalPeriod.block.error.lastUnlockedFiscalPeriod=L'exercice prédent doit être clôturé
lima.ui.fiscalPeriod.buttonback=
lima.ui.fiscalPeriod.buttonnext=
-lima.ui.fiscalperiod.addfiscalperiod.endAfterBegin=Le date de fin de l'exercice doit être postérieur à la date de début
+lima.ui.fiscalPeriod.delete.error.noEmptyFiscalPeriod=Impossible de supprimer un exercice avec des transactions (%1$s).
lima.ui.fiscalperiod.addfiscalperiod.morethan12=La période sélectionnée n'est pas de 12 mois, voulez-vous continuer ?
lima.ui.fiscalperiod.addfiscalperiodtitle=Nouvel exercice
lima.ui.fiscalperiod.begin=Début
1
0