r3328 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
Author: echatellier Date: 2012-02-21 14:50:57 +0100 (Tue, 21 Feb 2012) New Revision: 3328 Url: http://chorem.org/repositories/revision/lima/3328 Log: Remove service states (accountingRules) to test service with different countries 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/DocumentServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.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/HttpServerServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.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 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -59,11 +59,8 @@ private TopiaContext rootContext; - protected AccountingRules accountingRules; - public AccountServiceImpl() { rootContext = acquireRootContext(); - accountingRules = LimaConfig.getInstance().getAccountingRules(); } @Override @@ -72,7 +69,7 @@ TopiaContext topiaContext) throws LimaException { try { - // force upppercase account number + // force uppercase account number account.setAccountNumber(account.getAccountNumber().toUpperCase()); // check if account number already exist @@ -123,6 +120,7 @@ Account account) throws LimaException { //check rules before create the account + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); accountingRules.createAccountRules(masterAccount, account); TopiaContext transaction = beginTransaction(rootContext); @@ -184,6 +182,7 @@ Account account) throws LimaException { //check rules before create the account + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); accountingRules.createSubLedgerRules(masterAccount, account); TopiaContext transaction = beginTransaction(rootContext); @@ -378,6 +377,8 @@ @Override public void removeAccount(Account account) throws LimaException { TopiaContext transaction = beginTransaction(rootContext); + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction); @@ -434,6 +435,7 @@ public void updateAccount(Account account) throws LimaException { TopiaContext transaction = beginTransaction(rootContext); + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); try { // DAO Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2008 - 2010 CodeLutin + * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -117,9 +117,6 @@ private static final SimpleDateFormat hourFormat = new SimpleDateFormat("HH:mm"); -// private static final SimpleDateFormat filedateFormat = -// new SimpleDateFormat("dd-MM-yyyy_HH-mm"); - private static final SimpleDateFormat monthYearFormat = new SimpleDateFormat("MMM yyyy"); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -59,11 +59,8 @@ private TopiaContext rootContext; - protected AccountingRules accountingRules; - public EntryBookServiceImpl() { rootContext = acquireRootContext(); - accountingRules = LimaConfig.getInstance().getAccountingRules(); } @Override @@ -173,6 +170,7 @@ public void removeEntryBook(EntryBook entryBook) throws LimaException { TopiaContext topiaTransaction = beginTransaction(rootContext); + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); try { Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2008 - 2010 CodeLutin + * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -59,11 +59,8 @@ private TopiaContext rootContext; - protected AccountingRules accountingRules; - public FinancialPeriodServiceImpl() { rootContext = acquireRootContext(); - accountingRules = LimaConfig.getInstance().getAccountingRules(); } /** @@ -206,6 +203,8 @@ public void blockClosedPeriodicEntryBookWithTransaction( ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException { + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { //check rules before create the account accountingRules.blockClosedPeriodicEntryBookRules( @@ -249,7 +248,6 @@ FinancialPeriod financialPeriod) throws LimaException { ClosedPeriodicEntryBook closedPeriodicEntryBook = null; - TopiaContext topiaContext = beginTransaction(rootContext); try { 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 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2008 - 2010 CodeLutin + * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -34,8 +34,6 @@ import org.chorem.lima.beans.FinancialStatementDatas; import org.chorem.lima.beans.FinancialStatementDatasImpl; import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ejbinterface.FinancialStatementService; import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal; @@ -65,14 +63,11 @@ private TopiaContext rootContext; - protected AccountingRules accountingRules; - @EJB private ReportServiceLocal reportServiceLocal; public FinancialStatementServiceImpl() { rootContext = acquireRootContext(); - accountingRules = LimaConfig.getInstance().getAccountingRules(); } @Override 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 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -25,7 +25,6 @@ package org.chorem.lima.business.ejb; - import org.chorem.lima.FinancialStatementWayEnum; import org.chorem.lima.beans.FinancialTransactionSearch; import org.chorem.lima.business.AccountingRules; @@ -77,8 +76,6 @@ private TopiaContext rootContext; - protected AccountingRules accountingRules; - @EJB protected FinancialPeriodServiceLocal financialPeriodService; @@ -93,7 +90,6 @@ public FinancialTransactionServiceImpl() { rootContext = acquireRootContext(); - accountingRules = LimaConfig.getInstance().getAccountingRules(); } @Override @@ -101,6 +97,8 @@ FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException { FinancialTransaction fTransaction = null; + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { //check if the financial period is blocked accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction( @@ -358,6 +356,9 @@ @Override public void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException { + + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { FinancialTransactionDAO transactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); @@ -401,6 +402,8 @@ public void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException { TopiaContext topiaTransaction = beginTransaction(rootContext); + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { //check if the financial period is blocked @@ -424,6 +427,8 @@ @Override public Entry createEntryWithTransaction(Entry entry, TopiaContext topiaContext) throws LimaException { + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + Entry newEntry = null; try { //check if the financial period is blocked @@ -471,6 +476,8 @@ public void updateEntry(Entry entry) throws LimaException { TopiaContext topiaContext = beginTransaction(rootContext); + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext); @@ -509,6 +516,8 @@ @Override public void removeEntry(Entry entry) throws LimaException { + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + TopiaContext topiaContext = beginTransaction(rootContext); try { 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 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -69,7 +69,6 @@ import static org.nuiton.i18n.I18n._; - /** * Gestion des exercices. * Un exercice ne peut être supprimée et débloquée après cloture. @@ -81,8 +80,6 @@ private TopiaContext rootContext; - protected AccountingRules accountingRules; - @EJB protected AccountServiceLocal accountService; @@ -100,13 +97,14 @@ public FiscalPeriodServiceImpl() { rootContext = acquireRootContext(); - accountingRules = LimaConfig.getInstance().getAccountingRules(); } - @Override public void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException { + + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { Date beginDate = fiscalPeriod.getBeginDate(); @@ -250,9 +248,11 @@ */ @Override public void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException { + //open transaction for update TopiaContext transaction = beginTransaction(rootContext); - //open transaction for update + AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); + try { if (fiscalPeriod.getLocked()) { Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -60,7 +60,6 @@ import org.nuiton.util.FileUtil; import org.nuiton.util.Resource; - @Stateless public class HttpServerServiceImpl extends AbstractLimaService implements HttpServerService, HttpServerServiceLocal { Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2008 - 2010 CodeLutin + * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2012-02-20 17:54:22 UTC (rev 3327) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2012-02-21 13:50:57 UTC (rev 3328) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2008 - 2011 CodeLutin + * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -60,7 +60,6 @@ * * @author vsalaun */ - @Stateless public class VatStatementServiceImpl extends AbstractLimaService implements VatStatementService, VatStatementServiceLocal {
participants (1)
-
echatellier@users.chorem.org