Author: jpepin Date: 2010-07-22 12:36:21 +0200 (Thu, 22 Jul 2010) New Revision: 2983 Url: http://chorem.org/repositories/revision/lima/2983 Log: D?\195?\169placement cr?\195?\169ation de document pdf et html dans un nouveau service du business. Added: trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java Removed: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/xml/ Modified: trunk/lima-business/pom.xml trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.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/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/ImportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java trunk/lima-swing/pom.xml trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx Modified: trunk/lima-business/pom.xml =================================================================== --- trunk/lima-business/pom.xml 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/pom.xml 2010-07-22 10:36:21 UTC (rev 2983) @@ -28,6 +28,10 @@ <groupId>net.sf.opencsv</groupId> <artifactId>opencsv</artifactId> </dependency> + <dependency> + <groupId>com.lowagie</groupId> + <artifactId>itext</artifactId> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,65 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; -import javax.ejb.Remote; -import org.chorem.lima.entity.Account; - -/** - * Account service. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ - -@Remote -public interface AccountService { - - List<Account> getAllAccounts() throws LimaException; - - List<Account> getAllSubAccounts() throws LimaException; - - /** - * Create new account. If {@code masterAccount} is not null, {@code account} - * is added in {@code masterAccount}'s subAccounts. - * - * @param masterAccount master account (can be null) - * @param account account - * @throws LimaException - */ - //EJB Remote - void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException; - - void createSubLedger(Account masterAccount, Account account) throws LimaException; - - void updateAccount(Account account) throws LimaException; - - void removeAccount(Account account) throws LimaException; - void removeAllAccount() throws LimaException; - - List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException; - - //EJB Remote et local - List<Account> getChildrenAccounts(Account masterAccount) throws LimaException; -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,44 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; - -import javax.ejb.Local; - -import org.chorem.lima.entity.Account; -import org.nuiton.topia.TopiaContext; - -/** - * Account service. - * - * @author chatellier - * @version $Revision: 2917 $ - * - * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $ - * By : $Author: jpepin $ - */ - -@Local -public interface AccountServiceLocal extends AccountService{ - - public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, TopiaContext topiaContext) throws LimaException; - -} \ No newline at end of file Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.AccountService; + public interface AccountServiceMonitorable extends AccountService, ServiceMonitorable { } Added: trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business; + +import org.chorem.lima.business.ejbinterface.DocumentService; + +public interface DocumentServiceMonitorable extends DocumentService, ServiceMonitorable { + +} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,46 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; -import javax.ejb.Remote; -import org.chorem.lima.entity.EntryBook; - -/** - * Entry book service. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ - -@Remote -public interface EntryBookService { - - List<EntryBook> getAllEntryBooks() throws LimaException; - - void createEntryBook(EntryBook entryBook) throws LimaException; - - void updateEntryBook(EntryBook entryBook) throws LimaException; - - void removeEntryBook(EntryBook entryBook) throws LimaException; -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,38 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Local; - - -/** - * Entry book service. - * - * @author chatellier - * @version $Revision: 2889 $ - * - * Last update : $Date: 2010-05-10 15:13:56 +0200 (lun. 10 mai 2010) $ - * By : $Author: jpepin $ - */ - -@Local -public interface EntryBookServiceLocal extends EntryBookService { - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.EntryBookService; + public interface EntryBookServiceMonitorable extends EntryBookService, ServiceMonitorable { } Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,73 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Remote; - -/** - * Import export service. - * - * Currently import and export as XML. - * - * @author chatellier - * @version $Revision: 2962 $ - * - * Last update : $Date: 2010-07-05 16:59:28 +0200 (lun., 05 juil. 2010) $ - * By : $Author: jpepin $ - */ -@Remote -public interface ExportService { - - - /** - * Get database export as CSV; - * - * @return export as byte array - * @throws LimaException - */ - public String exportAsCSV() throws LimaException; - - /** - * export entrybook chart as CSV. - */ - public String exportEntryBookChartAsCSV() throws LimaException; - - /** - * export financialstatement chart as CSV. - */ - public String exportFinancialStatementChartAsCSV() throws LimaException; - - /** - * export accounts chart as CSV. - */ - public String exportAccountsChartAsCSV() throws LimaException; - - /** - * export entries as EBP - */ - public String exportEntriesAsEBP() throws LimaException; - - /** - * export accounts as EBP - */ - public String exportAccountsAsEBP() throws LimaException; - - -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,38 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Local; - -/** - * Import export service. - * - * Currently import and export as XML. - * - * @author chatellier - * @version $Revision: 2824 $ - * - * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $ - * By : $Author: echatellier $ - */ -@Local -public interface ExportServiceLocal extends ExportService { - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.ExportService; + public interface ExportServiceMonitorable extends ExportService, ServiceMonitorable { } Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,53 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; -import javax.ejb.Remote; -import org.chorem.lima.entity.ClosedPeriodicEntryBook; -import org.chorem.lima.entity.EntryBook; -import org.chorem.lima.entity.FinancialPeriod; - -/** - * Financial period service. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ - -@Remote -public interface FinancialPeriodService { - - List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException; - - - void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException; - - /** Methodes for closedperiodicentrybook */ - - ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook, FinancialPeriod financialPeriod) throws LimaException; - - List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException; - - void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException; -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,46 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; - -import javax.ejb.Local; - -import org.chorem.lima.entity.FinancialPeriod; -import org.nuiton.topia.TopiaContext; - - -/** - * Financial period service. - * - * @author chatellier - * @version $Revision: 2913 $ - * - * Last update : $Date: 2010-05-27 16:36:34 +0200 (jeu. 27 mai 2010) $ - * By : $Author: jpepin $ - */ - -@Local -public interface FinancialPeriodServiceLocal extends FinancialPeriodService { - - void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods, TopiaContext topiaContext) throws LimaException; - - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.FinancialPeriodService; + public interface FinancialPeriodServiceMonitorable extends FinancialPeriodService, ServiceMonitorable { } Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,44 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.Date; -import java.util.List; - -import javax.ejb.Remote; - -import org.chorem.lima.beans.FinancialStatementAmounts; -import org.chorem.lima.entity.FinancialStatement; - -@Remote -public interface FinancialStatementService { - - - public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException; - public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException; - public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException; - - public List<FinancialStatement> getAllFinancialStatements() throws LimaException; - public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException; - public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException; - - public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException; - -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,27 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Local; - -@Local -public interface FinancialStatementServiceLocal extends FinancialStatementService { - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.FinancialStatementService; + public interface FinancialStatementServiceMonitorable extends FinancialStatementService, ServiceMonitorable { } Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,80 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; - -import javax.ejb.Remote; - -import org.chorem.lima.entity.Entry; -import org.chorem.lima.entity.EntryBook; -import org.chorem.lima.entity.FinancialPeriod; -import org.chorem.lima.entity.FinancialTransaction; -import org.chorem.lima.entity.FiscalPeriod; - -/** - * Transaction service. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ - -@Remote -public interface FinancialTransactionService { - - - /** - * Find all transaction for an entry book and a financial period. - * - * @param entryBook entry book - * @param period financial period - * @return all transaction for entry book and period - * @throws LimaException - */ - List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod( - FinancialPeriod period) throws LimaException; - - List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod( - EntryBook entryBook, FinancialPeriod period) throws LimaException; - - List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException; - - void createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException; - - void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException, LimaBusinessException; - - void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException; - - /** - * Methodes for create, update and remove the entry - * @param entry - * @throws LimaException - */ - - void createEntry(Entry entry) throws LimaException; - - void updateEntry(Entry entry) throws LimaException; - - void removeEntry(Entry entry) throws LimaException; - -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,42 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; -import javax.ejb.Local; -import org.chorem.lima.entity.FinancialTransaction; -import org.nuiton.topia.TopiaContext; - -/** - * Transaction service. - * - * @author chatellier - * @version $Revision: 2917 $ - * - * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $ - * By : $Author: jpepin $ - */ - -@Local -public interface FinancialTransactionServiceLocal extends FinancialTransactionService { - - public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException; - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.FinancialTransactionService; + public interface FinancialTransactionServiceMonitorable extends FinancialTransactionService, ServiceMonitorable { } Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,51 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.List; - -import javax.ejb.Remote; - -import org.chorem.lima.entity.FiscalPeriod; - -/** - * Fiscal period service. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ -@Remote -public interface FiscalPeriodService { - - List<FiscalPeriod> getAllFiscalPeriods() throws LimaException; - - List<FiscalPeriod> getAllUnblockedFiscalPeriods() throws LimaException; - - FiscalPeriod getLastFiscalPeriod() throws LimaException; - - void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; - - void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; - - void removeAllFiscalPeriods() throws LimaException; -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,36 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Local; - -/** - * Fiscal period service. - * - * @author chatellier - * @version $Revision: 2910 $ - * - * Last update : $Date: 2010-05-26 20:37:42 +0200 (mer. 26 mai 2010) $ - * By : $Author: jpepin $ - */ -@Local -public interface FiscalPeriodServiceLocal extends FiscalPeriodService { - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.FiscalPeriodService; + public interface FiscalPeriodServiceMonitorable extends FiscalPeriodService, ServiceMonitorable { } Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,75 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Remote; - -/** - * Import export service. - * - * Currently import and export as XML. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ -@Remote -public interface ImportService { - - /** - * Import data as EBP CSV export. - * - * @param data - * @throws LimaException - */ - public String importEntriesFromEbp(String datas) throws LimaException; - public String importAccountsChartFromEbp(String datas) throws LimaException; - - - /** - * Import data as Sage Maestria export. - * - * @param data - * @throws LimaException - */ - public void importAsSage(byte[] data) throws LimaException; - - /** - * Import data as Ciel Compta export. - * - * @param data - * @throws LimaException - */ - public void importAsCiel(byte[] data) throws LimaException; - - /** - * import CSV. - * Return result log - */ - public String importAllAsCSV(String path) throws LimaException; - - public String importAccountsChartAsCSV(String path) throws LimaException; - - public String importFinancialStatementsChartAsCSV(String path) throws LimaException; - - public String importEntryBooksChartAsCSV(String path) throws LimaException; -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,38 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Local; - -/** - * Import export service. - * - * Currently import and export as XML. - * - * @author chatellier - * @version $Revision: 2824 $ - * - * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $ - * By : $Author: echatellier $ - */ -@Local -public interface ImportServiceLocal extends ImportService { - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,26 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.ImportService; + public interface ImportServiceMonitorable extends ImportService, ServiceMonitorable { } Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,44 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Remote; - -/** - * Fiscal period service. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ - -@Remote -public interface RecordService { - - //List<FiscalPeriod> getAllFiscalPeriods() throws LimaException; - - //void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; - - //void updateFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; - - //void removeFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,37 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import javax.ejb.Local; - -/** - * Fiscal period service. - * - * @author chatellier - * @version $Revision: 2902 $ - * - * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $ - * By : $Author: jpepin $ - */ - -@Local -public interface RecordServiceLocal extends RecordService { - -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,85 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.Date; - -import javax.ejb.Remote; - -import org.chorem.lima.beans.BalanceTrial; -import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.entity.Account; -import org.chorem.lima.entity.EntryBook; - -/** - * Service de generation des rapports. - * - * Actuellement: - * <ul> - * <li>Balance</li> - * <li>Bilan</li> - * </ul> - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ - -@Remote -public interface ReportService { - - /** - * Generation du bilan. - * - * @param fiscalPeriod exercice - * @return le bilan - * @throws LimaException - * BalanceSheet generateBalanceSheet(FiscalPeriod fiscalPeriod) throws LimaException; - */ - - /** - * Generation de la balance. - * - * @return la balance - * @throws LimaException - */ - BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries) throws LimaException; - - /** - * Generation du grand-livre - * - * @throws LimaException - */ - BalanceTrial generateLedger(Date beginDate, Date endDate) throws LimaException; - - - /** - * Generation du rapports des comptes - */ - ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException; - - /** - * Generation du rapports des journaux - */ - ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException; - -} Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,52 +0,0 @@ -/* *##% Lima Business - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##%* - */ - -package org.chorem.lima.business; - -import java.util.Date; - -import javax.ejb.Local; - -import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.entity.Account; -import org.nuiton.topia.TopiaContext; - - -/** - * Service de generation des rapports. - * - * Actuellement: - * <ul> - * <li>Balance</li> - * <li>Bilan</li> - * </ul> - * - * @author chatellier - * @version $Revision: 2902 $ - * - * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $ - * By : $Author: jpepin $ - */ - -@Local -public interface ReportServiceLocal extends ReportService { - - public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException; - -} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,5 +1,7 @@ package org.chorem.lima.business; +import org.chorem.lima.business.ejbinterface.ReportService; + public interface ReportServiceMonitorable extends ReportService, ServiceMonitorable { } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,3 +1,22 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; public interface ServiceListener { Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -1,3 +1,22 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + package org.chorem.lima.business; public interface ServiceMonitorable { 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -29,12 +29,12 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.AccountService; -import org.chorem.lima.business.AccountServiceLocal; import org.chorem.lima.business.AccountingRules; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.AccountService; +import org.chorem.lima.business.ejbinterface.AccountServiceLocal; import org.chorem.lima.business.utils.AccountComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountDAO; @@ -75,6 +75,46 @@ accountingRules = config.getAccountingRules(); } + + @Override + public void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, + LimaBusinessException { + + try { + // check if account number already exist + AccountDAO accountDAO = + LimaCallaoDAOHelper.getAccountDAO(topiaContext); + + Account existAccount = + accountDAO.findByAccountNumber(account.getAccountNumber()); + if (existAccount != null) { + throw new LimaBusinessException(_( + "An account already exists with this number : %s", + account.getAccountNumber())); + } + + //create it + accountDAO.create(account); + + Account masterAccountUpdate = null; + if (masterAccount != null){ + masterAccountUpdate = accountDAO.findByAccountNumber(masterAccount.getAccountNumber()); + } + + // check if parent account exist; + if (masterAccountUpdate != null) { + masterAccountUpdate.addSubAccounts(account); + accountDAO.update(masterAccountUpdate); + } + + commitTransaction(topiaContext); + } + catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + } + + /** * Permet de créer un nouveau compte dans le PCG de l'application. * ATTENTION : le compte masterAccount, c'est à dire le compte père, doit @@ -94,35 +134,10 @@ try { transaction = beginTransaction(); - // check if account number already exist - AccountDAO accountDAO = - LimaCallaoDAOHelper.getAccountDAO(transaction); - - Account existAccount = - accountDAO.findByAccountNumber(account.getAccountNumber()); - if (existAccount != null) { - throw new LimaBusinessException(_( - "An account already exists with this number : %s", - account.getAccountNumber())); - } - - //create it - accountDAO.create(account); + createAccountWithTransaction(masterAccount, account, transaction); - Account masterAccountUpdate = null; - if (masterAccount != null){ - masterAccountUpdate = accountDAO.findByAccountNumber(masterAccount.getAccountNumber()); - } - - // check if parent account exist; - if (masterAccountUpdate != null) { - masterAccountUpdate.addSubAccounts(account); - accountDAO.update(masterAccountUpdate); - } - - commitTransaction(transaction); } - catch (Exception ex) { + catch (TopiaException ex) { doCatch(transaction, ex, log); } finally { @@ -130,23 +145,14 @@ } } - /** - * Permet de créer des comptes tiers - */ + @Override - public void createSubLedger(Account masterAccount, Account account) - throws LimaException { + public void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException { - //check rules before create the account - accountingRules.createSubLedgerRules(masterAccount, account); - - TopiaContext transaction = null; - try { - transaction = beginTransaction(); - - // check if the accountnumber already exist + try { + // check if the accountnumber already exist AccountDAO accountDAO = - LimaCallaoDAOHelper.getAccountDAO(transaction); + LimaCallaoDAOHelper.getAccountDAO(topiaContext); Account existAccount = accountDAO.findByAccountNumber(account.getAccountNumber()); if (existAccount != null) { @@ -169,9 +175,30 @@ accountDAO.update(masterAccountUpdate); } - commitTransaction(transaction); + commitTransaction(topiaContext); } catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + } + + /** + * Permet de créer des comptes tiers + */ + @Override + public void createSubLedger(Account masterAccount, Account account) + throws LimaException { + + //check rules before create the account + accountingRules.createSubLedgerRules(masterAccount, account); + + TopiaContext transaction = null; + try { + transaction = beginTransaction(); + + createSubLedgerWithTransaction(masterAccount, account, transaction); + } + catch (TopiaException ex) { doCatch(transaction, ex, log); } finally { @@ -477,5 +504,6 @@ throw eee; } } + } \ No newline at end of file Added: 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 (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,332 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejb; + +import static org.nuiton.i18n.I18n._; + +import java.awt.Color; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.ejb.Stateless; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.beans.FinancialStatementAmounts; +import org.chorem.lima.business.ejbinterface.DocumentService; +import org.chorem.lima.business.ejbinterface.DocumentServiceLocal; + +import com.lowagie.text.BadElementException; +import com.lowagie.text.Cell; +import com.lowagie.text.Chapter; +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; +import com.lowagie.text.Element; +import com.lowagie.text.Font; +import com.lowagie.text.PageSize; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Phrase; +import com.lowagie.text.Rectangle; +import com.lowagie.text.Table; +import com.lowagie.text.html.HtmlWriter; +import com.lowagie.text.pdf.PdfWriter; + +@Stateless +public class DocumentServiceImpl implements DocumentService, DocumentServiceLocal { + + private static final Log log = + LogFactory.getLog(DocumentServiceImpl.class); + + @Override + public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts) { + Document document = new Document(PageSize.A4, 5, 5, 5, 5); + + try { + + PdfWriter pdfWriter = PdfWriter.getInstance(document, + new FileOutputStream("/test_lima.pdf")); + HtmlWriter htmlWriter = HtmlWriter.getInstance(document, + new FileOutputStream("/test_lima.html")); + Font numpageFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK); + document.open(); + int nbpages = 1; + + + //Split list by financialstatement type + List<List<FinancialStatementAmounts>> listList = new ArrayList<List<FinancialStatementAmounts>>(); + Boolean first = true; + int min=0; + int size = financialStatementAmounts.size(); + for (int i=0;i<size;i++) { + if (financialStatementAmounts.get(i).getLevel()==1){ + if (first){ + first=false; + } + else{ + listList.add(financialStatementAmounts.subList(min+1, i-1)); + } + min=i; + } + } + listList.add(financialStatementAmounts.subList(min+1, size)); + + //create pages + for (List<FinancialStatementAmounts> list : listList) { + String title = list.get(0).getLabel(); + int i=0; + int n=list.size(); + while (i<n){ + int j=i+40; + if (j>n){ + j = n; + } + List <FinancialStatementAmounts> subFinancialStatementAmounts = + list.subList(i, j); + //create page : header + table + footer + Table header = createHeader(title, "01/01/2010", "31/12/2010"); + Table table = createTable(subFinancialStatementAmounts); + //new page + Chapter chapter = new Chapter(0); + //n° page + Paragraph paragraphPage = new Paragraph(); + paragraphPage.setAlignment(Element.ALIGN_RIGHT); + paragraphPage.add(new Phrase("Page n° "+nbpages, numpageFont)); + chapter.add(paragraphPage); + //header + Paragraph paragraphHeader = new Paragraph(); + paragraphHeader.add(header); + chapter.add(paragraphHeader); + //table + Paragraph paragraphTable = new Paragraph(); + paragraphTable.add(table); + chapter.add(paragraphTable); + //add page + document.add(chapter); + i=i+40; + nbpages++; + } + } + + document.close(); + + } catch (FileNotFoundException eeFNFE) { + log.error("Can't create pdf file", eeFNFE); + } catch (DocumentException eeDE) { + log.error("Can't create document", eeDE); + } + } + + public Table createHeader(String title, String beginDate, String endDate){ + Table t = null; + try { + //define table + t = new Table(4, 5); + float[] widths = {0.25f, 0.45f, 0.12f, 0.18f}; + t.setWidths(widths); + t.setPadding(3); + //define font + Font headerFont = new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK); + Font headerFontB = new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK); + //defaut cell + Cell cell = new Cell(); + cell.setBorder(Rectangle.NO_BORDER); + t.setDefaultCell(cell); + + //line 1 + t.addCell(new Phrase("Code Lutin SA", headerFontB)); + Cell titleCell = new Cell(new Phrase(title, new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK))); + titleCell.setVerticalAlignment(Element.ALIGN_MIDDLE); + titleCell.setHorizontalAlignment(Element.ALIGN_CENTER); + titleCell.setRowspan(2); + t.addCell(titleCell); + t.addCell(new Phrase("N° Siret", headerFontB)); + t.addCell(new Phrase("442116703", headerFont)); + //line 2 + t.addCell(new Phrase("SSL", headerFont)); + t.addCell(new Phrase("NAF :", headerFontB)); + t.addCell(new Phrase("6201Z", headerFont)); + //line 3 + t.addCell(new Phrase("44 bd des Pas Enchantés", headerFont)); + t.addCell(""); + t.addCell(new Phrase("n°TVA", headerFontB)); + t.addCell(new Phrase("FR 57 442116703", headerFont)); + //line 4 + t.addCell(new Phrase("44230 St Séb/Loire", headerFont)); + t.addCell(""); + t.addCell(new Phrase("Période du", headerFontB)); + t.addCell(new Phrase(beginDate, headerFont)); + //line 5 + t.addCell(""); + t.addCell(""); + t.addCell(new Phrase("au", headerFontB)); + t.addCell(new Phrase(endDate, headerFont)); + } catch (BadElementException eeBEE) { + log.error("Can't create table", eeBEE); + } + return t; + } + + public Table createTable(List<FinancialStatementAmounts> financialStatementAmounts){ + int nbrow = financialStatementAmounts.size(); + Table t = null; + try { + //define table + t = new Table(4,nbrow); + float[] widths = {0.4f, 0.2f, 0.2f, 0.2f}; + t.setWidths(widths); + t.setPadding(0.5f); + t.setSpacing(0); + t.setBorderWidth(1); + t.setBorder(Rectangle.BOTTOM); + //define default cell + Cell cell = new Cell(); + cell.setBorder(Rectangle.LEFT); + t.setDefaultCell(cell); + + Font headerFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK); + Font tabFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK); + + Cell headerCell = new Cell(new Phrase(_("lima.table.label"), headerFont)); + headerCell.setBorderWidth(1); + headerCell.setHeader(true); + t.addCell(headerCell); + headerCell = new Cell(new Phrase(_("lima.table.grossamount"), headerFont)); + t.addCell(headerCell); + headerCell = new Cell(new Phrase(_("lima.table.provisiondeprecationamount"), headerFont)); + t.addCell(headerCell); + headerCell = new Cell(new Phrase(_("lima.table.netamount"), headerFont)); + t.addCell(headerCell); + + for (FinancialStatementAmounts financialStatementAmount : financialStatementAmounts) { + + String label = financialStatementAmount.getLabel(); + int level = financialStatementAmount.getLevel(); + Double grossAmount = financialStatementAmount.getGrossAmount(); + Double provisionDeprecationAmount = financialStatementAmount.getProvisionDeprecationAmount(); + + if (financialStatementAmount.getSubAmount()){ + cell.setGrayFill(0.9f); + } + else { + cell.setGrayFill(1f); + } + + if (label == null){ + t.addCell(""); + t.addCell(""); + t.addCell(""); + t.addCell(""); + } + else { + //cell1 + String tab = ""; + for (int i = 0; i < level; i++) { + tab += "\t"; + } + Phrase phrase = null; + if (financialStatementAmount.getHeader()){ + phrase = new Phrase(tab+label, headerFont); + } + else { + phrase = new Phrase(tab+label, tabFont); + } + t.addCell(phrase); + //cell2 + if (grossAmount != 0.0){ + phrase = new Phrase(String.valueOf(grossAmount), tabFont); + } + else { + phrase = new Phrase(""); + } + t.addCell(phrase); + //cell 3 + if (provisionDeprecationAmount != 0.0){ + phrase = new Phrase(String.valueOf(provisionDeprecationAmount), tabFont); + } + else { + phrase = new Phrase(""); + } + t.addCell(phrase); + //cell 4 + if (grossAmount-provisionDeprecationAmount != 0.0){ + phrase = new Phrase(String.valueOf(grossAmount-provisionDeprecationAmount), tabFont); + } + else { + phrase = new Phrase(""); + } + t.addCell(phrase); + } + } + + } catch (BadElementException eeBEE) { + log.error("Can't create table", eeBEE); + } + return t; + } + + public void example (){ + //FIRST PAGE + /*document.add(new Paragraph("First page of the document.")); + document.add(new Paragraph("Some more text on the \n" + + "first page with different color and font type.", + FontFactory.getFont(FontFactory.COURIER, 14, Font.BOLD, + new Color(255, 150, 200)))); + + //SECOND PAGE + Paragraph title1 = new Paragraph("Chapter 1", + FontFactory.getFont(FontFactory.HELVETICA, 18, + Font.BOLDITALIC, new Color(0, 0, 255))); + Chapter chapter1 = new Chapter(title1, 1); + chapter1.setNumberDepth(0); + //SECTION 1 + Paragraph title11 = new Paragraph("This is Section 1 in Chapter 1", + FontFactory.getFont(FontFactory.HELVETICA, 16, + Font.BOLD, new Color(255, 0, 0))); + Section section1 = chapter1.addSection(title11); + Paragraph someSectionText = new Paragraph("This text comes as part of section 1 of chapter 1."); + section1.add(someSectionText); + someSectionText = new Paragraph("Following is a 3 X 2 table."); + section1.add(someSectionText); + //TABLE + Table t = new Table(3,2); + t.setBorderColor(new Color(220, 255, 100)); + t.setPadding(5); + t.setSpacing(5); + t.setBorderWidth(1); + Cell c1 = new Cell("header1"); + c1.setHeader(true); + t.addCell(c1); + c1 = new Cell("Header2"); + t.addCell(c1); + c1 = new Cell("Header3"); + t.addCell(c1); + t.endHeaders(); + t.addCell("1.1"); + t.addCell("1.2"); + t.addCell("1.3"); + + section1.add(t); + + document.add(chapter1);*/ + } + +} 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -26,11 +26,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.EntryBookService; -import org.chorem.lima.business.EntryBookServiceLocal; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.EntryBookService; +import org.chorem.lima.business.ejbinterface.EntryBookServiceLocal; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; @@ -71,21 +71,16 @@ accountingRules = config.getAccountingRules(); } - /** - * Création d'un EntryBook. Il peut être unique sur son label (au choix). - * - * @param EntryBook EntryBook - * @throws LimaException - */ - public void createEntryBook(EntryBook entryBook) throws LimaException { - - TopiaContext transaction = null; - try { - transaction = beginTransaction(); + + @Override + public void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) + throws LimaException { + try { + // check if entrybook with is name already exist EntryBookDAO entryBookDAO = - LimaCallaoDAOHelper.getEntryBookDAO(transaction); + LimaCallaoDAOHelper.getEntryBookDAO(topiaContext); EntryBook existingEntryBook = entryBookDAO.findByLabel(entryBook.getCode()); if (existingEntryBook != null) { @@ -99,9 +94,9 @@ //create ClosedPeriodicEntryBook for all unblocked financial period ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction); + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); FinancialPeriodDAO financialPeriodDAO = - LimaCallaoDAOHelper.getFinancialPeriodDAO(transaction); + LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext); // for all unblocked financialperiod for (FinancialPeriod financialPeriod : financialPeriodDAO.findAllByLocked(false)) { @@ -116,9 +111,29 @@ closedPeriodicEntryBookDAO.create(closedPeriodicEntryBook); } - commitTransaction(transaction); + commitTransaction(topiaContext); } catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + + } + + /** + * Création d'un EntryBook. Il peut être unique sur son label (au choix). + * + * @param EntryBook EntryBook + * @throws LimaException + */ + public void createEntryBook(EntryBook entryBook) throws LimaException { + + TopiaContext transaction = null; + try { + transaction = beginTransaction(); + + createEntryBookWithTransaction(entryBook, transaction); + } + catch (TopiaException ex) { doCatch(transaction, ex, log); } finally { 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -27,10 +27,10 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.ExportService; -import org.chorem.lima.business.ExportServiceLocal; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.ExportService; +import org.chorem.lima.business.ejbinterface.ExportServiceLocal; import org.chorem.lima.business.utils.ImportExportEntityEnum; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountDAO; 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -24,10 +24,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.FinancialPeriodService; -import org.chorem.lima.business.FinancialPeriodServiceLocal; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.FinancialPeriodService; +import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; @@ -166,13 +166,12 @@ return result; } - @Override - public void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException { - - TopiaContext topiaContext = null; - try { - topiaContext = beginTransaction(); - + + @Override + public void blockClosedPeriodicEntryBookWithTransaction( + ClosedPeriodicEntryBook closedPeriodicEntryBook, + TopiaContext topiaContext) throws LimaException { + try { //check rules before create the account accountingRules.blockClosedPeriodicEntryBookRules( closedPeriodicEntryBook, topiaContext); @@ -191,7 +190,23 @@ } catch (TopiaException ex) { doCatch(topiaContext, ex, log); + } + } + + @Override + public void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException { + + TopiaContext topiaContext = null; + try { + topiaContext = beginTransaction(); + + blockClosedPeriodicEntryBookWithTransaction(closedPeriodicEntryBook, topiaContext); + + commitTransaction(topiaContext); } + catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } finally { doFinally(topiaContext, log); } 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -34,14 +34,14 @@ import org.chorem.lima.beans.FinancialStatementDatas; import org.chorem.lima.beans.FinancialStatementDatasImpl; import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.business.AccountServiceLocal; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.FinancialStatementService; -import org.chorem.lima.business.FinancialStatementServiceLocal; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ReportServiceLocal; +import org.chorem.lima.business.ejbinterface.AccountServiceLocal; +import org.chorem.lima.business.ejbinterface.FinancialStatementService; +import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal; +import org.chorem.lima.business.ejbinterface.ReportServiceLocal; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialStatementDAO; @@ -80,17 +80,17 @@ accountingRules = config.getAccountingRules(); } - @Override - public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException { - - TopiaContext transaction = null; - try { - transaction = beginTransaction(); + public void createFinancialStatementWithTransaction( + FinancialStatement masterFinancialStatement, + FinancialStatement financialStatement, TopiaContext topiaContext) + throws LimaException, LimaBusinessException { + try { + // check if FinancialStatementHeader label already exist FinancialStatementDAO financialStatementDAO = - LimaCallaoDAOHelper.getFinancialStatementDAO(transaction); + LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext); FinancialStatement existFinancialStatementHeader = financialStatementDAO.findByLabel(financialStatement.getLabel()); @@ -114,8 +114,23 @@ financialStatementDAO.update(masterfinancialStatementUpdate); } - commitTransaction(transaction); + commitTransaction(topiaContext); } + catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + + } + + @Override + public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException { + + TopiaContext transaction = null; + try { + transaction = beginTransaction(); + + createFinancialStatementWithTransaction(masterFinancialStatement, financialStatement, transaction); + } catch (Exception ex) { doCatch(transaction, ex, log); } 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -26,10 +26,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.FinancialTransactionService; -import org.chorem.lima.business.FinancialTransactionServiceLocal; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.FinancialTransactionService; +import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryDAO; @@ -76,6 +76,27 @@ accountingRules = config.getAccountingRules(); } + @Override + public void createFinancialTransactionWithTransaction( + FinancialTransaction financialtransaction, TopiaContext topiaContext) + throws LimaException { + try { + //check if the financial period is blocked + accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction( + financialtransaction, topiaContext); + + FinancialTransactionDAO financialtransactionDAO = + LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); + + financialtransactionDAO.create(financialtransaction); + + commitTransaction(topiaContext); + } + catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + } + /** * Permet de créer une transaction comptable contenant des entrées * @@ -87,16 +108,7 @@ try { topiaContext = beginTransaction(); - //check if the financial period is blocked - accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction( - financialtransaction, topiaContext); - - FinancialTransactionDAO financialtransactionDAO = - LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); - - financialtransactionDAO.create(financialtransaction); - - commitTransaction(topiaContext); + createFinancialTransactionWithTransaction(financialtransaction, topiaContext); } catch (TopiaException ex) { doCatch(topiaContext, ex, log); @@ -271,6 +283,7 @@ /** * Method used by update entry and remove entry for update amounts */ + @Override public void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException{ try { FinancialTransactionDAO transactionDAO = @@ -345,6 +358,27 @@ } + @Override + public void createEntryWithTransaction(Entry entry, + TopiaContext topiaContext) throws LimaException { + + try { + + //check if the financial period is blocked + accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction( + entry.getFinancialTransaction(), topiaContext); + + + EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext); + entryDAO.create(entry); + + commitTransaction(topiaContext); + } + catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + } + /** * Create new entry * the period mus not be blocked, call accounting rules @@ -359,15 +393,7 @@ try { topiaContext = beginTransaction(); - //check if the financial period is blocked - accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction( - entry.getFinancialTransaction(), topiaContext); - - - EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext); - entryDAO.create(entry); - - commitTransaction(topiaContext); + createEntryWithTransaction(entry, topiaContext); } catch (TopiaException ex) { doCatch(topiaContext, ex, log); @@ -512,4 +538,5 @@ throw eee; } } + } \ No newline at end of file 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -26,12 +26,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.FinancialPeriodServiceLocal; -import org.chorem.lima.business.FiscalPeriodService; -import org.chorem.lima.business.FiscalPeriodServiceLocal; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal; +import org.chorem.lima.business.ejbinterface.FiscalPeriodService; +import org.chorem.lima.business.ejbinterface.FiscalPeriodServiceLocal; import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialPeriodDAO; import org.chorem.lima.entity.FiscalPeriod; @@ -74,32 +74,44 @@ accountingRules = config.getAccountingRules(); } - /** - * To create a fiscalperiod - * Check localized rules before create - */ - @Override - public void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException { - - TopiaContext transaction = null; + + @Override + public void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException { try { - transaction = beginTransaction(); //check rules before create the account List<FinancialPeriod> financialPeriods = - accountingRules.createFiscalPeriodRules(fiscalPeriod, transaction); + accountingRules.createFiscalPeriodRules(fiscalPeriod, topiaContext); financialPeriodService. - createFinancialPeriodsWithTransaction(financialPeriods, transaction); + createFinancialPeriodsWithTransaction(financialPeriods, topiaContext); FiscalPeriodDAO fiscalPeriodDAO = - LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction); + LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext); //create fiscalPeriodDAO.create(fiscalPeriod); - commitTransaction(transaction); + commitTransaction(topiaContext); } catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } + } + + /** + * To create a fiscalperiod + * Check localized rules before create + */ + @Override + public void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException { + + TopiaContext transaction = null; + try { + transaction = beginTransaction(); + + createFiscalPeriodWithTransaction(fiscalPeriod, transaction); + } + catch (TopiaException ex) { doCatch(transaction, ex, log); } finally { 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -50,17 +50,17 @@ import org.chorem.lima.beans.FinancialStatementImportImpl; import org.chorem.lima.beans.FinancialTransactionImport; import org.chorem.lima.beans.FinancialTransactionImportImpl; -import org.chorem.lima.business.AccountServiceLocal; -import org.chorem.lima.business.EntryBookServiceLocal; -import org.chorem.lima.business.FinancialPeriodServiceLocal; -import org.chorem.lima.business.FinancialStatementServiceLocal; -import org.chorem.lima.business.FinancialTransactionServiceLocal; -import org.chorem.lima.business.FiscalPeriodServiceLocal; -import org.chorem.lima.business.ImportService; -import org.chorem.lima.business.ImportServiceLocal; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.AccountServiceLocal; +import org.chorem.lima.business.ejbinterface.EntryBookServiceLocal; +import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal; +import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal; +import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal; +import org.chorem.lima.business.ejbinterface.FiscalPeriodServiceLocal; +import org.chorem.lima.business.ejbinterface.ImportService; +import org.chorem.lima.business.ejbinterface.ImportServiceLocal; import org.chorem.lima.business.utils.AccountEBPComparator; import org.chorem.lima.business.utils.FiscalPeriodComparator; import org.chorem.lima.business.utils.ImportExportEntityEnum; @@ -235,7 +235,7 @@ //update previous financial transaction before create new if (financialTransaction != null){ financialTransaction.setAmounts(); - financialTransactionService.updateFinancialTransaction(financialTransaction); + financialTransactionService.updateFinancialTransactionWithTransaction(financialTransaction, topiaContext); } //create financial transaction financialTransaction = new FinancialTransactionImpl(); @@ -243,19 +243,19 @@ financialTransaction.setTransactionDate(date); FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(date); financialTransaction.setFinancialPeriod(financialPeriod); - financialTransactionService.createFinancialTransaction(financialTransaction); + financialTransactionService.createFinancialTransactionWithTransaction(financialTransaction, topiaContext); result += "SUCCES : FinancialTransaction" + date + " " + entryBook.getCode() + " added\n"; } financialTransaction.addEntry(entry); - financialTransactionService.createEntry(entry); + financialTransactionService.createEntryWithTransaction(entry, topiaContext); result += "SUCCES : Entry" + entry.getDescription() + " " + entry.getAmount() + " added\n"; } } //update last financial transaction if (financialTransaction != null){ financialTransaction.setAmounts(); - financialTransactionService.updateFinancialTransaction(financialTransaction); + financialTransactionService.updateFinancialTransactionWithTransaction(financialTransaction, topiaContext); } //commit commitTransaction(topiaContext); @@ -319,7 +319,7 @@ // if account is class account : 1, 2, 3, 4, 5, 6, 7,… int nbCharAccountNumber = accountNumber.length(); if (nbCharAccountNumber == 1){ - accountService.createAccount(null, account); + accountService.createAccountWithTransaction(null, account, topiaContext); result += "SUCCES : Account" + accountNumber + " " + label + " added\n"; } else { @@ -330,7 +330,7 @@ masterAccount = accountDAO.findByAccountNumber(masterAccountNumber); i++; } - accountService.createAccount(masterAccount, account); + accountService.createAccountWithTransaction(masterAccount, account, topiaContext); result += "SUCCES : Account" + accountNumber + " " + label + " added\n"; } } @@ -849,8 +849,8 @@ financialStatement.setHeaderAmount(Boolean.parseBoolean( financialStatementImport.getHeaderAmount())); - financialStatementService.createFinancialStatement( - masterFinancialStatement, financialStatement); + financialStatementService.createFinancialStatementWithTransaction( + masterFinancialStatement, financialStatement, topiaContext); result += "SUCCESS : The financialStatement " + financialStatementImport.getLabel() + " is created ! \n"; @@ -877,7 +877,7 @@ for (FiscalPeriod fiscalPeriod : fiscalPeriods) { //create fiscalPeriod try { - fiscalPeriodService.createFiscalPeriod(fiscalPeriod); + fiscalPeriodService.createFiscalPeriodWithTransaction(fiscalPeriod, topiaContext); result += "SUCCESS : The fiscalPeriod " + fiscalPeriod.getBeginDate()+"-"+fiscalPeriod.getEndDate() + " is created ! \n"; } @@ -913,10 +913,10 @@ account.setThirdParty(accountImport.getThirdParty()); if (generalLedger != null){ - accountService.createSubLedger(generalLedger, account); + accountService.createSubLedgerWithTransaction(generalLedger, account, topiaContext); } else { - accountService.createAccount(masterAccount, account); + accountService.createAccountWithTransaction(masterAccount, account, topiaContext); } result += "SUCCESS : The account " + accountImport.getAccountNumber() + " is created ! \n"; @@ -961,7 +961,7 @@ ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(entryBook, financialPeriod); try { - financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook); + financialPeriodService.blockClosedPeriodicEntryBookWithTransaction(closedPeriodicEntryBook, topiaContext); result += "SUCCESS : The blockClosedPeriodicEntryBook " + beginDateFinancialPeriod + "-" + endDateFinancialPeriod + ", " + codeEntryBook + " is updated ! \n"; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -28,8 +28,8 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.RecordService; -import org.chorem.lima.business.RecordServiceLocal; +import org.chorem.lima.business.ejbinterface.RecordService; +import org.chorem.lima.business.ejbinterface.RecordServiceLocal; import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.chorem.lima.entity.Record; import org.chorem.lima.entity.RecordDAO; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -31,11 +31,11 @@ import org.chorem.lima.beans.BalanceTrialImpl; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.beans.ReportsDatasImpl; -import org.chorem.lima.business.AccountServiceLocal; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ReportService; -import org.chorem.lima.business.ReportServiceLocal; +import org.chorem.lima.business.ejbinterface.AccountServiceLocal; +import org.chorem.lima.business.ejbinterface.ReportService; +import org.chorem.lima.business.ejbinterface.ReportServiceLocal; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountDAO; import org.chorem.lima.entity.Entry; Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,67 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Remote; +import org.chorem.lima.business.LimaBusinessException; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.Account; + +/** + * Account service. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ + +@Remote +public interface AccountService { + + List<Account> getAllAccounts() throws LimaException; + + List<Account> getAllSubAccounts() throws LimaException; + + /** + * Create new account. If {@code masterAccount} is not null, {@code account} + * is added in {@code masterAccount}'s subAccounts. + * + * @param masterAccount master account (can be null) + * @param account account + * @throws LimaException + */ + //EJB Remote + void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException; + + void createSubLedger(Account masterAccount, Account account) throws LimaException; + + void updateAccount(Account account) throws LimaException; + + void removeAccount(Account account) throws LimaException; + void removeAllAccount() throws LimaException; + + List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException; + + //EJB Remote et local + List<Account> getChildrenAccounts(Account masterAccount) throws LimaException; +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,47 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Local; + +import org.chorem.lima.business.LimaBusinessException; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.Account; +import org.nuiton.topia.TopiaContext; + +/** + * Account service. + * + * @author chatellier + * @version $Revision: 2917 $ + * + * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $ + * By : $Author: jpepin $ + */ + +@Local +public interface AccountServiceLocal extends AccountService{ + + public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, TopiaContext topiaContext) throws LimaException; + void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, LimaBusinessException; + void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException; + +} \ No newline at end of file Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,39 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; + +import javax.ejb.Remote; + +import org.chorem.lima.beans.FinancialStatementAmounts; + +/** + * Interface to create pdf and html docs + * @author john + * + */ + +@Remote +public interface DocumentService { + + public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts); + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,34 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Local; + +/** + * Interface to create pdf and html docs + * @author john + * + */ + +@Local +public interface DocumentServiceLocal { + + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,47 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Remote; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.EntryBook; + +/** + * Entry book service. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ + +@Remote +public interface EntryBookService { + + List<EntryBook> getAllEntryBooks() throws LimaException; + + void createEntryBook(EntryBook entryBook) throws LimaException; + + void updateEntryBook(EntryBook entryBook) throws LimaException; + + void removeEntryBook(EntryBook entryBook) throws LimaException; +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,44 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Local; + +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.EntryBook; +import org.nuiton.topia.TopiaContext; + + +/** + * Entry book service. + * + * @author chatellier + * @version $Revision: 2889 $ + * + * Last update : $Date: 2010-05-10 15:13:56 +0200 (lun. 10 mai 2010) $ + * By : $Author: jpepin $ + */ + +@Local +public interface EntryBookServiceLocal extends EntryBookService { + + public void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException; + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,74 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Remote; +import org.chorem.lima.business.LimaException; + +/** + * Import export service. + * + * Currently import and export as XML. + * + * @author chatellier + * @version $Revision: 2962 $ + * + * Last update : $Date: 2010-07-05 16:59:28 +0200 (lun., 05 juil. 2010) $ + * By : $Author: jpepin $ + */ +@Remote +public interface ExportService { + + + /** + * Get database export as CSV; + * + * @return export as byte array + * @throws LimaException + */ + public String exportAsCSV() throws LimaException; + + /** + * export entrybook chart as CSV. + */ + public String exportEntryBookChartAsCSV() throws LimaException; + + /** + * export financialstatement chart as CSV. + */ + public String exportFinancialStatementChartAsCSV() throws LimaException; + + /** + * export accounts chart as CSV. + */ + public String exportAccountsChartAsCSV() throws LimaException; + + /** + * export entries as EBP + */ + public String exportEntriesAsEBP() throws LimaException; + + /** + * export accounts as EBP + */ + public String exportAccountsAsEBP() throws LimaException; + + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,38 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Local; + +/** + * Import export service. + * + * Currently import and export as XML. + * + * @author chatellier + * @version $Revision: 2824 $ + * + * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $ + * By : $Author: echatellier $ + */ +@Local +public interface ExportServiceLocal extends ExportService { + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,54 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Remote; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FinancialPeriod; + +/** + * Financial period service. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ + +@Remote +public interface FinancialPeriodService { + + List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException; + + + void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException; + + /** Methodes for closedperiodicentrybook */ + + ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook, FinancialPeriod financialPeriod) throws LimaException; + + List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException; + + void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException; +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,47 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Local; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; +import org.chorem.lima.entity.FinancialPeriod; +import org.nuiton.topia.TopiaContext; + + +/** + * Financial period service. + * + * @author chatellier + * @version $Revision: 2913 $ + * + * Last update : $Date: 2010-05-27 16:36:34 +0200 (jeu. 27 mai 2010) $ + * By : $Author: jpepin $ + */ + +@Local +public interface FinancialPeriodServiceLocal extends FinancialPeriodService { + + void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods, TopiaContext topiaContext) throws LimaException; + public void blockClosedPeriodicEntryBookWithTransaction(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException; + + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,44 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.Date; +import java.util.List; +import javax.ejb.Remote; +import org.chorem.lima.beans.FinancialStatementAmounts; +import org.chorem.lima.business.LimaBusinessException; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.FinancialStatement; + +@Remote +public interface FinancialStatementService { + + + public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException; + public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException; + public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException; + + public List<FinancialStatement> getAllFinancialStatements() throws LimaException; + public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException; + public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException; + + public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException; + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,36 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Local; + +import org.chorem.lima.business.LimaBusinessException; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.FinancialStatement; +import org.nuiton.topia.TopiaContext; + +@Local +public interface FinancialStatementServiceLocal extends FinancialStatementService { + + public void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement, + FinancialStatement financialStatement, TopiaContext topiaContext) throws LimaException, LimaBusinessException; + + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,80 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Remote; +import org.chorem.lima.business.LimaBusinessException; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FinancialPeriod; +import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.entity.FiscalPeriod; + +/** + * Transaction service. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ + +@Remote +public interface FinancialTransactionService { + + + /** + * Find all transaction for an entry book and a financial period. + * + * @param entryBook entry book + * @param period financial period + * @return all transaction for entry book and period + * @throws LimaException + */ + List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod( + FinancialPeriod period) throws LimaException; + + List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod( + EntryBook entryBook, FinancialPeriod period) throws LimaException; + + List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException; + + void createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException; + + void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException, LimaBusinessException; + + void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException; + + /** + * Methodes for create, update and remove the entry + * @param entry + * @throws LimaException + */ + + void createEntry(Entry entry) throws LimaException; + + void updateEntry(Entry entry) throws LimaException; + + void removeEntry(Entry entry) throws LimaException; + +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,52 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Local; + +import org.chorem.lima.business.LimaBusinessException; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.FinancialTransaction; +import org.nuiton.topia.TopiaContext; + +/** + * Transaction service. + * + * @author chatellier + * @version $Revision: 2917 $ + * + * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $ + * By : $Author: jpepin $ + */ + +@Local +public interface FinancialTransactionServiceLocal extends FinancialTransactionService { + + public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException; + + void createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException; + + void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException, LimaBusinessException; + + void createEntryWithTransaction(Entry entry, TopiaContext topiaContext) throws LimaException; + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,50 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.List; +import javax.ejb.Remote; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.FiscalPeriod; + +/** + * Fiscal period service. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +@Remote +public interface FiscalPeriodService { + + List<FiscalPeriod> getAllFiscalPeriods() throws LimaException; + + List<FiscalPeriod> getAllUnblockedFiscalPeriods() throws LimaException; + + FiscalPeriod getLastFiscalPeriod() throws LimaException; + + void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; + + void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; + + void removeAllFiscalPeriods() throws LimaException; +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,42 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Local; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.FiscalPeriod; +import org.nuiton.topia.TopiaContext; + +/** + * Fiscal period service. + * + * @author chatellier + * @version $Revision: 2910 $ + * + * Last update : $Date: 2010-05-26 20:37:42 +0200 (mer. 26 mai 2010) $ + * By : $Author: jpepin $ + */ +@Local +public interface FiscalPeriodServiceLocal extends FiscalPeriodService { + + void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException; + + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,76 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Remote; +import org.chorem.lima.business.LimaException; + +/** + * Import export service. + * + * Currently import and export as XML. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +@Remote +public interface ImportService { + + /** + * Import data as EBP CSV export. + * + * @param data + * @throws LimaException + */ + public String importEntriesFromEbp(String datas) throws LimaException; + public String importAccountsChartFromEbp(String datas) throws LimaException; + + + /** + * Import data as Sage Maestria export. + * + * @param data + * @throws LimaException + */ + public void importAsSage(byte[] data) throws LimaException; + + /** + * Import data as Ciel Compta export. + * + * @param data + * @throws LimaException + */ + public void importAsCiel(byte[] data) throws LimaException; + + /** + * import CSV. + * Return result log + */ + public String importAllAsCSV(String path) throws LimaException; + + public String importAccountsChartAsCSV(String path) throws LimaException; + + public String importFinancialStatementsChartAsCSV(String path) throws LimaException; + + public String importEntryBooksChartAsCSV(String path) throws LimaException; +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,38 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Local; + +/** + * Import export service. + * + * Currently import and export as XML. + * + * @author chatellier + * @version $Revision: 2824 $ + * + * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $ + * By : $Author: echatellier $ + */ +@Local +public interface ImportServiceLocal extends ImportService { + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,44 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Remote; + +/** + * Fiscal period service. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ + +@Remote +public interface RecordService { + + //List<FiscalPeriod> getAllFiscalPeriods() throws LimaException; + + //void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; + + //void updateFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; + + //void removeFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException; +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,37 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import javax.ejb.Local; + +/** + * Fiscal period service. + * + * @author chatellier + * @version $Revision: 2902 $ + * + * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $ + * By : $Author: jpepin $ + */ + +@Local +public interface RecordServiceLocal extends RecordService { + +} Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,84 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.Date; +import javax.ejb.Remote; +import org.chorem.lima.beans.BalanceTrial; +import org.chorem.lima.beans.ReportsDatas; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.Account; +import org.chorem.lima.entity.EntryBook; + +/** + * Service de generation des rapports. + * + * Actuellement: + * <ul> + * <li>Balance</li> + * <li>Bilan</li> + * </ul> + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ + +@Remote +public interface ReportService { + + /** + * Generation du bilan. + * + * @param fiscalPeriod exercice + * @return le bilan + * @throws LimaException + * BalanceSheet generateBalanceSheet(FiscalPeriod fiscalPeriod) throws LimaException; + */ + + /** + * Generation de la balance. + * + * @return la balance + * @throws LimaException + */ + BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries) throws LimaException; + + /** + * Generation du grand-livre + * + * @throws LimaException + */ + BalanceTrial generateLedger(Date beginDate, Date endDate) throws LimaException; + + + /** + * Generation du rapports des comptes + */ + ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException; + + /** + * Generation du rapports des journaux + */ + ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException; + +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -0,0 +1,51 @@ +/* *##% Lima Business + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + +package org.chorem.lima.business.ejbinterface; + +import java.util.Date; +import javax.ejb.Local; +import org.chorem.lima.beans.ReportsDatas; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.Account; +import org.nuiton.topia.TopiaContext; + + +/** + * Service de generation des rapports. + * + * Actuellement: + * <ul> + * <li>Balance</li> + * <li>Bilan</li> + * </ul> + * + * @author chatellier + * @version $Revision: 2902 $ + * + * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $ + * By : $Author: jpepin $ + */ + +@Local +public interface ReportServiceLocal extends ReportService { + + public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException; + +} Modified: trunk/lima-swing/pom.xml =================================================================== --- trunk/lima-swing/pom.xml 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/pom.xml 2010-07-22 10:36:21 UTC (rev 2983) @@ -48,11 +48,6 @@ <groupId>net.sf.opencsv</groupId> <artifactId>opencsv</artifactId> </dependency> - - <dependency> - <groupId>com.lowagie</groupId> - <artifactId>itext</artifactId> - </dependency> <dependency> <groupId>org.swinglabs</groupId> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -30,8 +30,8 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.AccountService; import org.chorem.lima.business.AccountServiceMonitorable; +import org.chorem.lima.business.ejbinterface.AccountService; import org.chorem.lima.entity.Account; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.ui.MainView; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -22,9 +22,9 @@ import javax.swing.JOptionPane; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.EntryBookService; import org.chorem.lima.business.EntryBookServiceMonitorable; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.EntryBookService; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; import org.chorem.lima.service.LimaServiceFactory; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -24,9 +24,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.FinancialPeriodService; import org.chorem.lima.business.FinancialPeriodServiceMonitorable; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ejbinterface.FinancialPeriodService; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; import org.chorem.lima.service.LimaServiceFactory; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -48,276 +48,6 @@ private static final Log log = LogFactory.getLog(FinancialStatementReportTable.class); - public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts) { - Document document = new Document(PageSize.A4, 5, 5, 5, 5); - - try { - - PdfWriter pdfWriter = PdfWriter.getInstance(document, - new FileOutputStream("/test_lima.pdf")); - HtmlWriter htmlWriter = HtmlWriter.getInstance(document, - new FileOutputStream("/test_lima.html")); - Font numpageFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK); - document.open(); - int nbpages = 1; - - - //Split list by financialstatement type - List<List<FinancialStatementAmounts>> listList = new ArrayList<List<FinancialStatementAmounts>>(); - Boolean first = true; - int min=0; - int size = financialStatementAmounts.size(); - for (int i=0;i<size;i++) { - if (financialStatementAmounts.get(i).getLevel()==1){ - if (first){ - first=false; - } - else{ - listList.add(financialStatementAmounts.subList(min+1, i-1)); - } - min=i; - } - } - listList.add(financialStatementAmounts.subList(min+1, size)); - - //create pages - for (List<FinancialStatementAmounts> list : listList) { - String title = list.get(0).getLabel(); - int i=0; - int n=list.size(); - while (i<n){ - int j=i+40; - if (j>n){ - j = n; - } - List <FinancialStatementAmounts> subFinancialStatementAmounts = - list.subList(i, j); - //create page : header + table + footer - Table header = createHeader(title, "01/01/2010", "31/12/2010"); - Table table = createTable(subFinancialStatementAmounts); - //new page - Chapter chapter = new Chapter(0); - //n° page - Paragraph paragraphPage = new Paragraph(); - paragraphPage.setAlignment(Element.ALIGN_RIGHT); - paragraphPage.add(new Phrase("Page n° "+nbpages, numpageFont)); - chapter.add(paragraphPage); - //header - Paragraph paragraphHeader = new Paragraph(); - paragraphHeader.add(header); - chapter.add(paragraphHeader); - //table - Paragraph paragraphTable = new Paragraph(); - paragraphTable.add(table); - chapter.add(paragraphTable); - //add page - document.add(chapter); - i=i+40; - nbpages++; - } - } - - document.close(); - - } catch (FileNotFoundException eeFNFE) { - log.error("Can't create pdf file", eeFNFE); - } catch (DocumentException eeDE) { - log.error("Can't create document", eeDE); - } - } - public Table createHeader(String title, String beginDate, String endDate){ - Table t = null; - try { - //define table - t = new Table(4, 5); - float[] widths = {0.25f, 0.45f, 0.12f, 0.18f}; - t.setWidths(widths); - t.setPadding(3); - //define font - Font headerFont = new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK); - Font headerFontB = new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK); - //defaut cell - Cell cell = new Cell(); - cell.setBorder(Rectangle.NO_BORDER); - t.setDefaultCell(cell); - - //line 1 - t.addCell(new Phrase("Code Lutin SA", headerFontB)); - Cell titleCell = new Cell(new Phrase(title, new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK))); - titleCell.setVerticalAlignment(Element.ALIGN_MIDDLE); - titleCell.setHorizontalAlignment(Element.ALIGN_CENTER); - titleCell.setRowspan(2); - t.addCell(titleCell); - t.addCell(new Phrase("N° Siret", headerFontB)); - t.addCell(new Phrase("442116703", headerFont)); - //line 2 - t.addCell(new Phrase("SSL", headerFont)); - t.addCell(new Phrase("NAF :", headerFontB)); - t.addCell(new Phrase("6201Z", headerFont)); - //line 3 - t.addCell(new Phrase("44 bd des Pas Enchantés", headerFont)); - t.addCell(""); - t.addCell(new Phrase("n°TVA", headerFontB)); - t.addCell(new Phrase("FR 57 442116703", headerFont)); - //line 4 - t.addCell(new Phrase("44230 St Séb/Loire", headerFont)); - t.addCell(""); - t.addCell(new Phrase("Période du", headerFontB)); - t.addCell(new Phrase(beginDate, headerFont)); - //line 5 - t.addCell(""); - t.addCell(""); - t.addCell(new Phrase("au", headerFontB)); - t.addCell(new Phrase(endDate, headerFont)); - } catch (BadElementException eeBEE) { - log.error("Can't create table", eeBEE); - } - return t; - } - public Table createTable(List<FinancialStatementAmounts> financialStatementAmounts){ - int nbrow = financialStatementAmounts.size(); - Table t = null; - try { - //define table - t = new Table(4,nbrow); - float[] widths = {0.4f, 0.2f, 0.2f, 0.2f}; - t.setWidths(widths); - t.setPadding(0.5f); - t.setSpacing(0); - t.setBorderWidth(1); - t.setBorder(Rectangle.BOTTOM); - //define default cell - Cell cell = new Cell(); - cell.setBorder(Rectangle.LEFT); - t.setDefaultCell(cell); - - Font headerFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK); - Font tabFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK); - - Cell headerCell = new Cell(new Phrase(_("lima.table.label"), headerFont)); - headerCell.setBorderWidth(1); - headerCell.setHeader(true); - t.addCell(headerCell); - headerCell = new Cell(new Phrase(_("lima.table.grossamount"), headerFont)); - t.addCell(headerCell); - headerCell = new Cell(new Phrase(_("lima.table.provisiondeprecationamount"), headerFont)); - t.addCell(headerCell); - headerCell = new Cell(new Phrase(_("lima.table.netamount"), headerFont)); - t.addCell(headerCell); - - for (FinancialStatementAmounts financialStatementAmount : financialStatementAmounts) { - - String label = financialStatementAmount.getLabel(); - int level = financialStatementAmount.getLevel(); - Double grossAmount = financialStatementAmount.getGrossAmount(); - Double provisionDeprecationAmount = financialStatementAmount.getProvisionDeprecationAmount(); - - if (financialStatementAmount.getSubAmount()){ - cell.setGrayFill(0.9f); - } - else { - cell.setGrayFill(1f); - } - - if (label == null){ - t.addCell(""); - t.addCell(""); - t.addCell(""); - t.addCell(""); - } - else { - //cell1 - String tab = ""; - for (int i = 0; i < level; i++) { - tab += "\t"; - } - Phrase phrase = null; - if (financialStatementAmount.getHeader()){ - phrase = new Phrase(tab+label, headerFont); - } - else { - phrase = new Phrase(tab+label, tabFont); - } - t.addCell(phrase); - //cell2 - if (grossAmount != 0.0){ - phrase = new Phrase(String.valueOf(grossAmount), tabFont); - } - else { - phrase = new Phrase(""); - } - t.addCell(phrase); - //cell 3 - if (provisionDeprecationAmount != 0.0){ - phrase = new Phrase(String.valueOf(provisionDeprecationAmount), tabFont); - } - else { - phrase = new Phrase(""); - } - t.addCell(phrase); - //cell 4 - if (grossAmount-provisionDeprecationAmount != 0.0){ - phrase = new Phrase(String.valueOf(grossAmount-provisionDeprecationAmount), tabFont); - } - else { - phrase = new Phrase(""); - } - t.addCell(phrase); - } - } - - } catch (BadElementException eeBEE) { - log.error("Can't create table", eeBEE); - } - return t; - } - - public void example (){ - //FIRST PAGE - /*document.add(new Paragraph("First page of the document.")); - document.add(new Paragraph("Some more text on the \n" - + "first page with different color and font type.", - FontFactory.getFont(FontFactory.COURIER, 14, Font.BOLD, - new Color(255, 150, 200)))); - - //SECOND PAGE - Paragraph title1 = new Paragraph("Chapter 1", - FontFactory.getFont(FontFactory.HELVETICA, 18, - Font.BOLDITALIC, new Color(0, 0, 255))); - Chapter chapter1 = new Chapter(title1, 1); - chapter1.setNumberDepth(0); - //SECTION 1 - Paragraph title11 = new Paragraph("This is Section 1 in Chapter 1", - FontFactory.getFont(FontFactory.HELVETICA, 16, - Font.BOLD, new Color(255, 0, 0))); - Section section1 = chapter1.addSection(title11); - Paragraph someSectionText = new Paragraph("This text comes as part of section 1 of chapter 1."); - section1.add(someSectionText); - someSectionText = new Paragraph("Following is a 3 X 2 table."); - section1.add(someSectionText); - //TABLE - Table t = new Table(3,2); - t.setBorderColor(new Color(220, 255, 100)); - t.setPadding(5); - t.setSpacing(5); - t.setBorderWidth(1); - Cell c1 = new Cell("header1"); - c1.setHeader(true); - t.addCell(c1); - c1 = new Cell("Header2"); - t.addCell(c1); - c1 = new Cell("Header3"); - t.addCell(c1); - t.endHeaders(); - t.addCell("1.1"); - t.addCell("1.2"); - t.addCell("1.3"); - - section1.add(t); - - document.add(chapter1);*/ - } - } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -26,11 +26,13 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.beans.FinancialStatementAmounts; +import org.chorem.lima.business.DocumentServiceMonitorable; import org.chorem.lima.business.FinancialStatementServiceMonitorable; import org.chorem.lima.business.FinancialTransactionServiceMonitorable; import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ServiceListener; +import org.chorem.lima.business.ejbinterface.DocumentService; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; @@ -54,6 +56,7 @@ /** Services. */ protected FinancialStatementServiceMonitorable financialStatementService; + protected DocumentServiceMonitorable documentService; /** DatePicker Begin Date. */ protected Date selectedBeginDate; @@ -76,6 +79,7 @@ ImportServiceMonitorable.class).addListener(this); LimaServiceFactory.getInstance().getService( FinancialTransactionServiceMonitorable.class).addListener(this); + documentService = LimaServiceFactory.getInstance().getService(DocumentServiceMonitorable.class); } @Override @@ -206,8 +210,7 @@ } public void createDocuments(){ - FinancialStatementDocument financialStatementDocument = new FinancialStatementDocument(); - financialStatementDocument.createDocuments(cacheDataList); + documentService.createDocuments(cacheDataList); } @Override 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 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-07-22 10:36:21 UTC (rev 2983) @@ -28,7 +28,7 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.FinancialTransactionServiceMonitorable; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.FinancialTransactionService; +import org.chorem.lima.business.ejbinterface.FinancialTransactionService; import org.chorem.lima.business.utils.EntryComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2010-07-22 09:10:03 UTC (rev 2982) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2010-07-22 10:36:21 UTC (rev 2983) @@ -19,14 +19,13 @@ <script> <![CDATA[ import org.chorem.lima.entity.FiscalPeriod; - import org.chorem.lima.business.FiscalPeriodService; import org.chorem.lima.business.FiscalPeriodServiceMonitorable; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.business.LimaException; import org.apache.commons.lang.time.DateUtils; import org.chorem.lima.entity.FiscalPeriodImpl; - protected FiscalPeriodService fiscalPeriodService = + protected FiscalPeriodServiceMonitorable fiscalPeriodService = LimaServiceFactory.getInstance().getService( FiscalPeriodServiceMonitorable.class);