Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
May 2014
- 7 participants
- 58 discussions
r3810 - trunk/lima-callao/src/main/java/org/chorem/lima/entity
by athimel@users.chorem.org 16 May '14
by athimel@users.chorem.org 16 May '14
16 May '14
Author: athimel
Date: 2014-05-16 17:54:31 +0200 (Fri, 16 May 2014)
New Revision: 3810
Url: http://forge.chorem.org/projects/lima/repository/revisions/3810
Log:
Fix Dao naming
Added:
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java
Removed:
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractAccountTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractEntryTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialPeriodTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialTransactionTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFiscalPeriodTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractAccountTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractAccountTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractAccountTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,192 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id: AccountDAOImpl.java 3613 2012-08-20 11:38:22Z mallon $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import com.google.common.collect.Maps;
-import org.apache.commons.lang3.StringUtils;
-import org.nuiton.topia.persistence.TopiaException;
-
-public class AbstractAccountTopiaDao<E extends Account> extends GeneratedAccountTopiaDao<E> {
-
- /**
- * Retourne tous les comptes qui n'ont pas eux meme de sous compte.
- *
- * @return leaf accounts
- * @throws TopiaException
- */
- public List<Account> findAllLeafAccounts() throws TopiaException {
- // FIXME echatellier 20120413 la requete ne fonctionne pas
- // et retourne vide
- /*String query = "FROM " + Account.class.getName() + " a WHERE a NOT IN (" +
- "FROM " + Account.class.getName() + " b where b.accountNumber like concat(a.accountNumber,'%'))";
- List<Account> accounts = find(query);*/
-
- // code temporaire non performant en attandant:
- List<Account> allAccounts = (List<Account>) findAll();
- Iterator<Account> itAccount = allAccounts.iterator();
- while (itAccount.hasNext()) {
- Account acc = itAccount.next();
- Iterator<Account> itAccount2 = allAccounts.iterator();
- while (itAccount2.hasNext()) {
- Account acc2 = itAccount2.next();
- if (!acc2.getAccountNumber().equals(acc.getAccountNumber()) &&
- acc2.getAccountNumber().startsWith(acc.getAccountNumber())) {
- itAccount.remove();
- break;
- }
- }
- }
- return allAccounts;
- }
-
- /**
- * TODO pas compris l'interet de la methode, si on veut un compte feuille
- * par son numero, cela revient a avoir un compte par son numero.
- */
- @Deprecated
- public Account findLeafAccountByNumber(String number) throws TopiaException {
- return forAccountNumberEquals(number).findUniqueOrNull();
- }
-
- /**
- * Find account contained into account number interval.
- *
- * @param accountNumberLow min account number
- * @param accountNumberHigh max account number
- * @return account list
- * @throws TopiaException
- */
- protected List<Account> findIntervalAccountByNumber(String accountNumberLow,
- String accountNumberHigh) throws TopiaException {
- String query = "FROM " + Account.class.getName() + " WHERE :accountNumberLow <= accountNumber AND accountNumber <= :accountNumberHigh";
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("accountNumberLow", accountNumberLow);
- args.put("accountNumberHigh", accountNumberHigh);
- return findAll(query, args);
- }
-
- /**
- * Retourne tous les comptes dont le numero commence par celui specifié.
- *
- * @param account parent account
- * @return
- * @throws TopiaException
- */
- public List<Account> findAllSubAccounts(Account account) throws TopiaException {
-
- String query = "FROM " + Account.class.getName() + " a WHERE a.accountNumber LIKE concat(:accountNumber, '_%')";
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("accountNumber", account.getAccountNumber());
- List<Account> accounts = findAll(query, args);
-
- return accounts;
- }
-
- /**
- * @deprecated since 0.6, business method, need to be moved out of dao
- */
- @Deprecated
- public List<Account> stringToListAccounts(String selectedAccounts,
- Boolean leafAccountsMode) throws TopiaException {
- Set<Account> accounts = new HashSet<Account>();
- if (selectedAccounts != null) {
- //Remove Spaces
- String result = StringUtils.deleteWhitespace(selectedAccounts);
-
- Boolean first = true;
- StringTokenizer stStar = new StringTokenizer(result, "-");
- while (stStar.hasMoreTokens()) {
- String subString = stStar.nextToken();
-
- //Split comma
- StringTokenizer stComma = new StringTokenizer(subString, ",");
- while (stComma.hasMoreTokens()) {
- String s = stComma.nextToken();
- //if intervall account
- if (s.contains("..") && !s.endsWith("..")) {
- //Split ..
- String stringDoubleDot[] = s.split("\\.\\.");
-
- List<Account> resultIntervall =
- findIntervalAccountByNumber(stringDoubleDot[0], stringDoubleDot[1]);
-
- //if first add accounts, else remove
- if (first) {
- accounts.addAll(resultIntervall);
- } else {
- accounts.removeAll(resultIntervall);
- }
- }
- //else one account
- else {
- Account account;
- if (leafAccountsMode) {
- account = findLeafAccountByNumber(s);
- } else {
- account = findByAccountNumber(s);
- }
- //if exist
- if (account != null) {
- //if first
- if (first) {
- accounts.add(account);
- } else {
- accounts.remove(account);
- }
- }
- //search all account start with accountnumber
- else {
- String query = "FROM " + Account.class.getName() + " a WHERE a NOT IN (" +
- "FROM " + Account.class.getName() + " b where b.accountNumber like a.accountNumber+'%')" +
- " AND a.accountNumber LIKE :s";
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("s",s);
- List<Account> accountsResult = findAll(query, args);
- if (accountsResult != null) {
- //if first
- if (first) {
- accounts.addAll(accountsResult);
- } else {
- accounts.removeAll(accountsResult);
- }
- }
- }
- }
- }
- first = false;
- }
- }
- return new ArrayList(accounts);
- }
-}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,225 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id: ClosedPeriodicEntryBookDAOImpl.java 3476 2012-06-26 15:48:13Z echatellier $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-callao/src/main/java/org/chorem/lima/… $
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.collect.Maps;
-import org.hibernate.HibernateException;
-import org.nuiton.topia.persistence.TopiaException;
-
-public class AbstractClosedPeriodicEntryBookTopiaDao<E extends ClosedPeriodicEntryBook> extends GeneratedClosedPeriodicEntryBookTopiaDao<E> {
-
- /**
- * FIXME echatellier, remove this method when implemented in topia
- * just overriden to use merge() instead of saveOrUpdate()
- */
- public ClosedPeriodicEntryBook merge(ClosedPeriodicEntryBook e) throws TopiaException {
- try {
-// e = (ClosedPeriodicEntryBook)getContext().getHibernate().merge(e);
-// getContext().getFiresSupport().warnOnUpdateEntity(e);
-// return e;
- // TODO DCossé 15/05/14 don't know how to get hibernate
- return null;
- } catch (HibernateException ex) {
- throw new TopiaException(ex);
- }
- }
-
- /**
- * Find all ClosedPeriodicEntryBook with common EntryBook.
- *
- * @param entryBook entry book property
- * @return ClosedPeriodicEntryBook list
- * @throws TopiaException
- */
- public List<ClosedPeriodicEntryBook> findAllByEntryBook(EntryBook entryBook) throws TopiaException {
- return (List<ClosedPeriodicEntryBook>) forProperties(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, entryBook).findAll();
- }
-
- /**
- * Return ClosedPeriodicEntryBook by EntryBook and FinancialPeriod.
- *
- * @param entryBook
- * @param financialPeriod
- * @return ClosedPeriodicEntryBook
- * @throws TopiaException
- */
- public ClosedPeriodicEntryBook findByEntryBookAndFinancialPeriod(
- EntryBook entryBook, FinancialPeriod financialPeriod)
- throws TopiaException {
-
- List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks;
- String query = "FROM " + ClosedPeriodicEntryBook.class.getName();
-
- Map<String, Object> args = Maps.newLinkedHashMap();
-
- if (entryBook != null) {
- args.put("entryBook", entryBook);
- query += " WHERE entryBook = :entryBook";
- if (financialPeriod != null) {
- args.put("financialPeriod", financialPeriod);
- query += " AND financialPeriod = :financialPeriod";
- //find(query, 0, 0, "entryBook", entryBook, "financialPeriod", financialPeriod);
- closedPeriodicEntryBooks = findAll(query, args);
- } else {
- //find(query, 0, 0, "entryBook", entryBook);
- closedPeriodicEntryBooks = findAll(query, args);
- }
- } else {
- if (financialPeriod != null) {
- args.put("financialPeriod", financialPeriod);
- query += " WHERE financialPeriod = :financialPeriod";
- }
-
- //find(query, 0, 0, "financialPeriod", financialPeriod);
- closedPeriodicEntryBooks = findAll(query, args);
- }
-
- // get only first one
- ClosedPeriodicEntryBook result = null;
- if (!closedPeriodicEntryBooks.isEmpty()) {
- result = closedPeriodicEntryBooks.get(0);
- }
- return result;
- }
-
- /**
- * Retourne toutes les ClosedPeriodicEntryBook par interval de date
- * sur les periodes sur lequelles elles portent ordonnée par journal.
- *
- * @param beginDate begin date
- * @param endDate end date
- * @return all ClosedPeriodicEntryBook between begin and end
- * @throws TopiaException
- */
- public List<ClosedPeriodicEntryBook> findAllByDates(Date beginDate,
- Date endDate) throws TopiaException {
-
- String query = "FROM " + ClosedPeriodicEntryBook.class.getName() +
- " WHERE :beginDate <= financialPeriod.beginDate " +
- " AND financialPeriod.beginDate <= :endDate" +
- " ORDER BY entryBook.code";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
-
- return findAll(query, args);
- }
-
- /**
- * Retourne toutes les ClosedPeriodicEntryBook par interval de date
- * sur les periodes sur lequelles elles portent pour un journal.
- *
- * @param entryBook entry book
- * @param beginDate begin date
- * @param endDate end date
- * @return all ClosedPeriodicEntryBook between begin and end
- * @throws TopiaException
- */
- public List<ClosedPeriodicEntryBook> findAllByEntryBookAndDates(EntryBook entryBook,
- Date beginDate, Date endDate) throws TopiaException {
-
- String query = "FROM " + ClosedPeriodicEntryBook.class.getName() +
- " WHERE :beginDate <= financialPeriod.beginDate " +
- " AND financialPeriod.beginDate <= :endDate" +
- " AND entryBook = :entryBook";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
- return findAll(query, args);
- }
-
- /**
- * Retourne toutes les ClosedPeriodicEntryBook par interval de date
- * sur les periodes sur lequelles elles portent pour un journal.
- *
- * @param entryBook entry book
- * @param beginDate begin date
- * @param endDate end date
- * @return all ClosedPeriodicEntryBook between begin and end
- * @throws TopiaException
- */
- public List<ClosedPeriodicEntryBook> findAllByEntryBookAndDatesLocked(EntryBook entryBook,
- Date beginDate, Date endDate) throws TopiaException {
-
- String query = "FROM " + ClosedPeriodicEntryBook.class.getName() +
- " WHERE :beginDate <= financialPeriod.beginDate " +
- " AND financialPeriod.beginDate <= :endDate" +
- " AND entryBook = :entryBook" +
- " AND locked = true";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
- return findAll(query, args);
- }
-
- /**
- * Retourne les ClosedPeriodicEntryBook de toutes les exercices encore ouverts.
- *
- * @return les ClosedPeriodicEntryBook
- * @throws TopiaException
- */
- public List<ClosedPeriodicEntryBook> findAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws TopiaException {
- String query = "SELECT C FROM " + ClosedPeriodicEntryBook.class.getName() + " C" +
- ", " + FiscalPeriod.class.getName() + " F" +
- " WHERE C.financialPeriod IN ELEMENTS (F.financialPeriod)" +
- " AND F.locked = false" +
- " ORDER BY C.financialPeriod.beginDate";
-
- List<ClosedPeriodicEntryBook> result = findAll(query);
- return result;
- }
-
- /**
- * Retourne les ClosedPeriodicEntryBook d'un exercice ouvert.
- *
- * @return les ClosedPeriodicEntryBook
- * @throws TopiaException
- */
- public List<ClosedPeriodicEntryBook> findAllClosedPeriodicEntryBooksFromFiscalPeriod(FiscalPeriod fiscalPeriod) throws TopiaException {
- String query = "SELECT C FROM " + ClosedPeriodicEntryBook.class.getName() + " C" +
- ", " + FiscalPeriod.class.getName() + " F" +
- " WHERE C.financialPeriod IN ELEMENTS (F.financialPeriod)" +
- " AND F = :fiscalPeriod" +
- " ORDER BY C.financialPeriod.beginDate";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("fiscalPeriod", fiscalPeriod);
-
- List<ClosedPeriodicEntryBook> result = findAll(query, args);
-
- return result;
- }
-
-}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractEntryTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractEntryTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractEntryTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,323 +0,0 @@
-/*
- * #%L
- * Lima callao
- * *
- * $Id: EntryDAOImpl.java 3783 2014-05-06 16:47:18Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-callao/src/main/java/org/chorem/lima/… $
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import com.google.common.collect.Maps;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.beans.LetteringFilter;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-public class AbstractEntryTopiaDao<E extends Entry> extends GeneratedEntryTopiaDao<E> {
-
- private static final Log log = LogFactory.getLog(AbstractEntryTopiaDao.class);
-
- /**
- * Requete generique qui recupere les entrees equilibrées portant entre
- * deux dates.
- *
- * @param beginDate begin date
- * @param endDate end date
- */
- protected String getEquilibredTransactionQuery(Date beginDate, Date endDate) {
- String query = "FROM " + Entry.class.getName() + " E" +
- // equlibrée (somme des débit = somme des crédit)
- " WHERE (select sum(E2.amount) from " + Entry.class.getName() + " E2 where E2.debit = false and E2.financialTransaction = E.financialTransaction) = " +
- "(select sum(E2.amount) from " + Entry.class.getName() + " E2 where E2.debit = true and E2.financialTransaction = E.financialTransaction)" +
- // entre les 2 dates
- " AND :beginDate <= E.financialTransaction.transactionDate" +
- " AND E.financialTransaction.transactionDate <= :endDate";
- return query;
- }
-
- /**
- * Query for find entries for accountsreports and balancereports
- * Just exact and balanced transaction are calculated.
- *
- * @param account account
- * @param beginDate begin date
- * @param endDate end date
- * @return entries
- */
- public List<Entry> findAllEntryOfBalancedTransaction(Account account,
- Date beginDate, Date endDate) {
-
- String query = getEquilibredTransactionQuery(beginDate, endDate) +
- // concerne le compte
- " AND E.account = :account";
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("account", account);
-
- List<Entry> entries = findAll(query, args);
-
- return entries;
- }
-
- /**
- * Retourne la somme des entrées des transaction equilibrées entre
- * deux dates pour un compte donné.
- *
- * @param account account
- * @param beginDate bebin date
- * @param endDate end date
- * @return list boolean,int (une ligne pour le debit true, une ligne pour le credit)
- */
- public List<Object[]> getDebitCreditOfBalancedTransaction(Account account,
- Date beginDate, Date endDate) {
- String query = "SELECT E.debit, sum(E.amount) " +
- getEquilibredTransactionQuery(beginDate, endDate) +
- // concerne le compte
- " AND E.account = :account" +
- " GROUP BY E.debit";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("account", account);
-
- List<Object[]> result = findAll(query, args);
- return result;
- }
-
- /**
- * Retourne les entrees des transaction equlibrées entre deux dates pour
- * un journal.
- *
- * @param entryBook entry book
- * @param beginDate begin date
- * @param endDate end date
- */
- public List<Entry> findAllEntryOfBalancedTransaction(EntryBook entryBook, Date beginDate,
- Date endDate) {
- String query = getEquilibredTransactionQuery(beginDate, endDate) +
- // concerne le journal
- " AND E.financialTransaction.entryBook = :entryBook" +
- // fix order
- " ORDER BY E.financialTransaction.transactionDate, E.financialTransaction.topiaId";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
-
- List<Entry> entries = findAll(query, args);
- return entries;
- }
-
- public List<String> findLetters() {
- String query = "Select distinct E.lettering FROM " + Entry.class.getName() + " E" +
- " where E.lettering <> null" +
- " order by E.lettering desc";
-
- List<String> result = new ArrayList<String>(this.<String>findAll(query));
-
- if (log.isDebugEnabled()) {
- log.debug("Size of result : " + result.size());
- }
-
- return result;
- }
-
- /**
- * Retourne la somme des entrées des transaction equilibrées entre
- * deux dates pour un journal donné.
- *
- * @param entryBook entry book
- * @param beginDate bebin date
- * @param endDate end date
- * @return list boolean,int (une ligne pour le debit true, une ligne pour le credit)
- */
- public List<Object[]> getDebitCreditOfBalancedTransaction(EntryBook entryBook,
- Date beginDate, Date endDate) {
- String query = "SELECT E.debit, sum(E.amount) " +
- getEquilibredTransactionQuery(beginDate, endDate) +
- // concerne le journal
- " AND E.financialTransaction.entryBook = :entryBook" +
- " GROUP BY E.debit";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
-
- List<Object[]> result = findAll(query, args);
- return result;
- }
-
- /**
- * Retourne les entrees des transaction entre deux dates pour
- * un journal.
- *
- * @param entryBook entry book
- * @param beginDate begin date
- * @param endDate end date
- */
- public List<Entry> findAllEntryByDateForEntryBook(EntryBook entryBook, Date beginDate,
- Date endDate) {
- String query = "FROM " + Entry.class.getName() + " E" +
- // entre les 2 dates
- " WHERE :beginDate <= E.financialTransaction.transactionDate" +
- " AND E.financialTransaction.transactionDate <= :endDate" +
- // concerne le journal
- " AND E.financialTransaction.entryBook = :entryBook";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
-
- List<Entry> entries = findAll(query, args);
- return entries;
- }
-
- /**
- * Retourne toutes les entrées d'une transaction
- * pour un compte et la présence d'un lettrage ou (xor) non
- * @param filter filtre sur les entrees, selon le compte, les dates de debut et de fin, et le lettrage
- * */
- public List<Entry> findAllEntryByFilter(LetteringFilter filter) {
-
- List<Entry> entries;
- Account account = filter.getAccount();
-
- if (account != null && account.getTopiaId() == null) {
- // case user want to see all accounts
- entries = getAllEntryByLetteringAndDateForEntryBook(filter);
- } else {
- entries = getAllEntryByAccountLetteringAndDateForEntryBook(filter);
- }
- return entries;
- }
-
- public List<Entry> getAllEntryByAccountLetteringAndDateForEntryBook(LetteringFilter filter) {
- List<Entry> entries;
-
- String query = "Select E from " + Entry.class.getName() + " E " +
- " where E.account.accountNumber like :account ";
-
-
- if (!filter.getDisplayLettered() && filter.getDisplayUnlettred()){
- query += " and (E.lettering is null or E.lettering = '') ";
- } else if (filter.getDisplayLettered() && !filter.getDisplayUnlettred()){
- query += " and (E.lettering is not null or E.lettering !='') ";
- }
-
- query += " and E.financialTransaction.transactionDate between :beginDate and :endDate " +
- " order by E.financialTransaction.transactionDate, E.financialTransaction." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", filter.getDateStart());
- args.put("endDate", filter.getDateEnd());
- args.put("account", filter.getAccount().getAccountNumber() + "%");
- entries = findAll(query, args);
-
- return entries;
- }
-
- public List<Entry> getAllEntryByLetteringAndDateForEntryBook(LetteringFilter filter) {
- List<Entry> entries;
-
- String query = "Select E from " + Entry.class.getName() + " E ";
-
- query += " WHERE E.financialTransaction.transactionDate BETWEEN :beginDate and :endDate ";
-
- if (!filter.getDisplayLettered() && filter.getDisplayUnlettred()){
- query += " and (E.lettering is null or E.lettering = '') ";
- } else if (filter.getDisplayLettered() && !filter.getDisplayUnlettred()){
- query += " and (E.lettering is not null or E.lettering !='') ";
- }
-
- query += " order by E.financialTransaction.transactionDate, E.financialTransaction." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", filter.getDateStart());
- args.put("endDate", filter.getDateEnd());
-
- entries = findAll(query, args);
-
- return entries;
- }
-
-
- /**
- * Retourne la dernière entrée d'une transaction
- * @param financialTransaction transaction sur laquelle la derniere entree est selectionnee
- * */
- public Entry getLastEntry(FinancialTransaction financialTransaction) {
- List<Entry> entries;
- Entry lastEntry = null;
- String query = "Select E from " + Entry.class.getName() + " E" +
- " where E.financialTransaction.transactionDate = :financialTransactionDate " +
- " and E.financialTransaction = :financialTransaction" +
- " order by E.topiaCreateDate desc";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("financialTransactionDate", financialTransaction.getTransactionDate());
- args.put("financialTransaction", financialTransaction);
-
- entries = findAll(query, args);
- if (entries.size() > 0) {
- lastEntry = entries.get(0);
- }
-
- return lastEntry;
- }
-
- /**
- * Retourne la somme des entrées des transaction entre
- * deux dates pour un journal donné.
- *
- * @param entryBook entry book
- * @param beginDate bebin date
- * @param endDate end date
- * @return list boolean,int (une ligne pour le debit true, une ligne pour le credit)
- */
- public List<Object[]> getDebitCreditOfTransaction(EntryBook entryBook,
- Date beginDate, Date endDate) {
- String query = "SELECT E.debit, sum(E.amount) " +
- "FROM " + Entry.class.getName() + " E" +
- // entre les 2 dates
- " WHERE :beginDate <= E.financialTransaction.transactionDate" +
- " AND E.financialTransaction.transactionDate <= :endDate" +
- // concerne le journal
- " AND E.financialTransaction.entryBook = :entryBook" +
- " GROUP BY E.debit";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
-
- List<Object[]> result = findAll(query, args);
- return result;
- }
-}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialPeriodTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialPeriodTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialPeriodTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,112 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id: FinancialPeriodDAOImpl.java 3476 2012-06-26 15:48:13Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.collect.Maps;
-import org.nuiton.topia.persistence.TopiaException;
-
-public class AbstractFinancialPeriodTopiaDao<E extends FinancialPeriod> extends GeneratedFinancialPeriodTopiaDao<E> {
-
- /**
- * Return FinancialPeriod by Date.
- * Date is include between financialperiod begin and end date.
- *
- * @param date period middle date
- * @return FinancialPeriod for {@code date}
- * @throws TopiaException
- */
- public FinancialPeriod findByDate(Date date) throws TopiaException {
-
- String query = "FROM " + FinancialPeriod.class.getName() +
- " WHERE beginDate <= :date" +
- " AND :date <= endDate";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("date", date);
- // add unique result here
- FinancialPeriod financialPeriod = (FinancialPeriod)findUnique(query, args);
- return financialPeriod;
- }
-
- /**
- * Return all FinancialPeriod with begin date between two given dates.
- *
- * @param beginDate period begin date
- * @param endDate period end date
- * @return FinancialPeriod for {@code date}
- * @throws TopiaException
- */
- public List<FinancialPeriod> findByDates(Date beginDate, Date endDate) throws TopiaException {
-
- String query = "FROM " + FinancialPeriod.class.getName() +
- " WHERE :beginDate <= beginDate" +
- " AND beginDate <= :endDate" +
- " ORDER by beginDate";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate", beginDate);
- args.put("endDate", endDate);
- // add unique result here
- List<FinancialPeriod> financialPeriod = findAll(query, args);
- return financialPeriod;
- }
-
- /**
- * Retourne toutes les periodes ordonnées par date de debut de periode.
- *
- * @return all period ordered
- * @throws TopiaException
- */
- public List<FinancialPeriod> findAllOrderByBeginDate() throws TopiaException {
- String query = "FROM " + FinancialPeriod.class.getName() +
- " ORDER BY beginDate";
-
- // add unique result here
- List<FinancialPeriod> financialPeriod = findAll(query);
- return financialPeriod;
- }
-
- /**
- * Retourne toutes les periodes ordonnées par date de debut de periode.
- *
- * @return all period ordered
- * @throws TopiaException
- */
- public List<FinancialPeriod> findAllUnlockedOrderByBeginDate() throws TopiaException {
- String query = "FROM " + FinancialPeriod.class.getName() +
- " WHERE locked = false" +
- " ORDER BY beginDate";
-
- // add unique result here
- List<FinancialPeriod> financialPeriod = findAll(query);
- return financialPeriod;
- }
-
-}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,79 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id: FinancialStatementDAOImpl.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
- * %%
- * Copyright (C) 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import com.google.common.collect.Maps;
-
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * Ajout de requetes specifiques aux {@link FinancialStatement} sur le DAO.
- *
- * @author chatellier
- * @version $Revision: 3585 $
- *
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
- */
-public class AbstractFinancialStatementTopiaDao<E extends FinancialStatement> extends GeneratedFinancialStatementTopiaDao<E> {
-
- /**
- * Find all {@code FinancialStatement} ordered by topia create date.
- */
- public List<FinancialStatement> findAllOrderedByCreateDate() {
- String query = "FROM " + FinancialStatement.class.getName() +
- " ORDER BY " + FinancialStatement.PROPERTY_TOPIA_CREATE_DATE;
- List<FinancialStatement> result = findAll(query);
- return result;
- }
-
- /**
- * Find all {@code FinancialStatement} ordered by topia create date.
- */
- public List<FinancialStatement> findChildrenFinancialStatement(FinancialStatement financialStatement) {
- String query = "FROM " + FinancialStatement.class.getName();
-
- if (financialStatement == null) {
- query += " WHERE masterFinancialStatement = null";
- } else {
- query += " WHERE masterFinancialStatement = :masterFinancialStatement";
- }
- query += " ORDER BY " + FinancialStatement.PROPERTY_TOPIA_CREATE_DATE;
-
- List<FinancialStatement> result;
- if (financialStatement == null) {
- result = findAll(query);
- } else {
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("masterFinancialStatement", financialStatement);
- result = findAll(query, args);
- }
- return result;
- }
-
-} //FinancialStatementDAO
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialTransactionTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialTransactionTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialTransactionTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,329 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id: FinancialTransactionDAOImpl.java 3688 2013-06-27 13:12:22Z Bavencoff $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
- * %%
- * Copyright (C) 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import com.google.common.collect.Maps;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.Filter.Filter;
-import org.hibernate.HibernateException;
-import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.event.TopiaContextAdapter;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Ajout de requetes specifiques aux financial transaction sur le DAO.
- *
- * @author chatellier
- * @version $Revision: 3688 $
- *
- * Last update : $Date: 2013-06-27 15:12:22 +0200 (jeu. 27 juin 2013) $
- * By : $Author: Bavencoff $
- */
-public class AbstractFinancialTransactionTopiaDao<E extends FinancialTransaction> extends GeneratedFinancialTransactionTopiaDao<E> {
-
- private static final Log log = LogFactory.getLog(AbstractFinancialTransactionTopiaDao.class);
-
- /**
- * FIXME echatellier, remove this method when implemented in topia
- * just overriden to use merge() instead of saveOrUpdate()
- */
- public FinancialTransaction merge(FinancialTransaction e) {
-// try {
-// e = (FinancialTransaction) getContext().getHibernate().merge(e);
-// getContext().getFiresSupport().warnOnUpdateEntity(e);
-// return e;
-// } catch (HibernateException ex) {
-// throw new TopiaException(ex);
-// }
- // TODO DCossé 15/05/14 find a way to get hibernate
- return null;
- }
-
- /**
- * Return how many transaction are found with specified entryBook.
- *
- * @param entryBook entry book
- * @return transaction referencing entry book
- */
- public long getCountByEntryBook(EntryBook entryBook) {
- String query = "SELECT count(*) FROM " + FinancialTransaction.class.getName() + " t WHERE t.entryBook = :entryBook";
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("entryBook", entryBook);
- Number count = (Number)findAll(query, args).get(0);
- return count.longValue();
- }
-
- /**
- * Find all transactions between two dates.
- *
- * @param beginDate begin date
- * @param endDate end date
- * @return unbalanced transactions
- */
- public List<FinancialTransaction> findAllByDates(Date beginDate, Date endDate) {
- String query = "FROM " + FinancialTransaction.class.getName() + " T"+
- " WHERE :beginDate <= T.transactionDate" +
- " AND T.transactionDate <= :endDate" +
- " ORDER BY T.transactionDate, T." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate",beginDate);
- args.put("endDate", endDate);
- List<FinancialTransaction> result = findAll(query,args);
- return result;
- }
-
- /**
- * Find all transactions between two dates in an entry book.
- *
- * @param beginDate begin date
- * @param endDate end date
- * @param entryBook entry book
- * @return unbalanced transactions
- */
- public List<FinancialTransaction> findAllByDates(Date beginDate, Date endDate, EntryBook entryBook) {
- String query = "FROM " + FinancialTransaction.class.getName() + " T"+
- " WHERE :beginDate <= T.transactionDate" +
- " AND T.transactionDate <= :endDate" +
- " AND T.entryBook = :entryBook" +
- " ORDER BY T.transactionDate, T." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate",beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
- List<FinancialTransaction> result = findAll(query, args);
- return result;
- }
-
- /**
- * Find all unbalanced transactions.
- *
- * @param beginDate beginDate
- * @param endDate endDate
- * @param entryBook entry book (can be null)
- * @return unbalanced transactions
- */
- public List<FinancialTransaction> getAllUnbalancedTransaction(Date beginDate, Date endDate,
- EntryBook entryBook) {
- String query = "FROM " + FinancialTransaction.class.getName() + " T"+
- " WHERE (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = true AND financialTransaction = T) != " +
- " (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = false AND financialTransaction = T)" +
- " AND :beginDate <= T.transactionDate" +
- " AND T.transactionDate <= :endDate";
- List<FinancialTransaction> result;
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate",beginDate);
- args.put("endDate", endDate);
- if (entryBook != null) {
- args.put("entryBook", entryBook);
- query += " AND T.entryBook = :entryBook";
- result = findAll(query, args);
- } else {
- result = findAll(query, args);
- }
-
- return result;
- }
-
- /**
- * Find all unbalanced transactions.
- *
- * @param beginDate beginDate
- * @param endDate endDate
- * @param entryBook entry book (can be null)
- * @return unbalanced transactions
- */
- public List<FinancialTransaction> getAllBalancedTransaction(Date beginDate, Date endDate,
- EntryBook entryBook) {
- String query = "FROM " + FinancialTransaction.class.getName() + " T"+
- " WHERE (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = true AND financialTransaction = T) = " +
- " (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = false AND financialTransaction = T)" +
- " AND :beginDate <= T.transactionDate" +
- " AND T.transactionDate <= :endDate";
- List<FinancialTransaction> result;
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate",beginDate);
- args.put("endDate", endDate);
-
- if (entryBook != null) {
- args.put("entryBook", entryBook);
- query += " AND T.entryBook = :entryBook";
- result = findAll(query, args);
- } else {
- result = findAll(query, args);
- }
-
- return result;
- }
-
- /**
- * Find all unbalanced transactions.
- *
- * @param beginDate beginDate
- * @param endDate endDate
- * @param entryBook entry book (can be null)
- * @return unbalanced transactions
- */
- public List<FinancialTransaction> getAllIncorrectTransaction(Date beginDate, Date endDate,
- EntryBook entryBook) {
- String query = "SELECT distinct T FROM " + FinancialTransaction.class.getName() + " T"+
- " LEFT JOIN T.entry AS E" +
- " WHERE ((SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = true AND financialTransaction = T) != " +
- " (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = false AND financialTransaction = T)" +
- " OR (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = true AND financialTransaction = T) IS NULL" +
- " OR (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = false AND financialTransaction = T) IS NULL" +
- " OR E.account = null" +
- " OR E.voucher = null" +
- " OR E.voucher = ''" +
- " OR E.description = null" +
- " OR E.description = '')" +
- " AND :beginDate <= T.transactionDate" +
- " AND T.transactionDate <= :endDate";
- List<FinancialTransaction> result;
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate",beginDate);
- args.put("endDate", endDate);
- if (entryBook != null) {
- args.put("entryBook", entryBook);
- query += " AND T.entryBook = :entryBook";
- result = findAll(query, args);
- } else {
- result = findAll(query, args);
- }
-
- return result;
- }
-
- /**
- * Find all transaction where some field are not filled in.
- *
- * @param beginDate begin date
- * @param endDate end date
- * @param entryBook entry book
- * @return unfilled transaction
- */
- public List<FinancialTransaction> getAllUnfilledTransaction(Date beginDate,
- Date endDate, EntryBook entryBook) {
- String query = "SELECT T FROM " + FinancialTransaction.class.getName() + " T"+
- " LEFT JOIN T.entry AS E" +
- " WHERE ((SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = true AND financialTransaction = T) != " +
- " (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = false AND financialTransaction = T) OR E.account = null" +
- " OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = '')" +
- " AND T.entryBook = :entryBook" +
- " AND :beginDate <= T.transactionDate" +
- " AND T.transactionDate <= :endDate";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate",beginDate);
- args.put("endDate", endDate);
- args.put("entryBook", entryBook);
- List<FinancialTransaction> result = findAll(query, args);
- return result;
- }
-
- /**
- * Find all transaction without entry book.
- *
- * @param beginDate begin date
- * @param endDate end date
- * @return transaction without entry books
- */
- public List<FinancialTransaction> getAllTransactionWithoutEntryBook(Date beginDate,
- Date endDate) {
-
- String query = "SELECT T FROM " + FinancialTransaction.class.getName() + " T"+
- " LEFT JOIN T.entry AS E" +
- " WHERE ((SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = true AND financialTransaction = T) != " +
- " (SELECT sum(amount) FROM " + Entry.class.getName() +
- " WHERE debit = false AND financialTransaction = T) OR E.account = null" +
- " OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = '')" +
- " AND entryBook = null" +
- " AND :beginDate <= T.transactionDate" +
- " AND T.transactionDate <= :endDate";
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("beginDate",beginDate);
- args.put("endDate", endDate);
-
- List<FinancialTransaction> result = findAll(query, args);
-
- return result;
- }
-
- /**
- * Search financial transaction.
- *
- *
- * @param filter filter parameters
- * @return financial transaction
- */
- public List<FinancialTransaction> searchFinancialTransaction(Filter filter) {
-
- GeneratorHQuery generator = new GeneratorHQuery();
- filter.accept(generator);
-
-
- String query = generator.getHQuery();
- Map<String,Object> arguments = generator.getParameters();
-
- if (log.isDebugEnabled()) {
- Set<String> parameters = arguments.keySet();
- for(String param : parameters) {
- log.debug("Query : \n" + query + "\nArguments: " + param);
- }
- }
-
- // perform query
- List<FinancialTransaction> result;
- if (arguments.isEmpty()) {
- result = findAll(query);
- } else {
- result = findAll(query, arguments);
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Number of founded transactions : " + result.size());
- }
-
- return result;
- }
-
-} //FinancialTransactionDAO
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFiscalPeriodTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFiscalPeriodTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFiscalPeriodTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,140 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id: FiscalPeriodDAOImpl.java 3598 2012-08-10 16:31:26Z mallon $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
- * %%
- * Copyright (C) 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.collect.Maps;
-import org.hibernate.HibernateException;
-import org.nuiton.topia.persistence.TopiaException;
-
-/**
- * Fiscal period entity DAO.
- *
- * @author chatellier
- * @version $Revision: 3598 $
- *
- * Last update : $Date: 2012-08-10 18:31:26 +0200 (ven. 10 août 2012) $
- * By : $Author: mallon $
- */
-public class AbstractFiscalPeriodTopiaDao<E extends FiscalPeriod> extends GeneratedFiscalPeriodTopiaDao<E> {
-
- /**
- * FIXME echatellier, remove this method when implemented in topia
- * just overriden to use merge() instead of saveOrUpdate()
- */
- @Override
- public FiscalPeriod update(FiscalPeriod e) throws TopiaException {
- try {
-// getContext().getHibernate().merge(e);
-// getContext().getFiresSupport().warnOnUpdateEntity(e);
-// return e;
- // TODO DCossé 15/05/14 find a way to do it
- return null;
- } catch (HibernateException ex) {
- throw new TopiaException(ex);
- }
- }
-
- /**
- * Find fiscal period by financial period.
- *
- * @param financialPeriod financial period
- * @return fiscal period containing financial period
- * @throws TopiaException
- */
- public FiscalPeriod findByFinancialPeriod(FinancialPeriod financialPeriod) throws TopiaException {
- String query = "FROM " + FiscalPeriod.class.getName() +
- " WHERE :financialPeriod in elements(financialPeriod)";
-
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("financialPeriod", financialPeriod);
-
- List<FiscalPeriod> fiscalPeriods = findAll(query, args);
- FiscalPeriod result = null;
- if (!fiscalPeriods.isEmpty()) {
- result = fiscalPeriods.get(0);
- }
- return result;
- }
-
- /**
- * Get last fiscal period (higher end date).
- *
- * @return last fiscal period
- * @throws TopiaException
- */
- public FiscalPeriod getLastFiscalPeriod() throws TopiaException {
- String query = "FROM " + FiscalPeriod.class.getName() +
- " ORDER BY endDate desc";
-
- List<FiscalPeriod> fiscalPeriods = findAll(query);
- FiscalPeriod result = null;
- if (!fiscalPeriods.isEmpty()) {
- result = fiscalPeriods.get(0);
- }
-
- return result;
- }
-
- /**
- * Get first fiscal period (higher end date).
- *
- * @return last fiscal period
- * @throws TopiaException
- */
- public FiscalPeriod getFirstFiscalPeriod() throws TopiaException {
- String query = "FROM " + FiscalPeriod.class.getName() +
- " ORDER BY endDate";
-
- List<FiscalPeriod> fiscalPeriods = findAll(query);
- FiscalPeriod result = null;
- if (!fiscalPeriods.isEmpty()) {
- result = fiscalPeriods.get(0);
- }
- return result;
- }
-
- /**
- * Get last non locked fiscal period (higher end date).
- *
- * @return last fiscal period
- * @throws TopiaException
- */
- public FiscalPeriod getLastUnlockedFiscalPeriod() throws TopiaException {
- String query = "FROM " + FiscalPeriod.class.getName() +
- " WHERE locked = false" +
- " ORDER BY endDate desc";
-
- List<FiscalPeriod> fiscalPeriods = findAll(query);
- FiscalPeriod result = null;
- if (!fiscalPeriods.isEmpty()) {
- result = fiscalPeriods.get(0);
- }
- return result;
- }
-}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -1,103 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id: VatStatementDAOImpl.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
- * %%
- * Copyright (C) 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import com.google.common.collect.Maps;
-
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * Ajout de requetes specifiques aux {@code VatStatement} sur le DAO.
- *
- * @author chatellier
- * @version $Revision: 3585 $
- *
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
- */
-public class AbstractVatStatementTopiaDao<E extends VatStatement> extends GeneratedVatStatementTopiaDao<E> {
-
- /**
- * Find all {@code VatStatement} ordered by topia create date.
- */
- public List<VatStatement> findAllOrderedByCreateDate() {
- String query = "FROM " + VatStatement.class.getName() +
- " ORDER BY " + VatStatement.PROPERTY_TOPIA_CREATE_DATE;
- List<VatStatement> result = findAll(query);
- return result;
- }
-
- /**
- * Get masterVatStatement children statement.
- *
- * @param masterVatStatement master VatStatement
- * @return children VatStatement
- */
- public List<VatStatement> getChildrenVatStatement(VatStatement masterVatStatement) {
- String query = "FROM " + VatStatement.class.getName();
-
- if (masterVatStatement == null) {
- query += " WHERE masterVatStatement = null";
- } else {
- query += " WHERE masterVatStatement = :masterVatStatement";
- }
-
- query += " ORDER BY " + VatStatement.PROPERTY_TOPIA_CREATE_DATE;
- List<VatStatement> result;
- if (masterVatStatement == null) {
- result = findAll(query);
- } else {
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("masterVatStatement", masterVatStatement);
- result = findAll(query, args);
- }
- return result;
- }
-
- /**
- * Recherche un statement par equivalence de label.
- *
- * TODO voir a quoi ca sert vraiment.
- *
- * @param label label
- * @return statement like label
- */
- public VatStatement findVatStatementByLabel(String label) {
- String query = "FROM " + VatStatement.class.getName() +
- " WHERE label LIKE :label";
- Map<String, Object> args = Maps.newLinkedHashMap();
- args.put("label", "%" + label + "%");
- List<VatStatement> statements = findAll(query, args);
- VatStatement result = null;
- if (!statements.isEmpty()) {
- result = statements.get(0);
- }
- return result;
- }
-
-} //VatStatementDAO
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java (from rev 3808, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractAccountTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,192 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id: AccountDAOImpl.java 3613 2012-08-20 11:38:22Z mallon $
+ * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringUtils;
+import org.nuiton.topia.persistence.TopiaException;
+
+public class AccountTopiaDao extends AbstractAccountTopiaDao<Account> {
+
+ /**
+ * Retourne tous les comptes qui n'ont pas eux meme de sous compte.
+ *
+ * @return leaf accounts
+ * @throws TopiaException
+ */
+ public List<Account> findAllLeafAccounts() throws TopiaException {
+ // FIXME echatellier 20120413 la requete ne fonctionne pas
+ // et retourne vide
+ /*String query = "FROM " + Account.class.getName() + " a WHERE a NOT IN (" +
+ "FROM " + Account.class.getName() + " b where b.accountNumber like concat(a.accountNumber,'%'))";
+ List<Account> accounts = find(query);*/
+
+ // code temporaire non performant en attandant:
+ List<Account> allAccounts = (List<Account>) findAll();
+ Iterator<Account> itAccount = allAccounts.iterator();
+ while (itAccount.hasNext()) {
+ Account acc = itAccount.next();
+ Iterator<Account> itAccount2 = allAccounts.iterator();
+ while (itAccount2.hasNext()) {
+ Account acc2 = itAccount2.next();
+ if (!acc2.getAccountNumber().equals(acc.getAccountNumber()) &&
+ acc2.getAccountNumber().startsWith(acc.getAccountNumber())) {
+ itAccount.remove();
+ break;
+ }
+ }
+ }
+ return allAccounts;
+ }
+
+ /**
+ * TODO pas compris l'interet de la methode, si on veut un compte feuille
+ * par son numero, cela revient a avoir un compte par son numero.
+ */
+ @Deprecated
+ public Account findLeafAccountByNumber(String number) throws TopiaException {
+ return forAccountNumberEquals(number).findUniqueOrNull();
+ }
+
+ /**
+ * Find account contained into account number interval.
+ *
+ * @param accountNumberLow min account number
+ * @param accountNumberHigh max account number
+ * @return account list
+ * @throws TopiaException
+ */
+ protected List<Account> findIntervalAccountByNumber(String accountNumberLow,
+ String accountNumberHigh) throws TopiaException {
+ String query = "FROM " + Account.class.getName() + " WHERE :accountNumberLow <= accountNumber AND accountNumber <= :accountNumberHigh";
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("accountNumberLow", accountNumberLow);
+ args.put("accountNumberHigh", accountNumberHigh);
+ return findAll(query, args);
+ }
+
+ /**
+ * Retourne tous les comptes dont le numero commence par celui specifié.
+ *
+ * @param account parent account
+ * @return
+ * @throws TopiaException
+ */
+ public List<Account> findAllSubAccounts(Account account) throws TopiaException {
+
+ String query = "FROM " + Account.class.getName() + " a WHERE a.accountNumber LIKE concat(:accountNumber, '_%')";
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("accountNumber", account.getAccountNumber());
+ List<Account> accounts = findAll(query, args);
+
+ return accounts;
+ }
+
+ /**
+ * @deprecated since 0.6, business method, need to be moved out of dao
+ */
+ @Deprecated
+ public List<Account> stringToListAccounts(String selectedAccounts,
+ Boolean leafAccountsMode) throws TopiaException {
+ Set<Account> accounts = new HashSet<Account>();
+ if (selectedAccounts != null) {
+ //Remove Spaces
+ String result = StringUtils.deleteWhitespace(selectedAccounts);
+
+ Boolean first = true;
+ StringTokenizer stStar = new StringTokenizer(result, "-");
+ while (stStar.hasMoreTokens()) {
+ String subString = stStar.nextToken();
+
+ //Split comma
+ StringTokenizer stComma = new StringTokenizer(subString, ",");
+ while (stComma.hasMoreTokens()) {
+ String s = stComma.nextToken();
+ //if intervall account
+ if (s.contains("..") && !s.endsWith("..")) {
+ //Split ..
+ String stringDoubleDot[] = s.split("\\.\\.");
+
+ List<Account> resultIntervall =
+ findIntervalAccountByNumber(stringDoubleDot[0], stringDoubleDot[1]);
+
+ //if first add accounts, else remove
+ if (first) {
+ accounts.addAll(resultIntervall);
+ } else {
+ accounts.removeAll(resultIntervall);
+ }
+ }
+ //else one account
+ else {
+ Account account;
+ if (leafAccountsMode) {
+ account = findLeafAccountByNumber(s);
+ } else {
+ account = findByAccountNumber(s);
+ }
+ //if exist
+ if (account != null) {
+ //if first
+ if (first) {
+ accounts.add(account);
+ } else {
+ accounts.remove(account);
+ }
+ }
+ //search all account start with accountnumber
+ else {
+ String query = "FROM " + Account.class.getName() + " a WHERE a NOT IN (" +
+ "FROM " + Account.class.getName() + " b where b.accountNumber like a.accountNumber+'%')" +
+ " AND a.accountNumber LIKE :s";
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("s",s);
+ List<Account> accountsResult = findAll(query, args);
+ if (accountsResult != null) {
+ //if first
+ if (first) {
+ accounts.addAll(accountsResult);
+ } else {
+ accounts.removeAll(accountsResult);
+ }
+ }
+ }
+ }
+ }
+ first = false;
+ }
+ }
+ return new ArrayList(accounts);
+ }
+}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java (from rev 3809, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,225 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id: ClosedPeriodicEntryBookDAOImpl.java 3476 2012-06-26 15:48:13Z echatellier $
+ * $HeadURL: http://svn.chorem.org/lima/trunk/lima-callao/src/main/java/org/chorem/lima/… $
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+import org.hibernate.HibernateException;
+import org.nuiton.topia.persistence.TopiaException;
+
+public class ClosedPeriodicEntryBookTopiaDao extends AbstractClosedPeriodicEntryBookTopiaDao<ClosedPeriodicEntryBook> {
+
+ /**
+ * FIXME echatellier, remove this method when implemented in topia
+ * just overriden to use merge() instead of saveOrUpdate()
+ */
+ public ClosedPeriodicEntryBook merge(ClosedPeriodicEntryBook e) throws TopiaException {
+ try {
+// e = (ClosedPeriodicEntryBook)getContext().getHibernate().merge(e);
+// getContext().getFiresSupport().warnOnUpdateEntity(e);
+// return e;
+ // TODO DCossé 15/05/14 don't know how to get hibernate
+ return null;
+ } catch (HibernateException ex) {
+ throw new TopiaException(ex);
+ }
+ }
+
+ /**
+ * Find all ClosedPeriodicEntryBook with common EntryBook.
+ *
+ * @param entryBook entry book property
+ * @return ClosedPeriodicEntryBook list
+ * @throws TopiaException
+ */
+ public List<ClosedPeriodicEntryBook> findAllByEntryBook(EntryBook entryBook) throws TopiaException {
+ return (List<ClosedPeriodicEntryBook>) forProperties(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, entryBook).findAll();
+ }
+
+ /**
+ * Return ClosedPeriodicEntryBook by EntryBook and FinancialPeriod.
+ *
+ * @param entryBook
+ * @param financialPeriod
+ * @return ClosedPeriodicEntryBook
+ * @throws TopiaException
+ */
+ public ClosedPeriodicEntryBook findByEntryBookAndFinancialPeriod(
+ EntryBook entryBook, FinancialPeriod financialPeriod)
+ throws TopiaException {
+
+ List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks;
+ String query = "FROM " + ClosedPeriodicEntryBook.class.getName();
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+
+ if (entryBook != null) {
+ args.put("entryBook", entryBook);
+ query += " WHERE entryBook = :entryBook";
+ if (financialPeriod != null) {
+ args.put("financialPeriod", financialPeriod);
+ query += " AND financialPeriod = :financialPeriod";
+ //find(query, 0, 0, "entryBook", entryBook, "financialPeriod", financialPeriod);
+ closedPeriodicEntryBooks = findAll(query, args);
+ } else {
+ //find(query, 0, 0, "entryBook", entryBook);
+ closedPeriodicEntryBooks = findAll(query, args);
+ }
+ } else {
+ if (financialPeriod != null) {
+ args.put("financialPeriod", financialPeriod);
+ query += " WHERE financialPeriod = :financialPeriod";
+ }
+
+ //find(query, 0, 0, "financialPeriod", financialPeriod);
+ closedPeriodicEntryBooks = findAll(query, args);
+ }
+
+ // get only first one
+ ClosedPeriodicEntryBook result = null;
+ if (!closedPeriodicEntryBooks.isEmpty()) {
+ result = closedPeriodicEntryBooks.get(0);
+ }
+ return result;
+ }
+
+ /**
+ * Retourne toutes les ClosedPeriodicEntryBook par interval de date
+ * sur les periodes sur lequelles elles portent ordonnée par journal.
+ *
+ * @param beginDate begin date
+ * @param endDate end date
+ * @return all ClosedPeriodicEntryBook between begin and end
+ * @throws TopiaException
+ */
+ public List<ClosedPeriodicEntryBook> findAllByDates(Date beginDate,
+ Date endDate) throws TopiaException {
+
+ String query = "FROM " + ClosedPeriodicEntryBook.class.getName() +
+ " WHERE :beginDate <= financialPeriod.beginDate " +
+ " AND financialPeriod.beginDate <= :endDate" +
+ " ORDER BY entryBook.code";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+
+ return findAll(query, args);
+ }
+
+ /**
+ * Retourne toutes les ClosedPeriodicEntryBook par interval de date
+ * sur les periodes sur lequelles elles portent pour un journal.
+ *
+ * @param entryBook entry book
+ * @param beginDate begin date
+ * @param endDate end date
+ * @return all ClosedPeriodicEntryBook between begin and end
+ * @throws TopiaException
+ */
+ public List<ClosedPeriodicEntryBook> findAllByEntryBookAndDates(EntryBook entryBook,
+ Date beginDate, Date endDate) throws TopiaException {
+
+ String query = "FROM " + ClosedPeriodicEntryBook.class.getName() +
+ " WHERE :beginDate <= financialPeriod.beginDate " +
+ " AND financialPeriod.beginDate <= :endDate" +
+ " AND entryBook = :entryBook";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+ return findAll(query, args);
+ }
+
+ /**
+ * Retourne toutes les ClosedPeriodicEntryBook par interval de date
+ * sur les periodes sur lequelles elles portent pour un journal.
+ *
+ * @param entryBook entry book
+ * @param beginDate begin date
+ * @param endDate end date
+ * @return all ClosedPeriodicEntryBook between begin and end
+ * @throws TopiaException
+ */
+ public List<ClosedPeriodicEntryBook> findAllByEntryBookAndDatesLocked(EntryBook entryBook,
+ Date beginDate, Date endDate) throws TopiaException {
+
+ String query = "FROM " + ClosedPeriodicEntryBook.class.getName() +
+ " WHERE :beginDate <= financialPeriod.beginDate " +
+ " AND financialPeriod.beginDate <= :endDate" +
+ " AND entryBook = :entryBook" +
+ " AND locked = true";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+ return findAll(query, args);
+ }
+
+ /**
+ * Retourne les ClosedPeriodicEntryBook de toutes les exercices encore ouverts.
+ *
+ * @return les ClosedPeriodicEntryBook
+ * @throws TopiaException
+ */
+ public List<ClosedPeriodicEntryBook> findAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws TopiaException {
+ String query = "SELECT C FROM " + ClosedPeriodicEntryBook.class.getName() + " C" +
+ ", " + FiscalPeriod.class.getName() + " F" +
+ " WHERE C.financialPeriod IN ELEMENTS (F.financialPeriod)" +
+ " AND F.locked = false" +
+ " ORDER BY C.financialPeriod.beginDate";
+
+ List<ClosedPeriodicEntryBook> result = findAll(query);
+ return result;
+ }
+
+ /**
+ * Retourne les ClosedPeriodicEntryBook d'un exercice ouvert.
+ *
+ * @return les ClosedPeriodicEntryBook
+ * @throws TopiaException
+ */
+ public List<ClosedPeriodicEntryBook> findAllClosedPeriodicEntryBooksFromFiscalPeriod(FiscalPeriod fiscalPeriod) throws TopiaException {
+ String query = "SELECT C FROM " + ClosedPeriodicEntryBook.class.getName() + " C" +
+ ", " + FiscalPeriod.class.getName() + " F" +
+ " WHERE C.financialPeriod IN ELEMENTS (F.financialPeriod)" +
+ " AND F = :fiscalPeriod" +
+ " ORDER BY C.financialPeriod.beginDate";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("fiscalPeriod", fiscalPeriod);
+
+ List<ClosedPeriodicEntryBook> result = findAll(query, args);
+
+ return result;
+ }
+
+}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java (from rev 3808, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractEntryTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,323 @@
+/*
+ * #%L
+ * Lima callao
+ * *
+ * $Id: EntryDAOImpl.java 3783 2014-05-06 16:47:18Z dcosse $
+ * $HeadURL: http://svn.chorem.org/lima/trunk/lima-callao/src/main/java/org/chorem/lima/… $
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import com.google.common.collect.Maps;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.beans.LetteringFilter;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+public class EntryTopiaDao extends AbstractEntryTopiaDao<Entry> {
+
+ private static final Log log = LogFactory.getLog(EntryTopiaDao.class);
+
+ /**
+ * Requete generique qui recupere les entrees equilibrées portant entre
+ * deux dates.
+ *
+ * @param beginDate begin date
+ * @param endDate end date
+ */
+ protected String getEquilibredTransactionQuery(Date beginDate, Date endDate) {
+ String query = "FROM " + Entry.class.getName() + " E" +
+ // equlibrée (somme des débit = somme des crédit)
+ " WHERE (select sum(E2.amount) from " + Entry.class.getName() + " E2 where E2.debit = false and E2.financialTransaction = E.financialTransaction) = " +
+ "(select sum(E2.amount) from " + Entry.class.getName() + " E2 where E2.debit = true and E2.financialTransaction = E.financialTransaction)" +
+ // entre les 2 dates
+ " AND :beginDate <= E.financialTransaction.transactionDate" +
+ " AND E.financialTransaction.transactionDate <= :endDate";
+ return query;
+ }
+
+ /**
+ * Query for find entries for accountsreports and balancereports
+ * Just exact and balanced transaction are calculated.
+ *
+ * @param account account
+ * @param beginDate begin date
+ * @param endDate end date
+ * @return entries
+ */
+ public List<Entry> findAllEntryOfBalancedTransaction(Account account,
+ Date beginDate, Date endDate) {
+
+ String query = getEquilibredTransactionQuery(beginDate, endDate) +
+ // concerne le compte
+ " AND E.account = :account";
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("account", account);
+
+ List<Entry> entries = findAll(query, args);
+
+ return entries;
+ }
+
+ /**
+ * Retourne la somme des entrées des transaction equilibrées entre
+ * deux dates pour un compte donné.
+ *
+ * @param account account
+ * @param beginDate bebin date
+ * @param endDate end date
+ * @return list boolean,int (une ligne pour le debit true, une ligne pour le credit)
+ */
+ public List<Object[]> getDebitCreditOfBalancedTransaction(Account account,
+ Date beginDate, Date endDate) {
+ String query = "SELECT E.debit, sum(E.amount) " +
+ getEquilibredTransactionQuery(beginDate, endDate) +
+ // concerne le compte
+ " AND E.account = :account" +
+ " GROUP BY E.debit";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("account", account);
+
+ List<Object[]> result = findAll(query, args);
+ return result;
+ }
+
+ /**
+ * Retourne les entrees des transaction equlibrées entre deux dates pour
+ * un journal.
+ *
+ * @param entryBook entry book
+ * @param beginDate begin date
+ * @param endDate end date
+ */
+ public List<Entry> findAllEntryOfBalancedTransaction(EntryBook entryBook, Date beginDate,
+ Date endDate) {
+ String query = getEquilibredTransactionQuery(beginDate, endDate) +
+ // concerne le journal
+ " AND E.financialTransaction.entryBook = :entryBook" +
+ // fix order
+ " ORDER BY E.financialTransaction.transactionDate, E.financialTransaction.topiaId";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+
+ List<Entry> entries = findAll(query, args);
+ return entries;
+ }
+
+ public List<String> findLetters() {
+ String query = "Select distinct E.lettering FROM " + Entry.class.getName() + " E" +
+ " where E.lettering <> null" +
+ " order by E.lettering desc";
+
+ List<String> result = new ArrayList<String>(this.<String>findAll(query));
+
+ if (log.isDebugEnabled()) {
+ log.debug("Size of result : " + result.size());
+ }
+
+ return result;
+ }
+
+ /**
+ * Retourne la somme des entrées des transaction equilibrées entre
+ * deux dates pour un journal donné.
+ *
+ * @param entryBook entry book
+ * @param beginDate bebin date
+ * @param endDate end date
+ * @return list boolean,int (une ligne pour le debit true, une ligne pour le credit)
+ */
+ public List<Object[]> getDebitCreditOfBalancedTransaction(EntryBook entryBook,
+ Date beginDate, Date endDate) {
+ String query = "SELECT E.debit, sum(E.amount) " +
+ getEquilibredTransactionQuery(beginDate, endDate) +
+ // concerne le journal
+ " AND E.financialTransaction.entryBook = :entryBook" +
+ " GROUP BY E.debit";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+
+ List<Object[]> result = findAll(query, args);
+ return result;
+ }
+
+ /**
+ * Retourne les entrees des transaction entre deux dates pour
+ * un journal.
+ *
+ * @param entryBook entry book
+ * @param beginDate begin date
+ * @param endDate end date
+ */
+ public List<Entry> findAllEntryByDateForEntryBook(EntryBook entryBook, Date beginDate,
+ Date endDate) {
+ String query = "FROM " + Entry.class.getName() + " E" +
+ // entre les 2 dates
+ " WHERE :beginDate <= E.financialTransaction.transactionDate" +
+ " AND E.financialTransaction.transactionDate <= :endDate" +
+ // concerne le journal
+ " AND E.financialTransaction.entryBook = :entryBook";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+
+ List<Entry> entries = findAll(query, args);
+ return entries;
+ }
+
+ /**
+ * Retourne toutes les entrées d'une transaction
+ * pour un compte et la présence d'un lettrage ou (xor) non
+ * @param filter filtre sur les entrees, selon le compte, les dates de debut et de fin, et le lettrage
+ * */
+ public List<Entry> findAllEntryByFilter(LetteringFilter filter) {
+
+ List<Entry> entries;
+ Account account = filter.getAccount();
+
+ if (account != null && account.getTopiaId() == null) {
+ // case user want to see all accounts
+ entries = getAllEntryByLetteringAndDateForEntryBook(filter);
+ } else {
+ entries = getAllEntryByAccountLetteringAndDateForEntryBook(filter);
+ }
+ return entries;
+ }
+
+ public List<Entry> getAllEntryByAccountLetteringAndDateForEntryBook(LetteringFilter filter) {
+ List<Entry> entries;
+
+ String query = "Select E from " + Entry.class.getName() + " E " +
+ " where E.account.accountNumber like :account ";
+
+
+ if (!filter.getDisplayLettered() && filter.getDisplayUnlettred()){
+ query += " and (E.lettering is null or E.lettering = '') ";
+ } else if (filter.getDisplayLettered() && !filter.getDisplayUnlettred()){
+ query += " and (E.lettering is not null or E.lettering !='') ";
+ }
+
+ query += " and E.financialTransaction.transactionDate between :beginDate and :endDate " +
+ " order by E.financialTransaction.transactionDate, E.financialTransaction." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", filter.getDateStart());
+ args.put("endDate", filter.getDateEnd());
+ args.put("account", filter.getAccount().getAccountNumber() + "%");
+ entries = findAll(query, args);
+
+ return entries;
+ }
+
+ public List<Entry> getAllEntryByLetteringAndDateForEntryBook(LetteringFilter filter) {
+ List<Entry> entries;
+
+ String query = "Select E from " + Entry.class.getName() + " E ";
+
+ query += " WHERE E.financialTransaction.transactionDate BETWEEN :beginDate and :endDate ";
+
+ if (!filter.getDisplayLettered() && filter.getDisplayUnlettred()){
+ query += " and (E.lettering is null or E.lettering = '') ";
+ } else if (filter.getDisplayLettered() && !filter.getDisplayUnlettred()){
+ query += " and (E.lettering is not null or E.lettering !='') ";
+ }
+
+ query += " order by E.financialTransaction.transactionDate, E.financialTransaction." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", filter.getDateStart());
+ args.put("endDate", filter.getDateEnd());
+
+ entries = findAll(query, args);
+
+ return entries;
+ }
+
+
+ /**
+ * Retourne la dernière entrée d'une transaction
+ * @param financialTransaction transaction sur laquelle la derniere entree est selectionnee
+ * */
+ public Entry getLastEntry(FinancialTransaction financialTransaction) {
+ List<Entry> entries;
+ Entry lastEntry = null;
+ String query = "Select E from " + Entry.class.getName() + " E" +
+ " where E.financialTransaction.transactionDate = :financialTransactionDate " +
+ " and E.financialTransaction = :financialTransaction" +
+ " order by E.topiaCreateDate desc";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("financialTransactionDate", financialTransaction.getTransactionDate());
+ args.put("financialTransaction", financialTransaction);
+
+ entries = findAll(query, args);
+ if (entries.size() > 0) {
+ lastEntry = entries.get(0);
+ }
+
+ return lastEntry;
+ }
+
+ /**
+ * Retourne la somme des entrées des transaction entre
+ * deux dates pour un journal donné.
+ *
+ * @param entryBook entry book
+ * @param beginDate bebin date
+ * @param endDate end date
+ * @return list boolean,int (une ligne pour le debit true, une ligne pour le credit)
+ */
+ public List<Object[]> getDebitCreditOfTransaction(EntryBook entryBook,
+ Date beginDate, Date endDate) {
+ String query = "SELECT E.debit, sum(E.amount) " +
+ "FROM " + Entry.class.getName() + " E" +
+ // entre les 2 dates
+ " WHERE :beginDate <= E.financialTransaction.transactionDate" +
+ " AND E.financialTransaction.transactionDate <= :endDate" +
+ // concerne le journal
+ " AND E.financialTransaction.entryBook = :entryBook" +
+ " GROUP BY E.debit";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+
+ List<Object[]> result = findAll(query, args);
+ return result;
+ }
+}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java (from rev 3808, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialPeriodTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,112 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id: FinancialPeriodDAOImpl.java 3476 2012-06-26 15:48:13Z echatellier $
+ * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+import org.nuiton.topia.persistence.TopiaException;
+
+public class FinancialPeriodTopiaDao extends AbstractFinancialPeriodTopiaDao<FinancialPeriod> {
+
+ /**
+ * Return FinancialPeriod by Date.
+ * Date is include between financialperiod begin and end date.
+ *
+ * @param date period middle date
+ * @return FinancialPeriod for {@code date}
+ * @throws TopiaException
+ */
+ public FinancialPeriod findByDate(Date date) throws TopiaException {
+
+ String query = "FROM " + FinancialPeriod.class.getName() +
+ " WHERE beginDate <= :date" +
+ " AND :date <= endDate";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("date", date);
+ // add unique result here
+ FinancialPeriod financialPeriod = (FinancialPeriod)findUnique(query, args);
+ return financialPeriod;
+ }
+
+ /**
+ * Return all FinancialPeriod with begin date between two given dates.
+ *
+ * @param beginDate period begin date
+ * @param endDate period end date
+ * @return FinancialPeriod for {@code date}
+ * @throws TopiaException
+ */
+ public List<FinancialPeriod> findByDates(Date beginDate, Date endDate) throws TopiaException {
+
+ String query = "FROM " + FinancialPeriod.class.getName() +
+ " WHERE :beginDate <= beginDate" +
+ " AND beginDate <= :endDate" +
+ " ORDER by beginDate";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate", beginDate);
+ args.put("endDate", endDate);
+ // add unique result here
+ List<FinancialPeriod> financialPeriod = findAll(query, args);
+ return financialPeriod;
+ }
+
+ /**
+ * Retourne toutes les periodes ordonnées par date de debut de periode.
+ *
+ * @return all period ordered
+ * @throws TopiaException
+ */
+ public List<FinancialPeriod> findAllOrderByBeginDate() throws TopiaException {
+ String query = "FROM " + FinancialPeriod.class.getName() +
+ " ORDER BY beginDate";
+
+ // add unique result here
+ List<FinancialPeriod> financialPeriod = findAll(query);
+ return financialPeriod;
+ }
+
+ /**
+ * Retourne toutes les periodes ordonnées par date de debut de periode.
+ *
+ * @return all period ordered
+ * @throws TopiaException
+ */
+ public List<FinancialPeriod> findAllUnlockedOrderByBeginDate() throws TopiaException {
+ String query = "FROM " + FinancialPeriod.class.getName() +
+ " WHERE locked = false" +
+ " ORDER BY beginDate";
+
+ // add unique result here
+ List<FinancialPeriod> financialPeriod = findAll(query);
+ return financialPeriod;
+ }
+
+}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java (from rev 3808, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,79 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id: FinancialStatementDAOImpl.java 3585 2012-08-08 14:52:14Z tchemit $
+ * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import com.google.common.collect.Maps;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Ajout de requetes specifiques aux {@link FinancialStatement} sur le DAO.
+ *
+ * @author chatellier
+ * @version $Revision: 3585 $
+ *
+ * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
+ * By : $Author: tchemit $
+ */
+public class FinancialStatementTopiaDao extends AbstractFinancialStatementTopiaDao<FinancialStatement> {
+
+ /**
+ * Find all {@code FinancialStatement} ordered by topia create date.
+ */
+ public List<FinancialStatement> findAllOrderedByCreateDate() {
+ String query = "FROM " + FinancialStatement.class.getName() +
+ " ORDER BY " + FinancialStatement.PROPERTY_TOPIA_CREATE_DATE;
+ List<FinancialStatement> result = findAll(query);
+ return result;
+ }
+
+ /**
+ * Find all {@code FinancialStatement} ordered by topia create date.
+ */
+ public List<FinancialStatement> findChildrenFinancialStatement(FinancialStatement financialStatement) {
+ String query = "FROM " + FinancialStatement.class.getName();
+
+ if (financialStatement == null) {
+ query += " WHERE masterFinancialStatement = null";
+ } else {
+ query += " WHERE masterFinancialStatement = :masterFinancialStatement";
+ }
+ query += " ORDER BY " + FinancialStatement.PROPERTY_TOPIA_CREATE_DATE;
+
+ List<FinancialStatement> result;
+ if (financialStatement == null) {
+ result = findAll(query);
+ } else {
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("masterFinancialStatement", financialStatement);
+ result = findAll(query, args);
+ }
+ return result;
+ }
+
+} //FinancialStatementDAO
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java (from rev 3808, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialTransactionTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,326 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id: FinancialTransactionDAOImpl.java 3688 2013-06-27 13:12:22Z Bavencoff $
+ * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import com.google.common.collect.Maps;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.Filter.Filter;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Ajout de requetes specifiques aux financial transaction sur le DAO.
+ *
+ * @author chatellier
+ * @version $Revision: 3688 $
+ *
+ * Last update : $Date: 2013-06-27 15:12:22 +0200 (jeu. 27 juin 2013) $
+ * By : $Author: Bavencoff $
+ */
+public class FinancialTransactionTopiaDao extends AbstractFinancialTransactionTopiaDao<FinancialTransaction> {
+
+ private static final Log log = LogFactory.getLog(FinancialTransactionTopiaDao.class);
+
+ /**
+ * FIXME echatellier, remove this method when implemented in topia
+ * just overriden to use merge() instead of saveOrUpdate()
+ */
+ public FinancialTransaction merge(FinancialTransaction e) {
+// try {
+// e = (FinancialTransaction) getContext().getHibernate().merge(e);
+// getContext().getFiresSupport().warnOnUpdateEntity(e);
+// return e;
+// } catch (HibernateException ex) {
+// throw new TopiaException(ex);
+// }
+ // TODO DCossé 15/05/14 find a way to get hibernate
+ return null;
+ }
+
+ /**
+ * Return how many transaction are found with specified entryBook.
+ *
+ * @param entryBook entry book
+ * @return transaction referencing entry book
+ */
+ public long getCountByEntryBook(EntryBook entryBook) {
+ String query = "SELECT count(*) FROM " + FinancialTransaction.class.getName() + " t WHERE t.entryBook = :entryBook";
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("entryBook", entryBook);
+ Number count = (Number)findAll(query, args).get(0);
+ return count.longValue();
+ }
+
+ /**
+ * Find all transactions between two dates.
+ *
+ * @param beginDate begin date
+ * @param endDate end date
+ * @return unbalanced transactions
+ */
+ public List<FinancialTransaction> findAllByDates(Date beginDate, Date endDate) {
+ String query = "FROM " + FinancialTransaction.class.getName() + " T"+
+ " WHERE :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate" +
+ " ORDER BY T.transactionDate, T." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate",beginDate);
+ args.put("endDate", endDate);
+ List<FinancialTransaction> result = findAll(query,args);
+ return result;
+ }
+
+ /**
+ * Find all transactions between two dates in an entry book.
+ *
+ * @param beginDate begin date
+ * @param endDate end date
+ * @param entryBook entry book
+ * @return unbalanced transactions
+ */
+ public List<FinancialTransaction> findAllByDates(Date beginDate, Date endDate, EntryBook entryBook) {
+ String query = "FROM " + FinancialTransaction.class.getName() + " T"+
+ " WHERE :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate" +
+ " AND T.entryBook = :entryBook" +
+ " ORDER BY T.transactionDate, T." + FinancialTransaction.PROPERTY_TOPIA_CREATE_DATE;
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate",beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+ List<FinancialTransaction> result = findAll(query, args);
+ return result;
+ }
+
+ /**
+ * Find all unbalanced transactions.
+ *
+ * @param beginDate beginDate
+ * @param endDate endDate
+ * @param entryBook entry book (can be null)
+ * @return unbalanced transactions
+ */
+ public List<FinancialTransaction> getAllUnbalancedTransaction(Date beginDate, Date endDate,
+ EntryBook entryBook) {
+ String query = "FROM " + FinancialTransaction.class.getName() + " T"+
+ " WHERE (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = true AND financialTransaction = T) != " +
+ " (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = false AND financialTransaction = T)" +
+ " AND :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate";
+ List<FinancialTransaction> result;
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate",beginDate);
+ args.put("endDate", endDate);
+ if (entryBook != null) {
+ args.put("entryBook", entryBook);
+ query += " AND T.entryBook = :entryBook";
+ result = findAll(query, args);
+ } else {
+ result = findAll(query, args);
+ }
+
+ return result;
+ }
+
+ /**
+ * Find all unbalanced transactions.
+ *
+ * @param beginDate beginDate
+ * @param endDate endDate
+ * @param entryBook entry book (can be null)
+ * @return unbalanced transactions
+ */
+ public List<FinancialTransaction> getAllBalancedTransaction(Date beginDate, Date endDate,
+ EntryBook entryBook) {
+ String query = "FROM " + FinancialTransaction.class.getName() + " T"+
+ " WHERE (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = true AND financialTransaction = T) = " +
+ " (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = false AND financialTransaction = T)" +
+ " AND :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate";
+ List<FinancialTransaction> result;
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate",beginDate);
+ args.put("endDate", endDate);
+
+ if (entryBook != null) {
+ args.put("entryBook", entryBook);
+ query += " AND T.entryBook = :entryBook";
+ result = findAll(query, args);
+ } else {
+ result = findAll(query, args);
+ }
+
+ return result;
+ }
+
+ /**
+ * Find all unbalanced transactions.
+ *
+ * @param beginDate beginDate
+ * @param endDate endDate
+ * @param entryBook entry book (can be null)
+ * @return unbalanced transactions
+ */
+ public List<FinancialTransaction> getAllIncorrectTransaction(Date beginDate, Date endDate,
+ EntryBook entryBook) {
+ String query = "SELECT distinct T FROM " + FinancialTransaction.class.getName() + " T"+
+ " LEFT JOIN T.entry AS E" +
+ " WHERE ((SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = true AND financialTransaction = T) != " +
+ " (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = false AND financialTransaction = T)" +
+ " OR (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = true AND financialTransaction = T) IS NULL" +
+ " OR (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = false AND financialTransaction = T) IS NULL" +
+ " OR E.account = null" +
+ " OR E.voucher = null" +
+ " OR E.voucher = ''" +
+ " OR E.description = null" +
+ " OR E.description = '')" +
+ " AND :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate";
+ List<FinancialTransaction> result;
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate",beginDate);
+ args.put("endDate", endDate);
+ if (entryBook != null) {
+ args.put("entryBook", entryBook);
+ query += " AND T.entryBook = :entryBook";
+ result = findAll(query, args);
+ } else {
+ result = findAll(query, args);
+ }
+
+ return result;
+ }
+
+ /**
+ * Find all transaction where some field are not filled in.
+ *
+ * @param beginDate begin date
+ * @param endDate end date
+ * @param entryBook entry book
+ * @return unfilled transaction
+ */
+ public List<FinancialTransaction> getAllUnfilledTransaction(Date beginDate,
+ Date endDate, EntryBook entryBook) {
+ String query = "SELECT T FROM " + FinancialTransaction.class.getName() + " T"+
+ " LEFT JOIN T.entry AS E" +
+ " WHERE ((SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = true AND financialTransaction = T) != " +
+ " (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = false AND financialTransaction = T) OR E.account = null" +
+ " OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = '')" +
+ " AND T.entryBook = :entryBook" +
+ " AND :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate",beginDate);
+ args.put("endDate", endDate);
+ args.put("entryBook", entryBook);
+ List<FinancialTransaction> result = findAll(query, args);
+ return result;
+ }
+
+ /**
+ * Find all transaction without entry book.
+ *
+ * @param beginDate begin date
+ * @param endDate end date
+ * @return transaction without entry books
+ */
+ public List<FinancialTransaction> getAllTransactionWithoutEntryBook(Date beginDate,
+ Date endDate) {
+
+ String query = "SELECT T FROM " + FinancialTransaction.class.getName() + " T"+
+ " LEFT JOIN T.entry AS E" +
+ " WHERE ((SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = true AND financialTransaction = T) != " +
+ " (SELECT sum(amount) FROM " + Entry.class.getName() +
+ " WHERE debit = false AND financialTransaction = T) OR E.account = null" +
+ " OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = '')" +
+ " AND entryBook = null" +
+ " AND :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate";
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("beginDate",beginDate);
+ args.put("endDate", endDate);
+
+ List<FinancialTransaction> result = findAll(query, args);
+
+ return result;
+ }
+
+ /**
+ * Search financial transaction.
+ *
+ *
+ * @param filter filter parameters
+ * @return financial transaction
+ */
+ public List<FinancialTransaction> searchFinancialTransaction(Filter filter) {
+
+ GeneratorHQuery generator = new GeneratorHQuery();
+ filter.accept(generator);
+
+
+ String query = generator.getHQuery();
+ Map<String,Object> arguments = generator.getParameters();
+
+ if (log.isDebugEnabled()) {
+ Set<String> parameters = arguments.keySet();
+ for(String param : parameters) {
+ log.debug("Query : \n" + query + "\nArguments: " + param);
+ }
+ }
+
+ // perform query
+ List<FinancialTransaction> result;
+ if (arguments.isEmpty()) {
+ result = findAll(query);
+ } else {
+ result = findAll(query, arguments);
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Number of founded transactions : " + result.size());
+ }
+
+ return result;
+ }
+
+} //FinancialTransactionDAO
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java (from rev 3808, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFiscalPeriodTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,140 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id: FiscalPeriodDAOImpl.java 3598 2012-08-10 16:31:26Z mallon $
+ * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+import org.hibernate.HibernateException;
+import org.nuiton.topia.persistence.TopiaException;
+
+/**
+ * Fiscal period entity DAO.
+ *
+ * @author chatellier
+ * @version $Revision: 3598 $
+ *
+ * Last update : $Date: 2012-08-10 18:31:26 +0200 (ven. 10 août 2012) $
+ * By : $Author: mallon $
+ */
+public class FiscalPeriodTopiaDao extends AbstractFiscalPeriodTopiaDao<FiscalPeriod> {
+
+ /**
+ * FIXME echatellier, remove this method when implemented in topia
+ * just overriden to use merge() instead of saveOrUpdate()
+ */
+ @Override
+ public FiscalPeriod update(FiscalPeriod e) throws TopiaException {
+ try {
+// getContext().getHibernate().merge(e);
+// getContext().getFiresSupport().warnOnUpdateEntity(e);
+// return e;
+ // TODO DCossé 15/05/14 find a way to do it
+ return null;
+ } catch (HibernateException ex) {
+ throw new TopiaException(ex);
+ }
+ }
+
+ /**
+ * Find fiscal period by financial period.
+ *
+ * @param financialPeriod financial period
+ * @return fiscal period containing financial period
+ * @throws TopiaException
+ */
+ public FiscalPeriod findByFinancialPeriod(FinancialPeriod financialPeriod) throws TopiaException {
+ String query = "FROM " + FiscalPeriod.class.getName() +
+ " WHERE :financialPeriod in elements(financialPeriod)";
+
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("financialPeriod", financialPeriod);
+
+ List<FiscalPeriod> fiscalPeriods = findAll(query, args);
+ FiscalPeriod result = null;
+ if (!fiscalPeriods.isEmpty()) {
+ result = fiscalPeriods.get(0);
+ }
+ return result;
+ }
+
+ /**
+ * Get last fiscal period (higher end date).
+ *
+ * @return last fiscal period
+ * @throws TopiaException
+ */
+ public FiscalPeriod getLastFiscalPeriod() throws TopiaException {
+ String query = "FROM " + FiscalPeriod.class.getName() +
+ " ORDER BY endDate desc";
+
+ List<FiscalPeriod> fiscalPeriods = findAll(query);
+ FiscalPeriod result = null;
+ if (!fiscalPeriods.isEmpty()) {
+ result = fiscalPeriods.get(0);
+ }
+
+ return result;
+ }
+
+ /**
+ * Get first fiscal period (higher end date).
+ *
+ * @return last fiscal period
+ * @throws TopiaException
+ */
+ public FiscalPeriod getFirstFiscalPeriod() throws TopiaException {
+ String query = "FROM " + FiscalPeriod.class.getName() +
+ " ORDER BY endDate";
+
+ List<FiscalPeriod> fiscalPeriods = findAll(query);
+ FiscalPeriod result = null;
+ if (!fiscalPeriods.isEmpty()) {
+ result = fiscalPeriods.get(0);
+ }
+ return result;
+ }
+
+ /**
+ * Get last non locked fiscal period (higher end date).
+ *
+ * @return last fiscal period
+ * @throws TopiaException
+ */
+ public FiscalPeriod getLastUnlockedFiscalPeriod() throws TopiaException {
+ String query = "FROM " + FiscalPeriod.class.getName() +
+ " WHERE locked = false" +
+ " ORDER BY endDate desc";
+
+ List<FiscalPeriod> fiscalPeriods = findAll(query);
+ FiscalPeriod result = null;
+ if (!fiscalPeriods.isEmpty()) {
+ result = fiscalPeriods.get(0);
+ }
+ return result;
+ }
+}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java (from rev 3808, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java 2014-05-16 15:54:31 UTC (rev 3810)
@@ -0,0 +1,103 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id: VatStatementDAOImpl.java 3585 2012-08-08 14:52:14Z tchemit $
+ * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import com.google.common.collect.Maps;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Ajout de requetes specifiques aux {@code VatStatement} sur le DAO.
+ *
+ * @author chatellier
+ * @version $Revision: 3585 $
+ *
+ * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
+ * By : $Author: tchemit $
+ */
+public class VatStatementTopiaDao extends AbstractVatStatementTopiaDao<VatStatement> {
+
+ /**
+ * Find all {@code VatStatement} ordered by topia create date.
+ */
+ public List<VatStatement> findAllOrderedByCreateDate() {
+ String query = "FROM " + VatStatement.class.getName() +
+ " ORDER BY " + VatStatement.PROPERTY_TOPIA_CREATE_DATE;
+ List<VatStatement> result = findAll(query);
+ return result;
+ }
+
+ /**
+ * Get masterVatStatement children statement.
+ *
+ * @param masterVatStatement master VatStatement
+ * @return children VatStatement
+ */
+ public List<VatStatement> getChildrenVatStatement(VatStatement masterVatStatement) {
+ String query = "FROM " + VatStatement.class.getName();
+
+ if (masterVatStatement == null) {
+ query += " WHERE masterVatStatement = null";
+ } else {
+ query += " WHERE masterVatStatement = :masterVatStatement";
+ }
+
+ query += " ORDER BY " + VatStatement.PROPERTY_TOPIA_CREATE_DATE;
+ List<VatStatement> result;
+ if (masterVatStatement == null) {
+ result = findAll(query);
+ } else {
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("masterVatStatement", masterVatStatement);
+ result = findAll(query, args);
+ }
+ return result;
+ }
+
+ /**
+ * Recherche un statement par equivalence de label.
+ *
+ * TODO voir a quoi ca sert vraiment.
+ *
+ * @param label label
+ * @return statement like label
+ */
+ public VatStatement findVatStatementByLabel(String label) {
+ String query = "FROM " + VatStatement.class.getName() +
+ " WHERE label LIKE :label";
+ Map<String, Object> args = Maps.newLinkedHashMap();
+ args.put("label", "%" + label + "%");
+ List<VatStatement> statements = findAll(query, args);
+ VatStatement result = null;
+ if (!statements.isEmpty()) {
+ result = statements.get(0);
+ }
+ return result;
+ }
+
+} //VatStatementDAO
1
0
r3809 - in trunk: lima-business/src/test/java/org/chorem/lima/business/accountingrules lima-callao/src/main/java/org/chorem/lima/entity
by athimel@users.chorem.org 16 May '14
by athimel@users.chorem.org 16 May '14
16 May '14
Author: athimel
Date: 2014-05-16 17:47:37 +0200 (Fri, 16 May 2014)
New Revision: 3809
Url: http://forge.chorem.org/projects/lima/repository/revisions/3809
Log:
refs #934 Green bar !
Modified:
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java 2014-05-16 15:26:11 UTC (rev 3808)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java 2014-05-16 15:47:37 UTC (rev 3809)
@@ -29,6 +29,7 @@
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@@ -48,8 +49,8 @@
*/
public class AccountServiceRuleFrTest extends AccountServiceImplTest {
- @BeforeClass
- public static void installFrenchRule() throws Exception {
+ @Before
+ public void installFrenchRule() throws Exception {
LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName());
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java 2014-05-16 15:26:11 UTC (rev 3808)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java 2014-05-16 15:47:37 UTC (rev 3809)
@@ -26,6 +26,7 @@
import org.chorem.lima.business.EntryBookServiceImplTest;
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -44,8 +45,8 @@
*/
public class EntryBookServiceRuleFrTest extends EntryBookServiceImplTest {
- @BeforeClass
- public static void installFrenchRule() throws Exception {
+ @Before
+ public void installFrenchRule() throws Exception {
LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName());
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java 2014-05-16 15:26:11 UTC (rev 3808)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java 2014-05-16 15:47:37 UTC (rev 3809)
@@ -26,6 +26,7 @@
import org.chorem.lima.business.EntryBookServiceImplTest;
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -44,8 +45,8 @@
*/
public class FinancialPeriodServiceRuleFrTest extends EntryBookServiceImplTest {
- @BeforeClass
- public static void installFrenchRule() throws Exception {
+ @Before
+ public void installFrenchRule() throws Exception {
LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName());
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java 2014-05-16 15:26:11 UTC (rev 3808)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java 2014-05-16 15:47:37 UTC (rev 3809)
@@ -26,6 +26,7 @@
import org.chorem.lima.business.FinancialTransactionServiceImplTest;
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -44,8 +45,8 @@
*/
public class FinancialTransactionServiceRuleFrTest extends FinancialTransactionServiceImplTest {
- @BeforeClass
- public static void installFrenchRule() throws Exception {
+ @Before
+ public void installFrenchRule() throws Exception {
LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName());
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java 2014-05-16 15:26:11 UTC (rev 3808)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java 2014-05-16 15:47:37 UTC (rev 3809)
@@ -26,6 +26,7 @@
import org.chorem.lima.business.FiscalPeriodServiceImplTest;
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -44,8 +45,8 @@
*/
public class FiscalPeriodServiceRuleFrTest extends FiscalPeriodServiceImplTest {
- @BeforeClass
- public static void installFrenchRule() throws Exception {
+ @Before
+ public void installFrenchRule() throws Exception {
LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName());
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java 2014-05-16 15:26:11 UTC (rev 3808)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java 2014-05-16 15:47:37 UTC (rev 3809)
@@ -26,6 +26,7 @@
import org.chorem.lima.business.ImportServiceImplTest;
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -44,8 +45,8 @@
*/
public class ImportServiceRuleFrTest extends ImportServiceImplTest {
- @BeforeClass
- public static void installFrenchRule() throws Exception {
+ @Before
+ public void installFrenchRule() throws Exception {
LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName());
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java 2014-05-16 15:26:11 UTC (rev 3808)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractClosedPeriodicEntryBookTopiaDao.java 2014-05-16 15:47:37 UTC (rev 3809)
@@ -53,13 +53,13 @@
/**
* Find all ClosedPeriodicEntryBook with common EntryBook.
- *
+ *
* @param entryBook entry book property
* @return ClosedPeriodicEntryBook list
- * @throws TopiaException
+ * @throws TopiaException
*/
public List<ClosedPeriodicEntryBook> findAllByEntryBook(EntryBook entryBook) throws TopiaException {
- return findAllByEntryBook(entryBook);
+ return (List<ClosedPeriodicEntryBook>) forProperties(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, entryBook).findAll();
}
/**
1
0
r3808 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/test/java/org/chorem/lima/business lima-business-api/src/main/java/org/chorem/lima/business/api lima-callao/src/main/java/org/chorem/lima/entity
by athimel@users.chorem.org 16 May '14
by athimel@users.chorem.org 16 May '14
16 May '14
Author: athimel
Date: 2014-05-16 17:26:11 +0200 (Fri, 16 May 2014)
New Revision: 3808
Url: http://forge.chorem.org/projects/lima/repository/revisions/3808
Log:
Fix some of the tests
Removed:
trunk/lima-business/src/test/java/org/chorem/lima/business/utils/
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.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/FiscalPeriodServiceImpl.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java
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 2014-05-16 15:07:42 UTC (rev 3807)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2014-05-16 15:26:11 UTC (rev 3808)
@@ -58,52 +58,6 @@
@TransactionAttribute
public class FinancialPeriodServiceImpl extends AbstractLimaService implements FinancialPeriodService {
- /**
- * Création d'une période timeSpan mensuelle avec une date de début et de fin. Une période
- * peut être bloquée ou non
- */
- @Override
- public List<FinancialPeriod> createFinancialPeriods(Collection<FinancialPeriod> financialPeriods) throws LimaException {
-
- List<FinancialPeriod> result = new ArrayList<FinancialPeriod>();
-
- try {
-
- FinancialPeriodTopiaDao financialPeriodTopiaDao =
- getDaoHelper().getFinancialPeriodDao();
- ClosedPeriodicEntryBookTopiaDao closedPeriodicEntryBookTopiaDao =
- getDaoHelper().getClosedPeriodicEntryBookDao();
- EntryBookTopiaDao entryBookTopiaDao =
- getDaoHelper().getEntryBookDao();
- //create all financial period
- for (FinancialPeriod financialPeriod : financialPeriods) {
-
- //create financial period
- financialPeriod = financialPeriodTopiaDao.create(financialPeriod);
-
- //create ClosedPeriodicEntryBook for all entrybook
- for (EntryBook entryBook : entryBookTopiaDao.findAll()) {
- //new closed periodic entrybook
- ClosedPeriodicEntryBook closedPeriodicEntryBook
- = new ClosedPeriodicEntryBookImpl();
- // set entrybook
- closedPeriodicEntryBook.setEntryBook(entryBook);
- // set financial period
- closedPeriodicEntryBook.setFinancialPeriod(financialPeriod);
- // create it
- closedPeriodicEntryBookTopiaDao.create(closedPeriodicEntryBook);
- }
-
- result.add(financialPeriod);
- }
-
- } catch (TopiaException ex) {
- throw new LimaException("Can't create period", ex);
- }
-
- return result;
- }
-
/** @return all financial period */
@Override
public List<FinancialPeriod> getAllFinancialPeriods() throws LimaException {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-05-16 15:07:42 UTC (rev 3807)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-05-16 15:26:11 UTC (rev 3808)
@@ -42,11 +42,14 @@
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryBookTopiaDao;
import org.chorem.lima.entity.EntryImpl;
import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FinancialPeriodTopiaDao;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.entity.FiscalPeriod;
@@ -100,9 +103,11 @@
FiscalPeriod result;
try {
+ FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
+ ClosedPeriodicEntryBookTopiaDao closedPeriodicEntryBookTopiaDao = getDaoHelper().getClosedPeriodicEntryBookDao();
+ EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao();
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
- FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
// fix begin date at midnight and end date at 23:59:59.999
Date beginDate = fiscalPeriod.getBeginDate();
@@ -117,19 +122,27 @@
//check rules before create the account
List<FinancialPeriod> financialPeriods = accountingRules.createFiscalPeriodRules(fiscalPeriod);
- // FIXME echatellier 20120510 il y a un gros problème ici
- // les periods sont instanciées par la rule
- // mais crée ensuite par le service et la periodes
- // est créée au final avec des entités qui n'ont pas les id affectés
- financialPeriods = financialPeriodService.createFinancialPeriods(financialPeriods);
-
// create
+ fiscalPeriod.addAllFinancialPeriod(financialPeriods);
result = fiscalPeriodTopiaDao.create(fiscalPeriod);
- result.addAllFinancialPeriod(financialPeriods);
- // udpate
- result = fiscalPeriodTopiaDao.update(result);
+ //create all financial period
+ for (FinancialPeriod financialPeriod : financialPeriods) {
+ //create ClosedPeriodicEntryBook for all entrybook
+ for (EntryBook entryBook : entryBookTopiaDao.findAll()) {
+ //new closed periodic entrybook
+ ClosedPeriodicEntryBook closedPeriodicEntryBook
+ = new ClosedPeriodicEntryBookImpl();
+ // set entrybook
+ closedPeriodicEntryBook.setEntryBook(entryBook);
+ // set financial period
+ closedPeriodicEntryBook.setFinancialPeriod(financialPeriod);
+ // create it
+ closedPeriodicEntryBookTopiaDao.create(closedPeriodicEntryBook);
+ }
+ }
+
} catch (TopiaException ex) {
throw new LimaException("Can't create period", ex);
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-05-16 15:07:42 UTC (rev 3807)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-05-16 15:26:11 UTC (rev 3808)
@@ -31,6 +31,7 @@
import java.text.ParseException;
import java.util.Locale;
import java.util.Properties;
+import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -59,7 +60,7 @@
import org.chorem.lima.entity.LimaCallaoTopiaApplicationContext;
import org.chorem.lima.service.LimaServiceFactory;
import org.junit.After;
-import org.junit.BeforeClass;
+import org.junit.Before;
import org.nuiton.i18n.I18n;
import org.nuiton.i18n.init.ClassPathI18nInitializer;
import org.nuiton.topia.persistence.TopiaApplicationContextCache;
@@ -87,13 +88,13 @@
protected static DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.ENGLISH);
- protected static AccountService accountService;
- protected static EntryBookService entryBookService;
- protected static FinancialPeriodService financialPeriodService;
- protected static FinancialTransactionService financialTransactionService;
- protected static FiscalPeriodService fiscalPeriodService;
- protected static ReportService reportService;
- protected static ImportService importService;
+ protected AccountService accountService;
+ protected EntryBookService entryBookService;
+ protected FinancialPeriodService financialPeriodService;
+ protected FinancialTransactionService financialTransactionService;
+ protected FiscalPeriodService fiscalPeriodService;
+ protected ReportService reportService;
+ protected ImportService importService;
/**
* This is a before class method, but junit will fail to run inherited
@@ -101,15 +102,15 @@
*
* @throws Exception
*/
- @BeforeClass
- public static void initAbstractTest() throws Exception {
+ @Before
+ public void initAbstractTest() throws Exception {
setUpLocale();
setUpTestConfig();
setUpDefaultRule();
initServices();
}
- protected static void setUpLocale() throws Exception {
+ protected void setUpLocale() throws Exception {
I18n.init(new ClassPathI18nInitializer(), Locale.UK);
}
@@ -117,7 +118,7 @@
* Init services after i18n#init().
* @throws IOException
*/
- protected static void initServices() throws IOException {
+ protected void initServices() throws IOException {
accountService = LimaServiceFactory.getService(AccountService.class);
entryBookService = LimaServiceFactory.getService(EntryBookService.class);
financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class);
@@ -133,7 +134,7 @@
*
* @return single test config
*/
- protected static LimaConfig getTestConfiguration() {
+ protected LimaConfig getTestConfiguration() {
LimaConfig instance = new LimaConfig();
// do not call parse() method (don't read /etc...)
@@ -158,7 +159,7 @@
}
// override somes
- String testDir = System.getProperty("java.io.tmpdir") + File.separator + "limaopenejbdb";
+ String testDir = System.getProperty("java.io.tmpdir") + File.separator + "lima-business-" + UUID.randomUUID().toString();
testProperties.setProperty(Option.DATA_DIR.getKey(), testDir);
testProperties.setProperty("hibernate.connection.url", "jdbc:h2:file:" + testDir + File.separator + "data");
//testProperties.setProperty("hibernate.hbm2ddl.auto", "update");
@@ -172,7 +173,7 @@
return instance;
}
- protected static void setUpTestConfig() throws Exception {
+ protected void setUpTestConfig() throws Exception {
LimaConfig.instance = getTestConfiguration();
LimaServiceFactory.initFactory(LimaConfig.getInstance());
}
@@ -312,7 +313,7 @@
*
* @return a topia context
*/
- protected static LimaCallaoTopiaApplicationContext getTestContext() {
+ protected LimaCallaoTopiaApplicationContext getTestContext() {
LimaConfig config = LimaConfig.getInstance();
Properties options = config.getFlatOptions();
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2014-05-16 15:07:42 UTC (rev 3807)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2014-05-16 15:26:11 UTC (rev 3808)
@@ -48,8 +48,6 @@
List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException;
- List<FinancialPeriod> createFinancialPeriods(Collection<FinancialPeriod> financialPeriods) throws LimaException;
-
ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook,
FinancialPeriod financialPeriod) throws LimaException;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java 2014-05-16 15:07:42 UTC (rev 3807)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractFinancialStatementTopiaDao.java 2014-05-16 15:26:11 UTC (rev 3808)
@@ -63,7 +63,7 @@
} else {
query += " WHERE masterFinancialStatement = :masterFinancialStatement";
}
- query += " ORDER BY " + FinancialStatement.TOPIA_CREATE_DATE;
+ query += " ORDER BY " + FinancialStatement.PROPERTY_TOPIA_CREATE_DATE;
List<FinancialStatement> result;
if (financialStatement == null) {
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java 2014-05-16 15:07:42 UTC (rev 3807)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AbstractVatStatementTopiaDao.java 2014-05-16 15:26:11 UTC (rev 3808)
@@ -47,7 +47,7 @@
*/
public List<VatStatement> findAllOrderedByCreateDate() {
String query = "FROM " + VatStatement.class.getName() +
- " ORDER BY " + VatStatement.TOPIA_CREATE_DATE;
+ " ORDER BY " + VatStatement.PROPERTY_TOPIA_CREATE_DATE;
List<VatStatement> result = findAll(query);
return result;
}
@@ -67,7 +67,7 @@
query += " WHERE masterVatStatement = :masterVatStatement";
}
- query += " ORDER BY " + VatStatement.TOPIA_CREATE_DATE;
+ query += " ORDER BY " + VatStatement.PROPERTY_TOPIA_CREATE_DATE;
List<VatStatement> result;
if (masterVatStatement == null) {
result = findAll(query);
1
0
r3807 - trunk/lima-business/src/main/java/org/chorem/lima/business/migration
by dcosse@users.chorem.org 16 May '14
by dcosse@users.chorem.org 16 May '14
16 May '14
Author: dcosse
Date: 2014-05-16 17:07:42 +0200 (Fri, 16 May 2014)
New Revision: 3807
Url: http://forge.chorem.org/projects/lima/repository/revisions/3807
Log:
refs #1027 mise en place dun service de migration de la table entry pour remplacer les lettrages vides par des null
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-05-16 14:12:50 UTC (rev 3806)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-05-16 15:07:42 UTC (rev 3807)
@@ -37,6 +37,7 @@
protected static final Version VERSION_0_5 = new Version("0.5");
protected static final Version VERSION_0_6 = new Version("0.6");
+ protected static final Version VERSION_0_8 = new Version("0.8");
@Override
public Version getVersion() {
@@ -63,22 +64,12 @@
result = new MigrationV0V0_5();
} else if (version.equals(VERSION_0_6)) {
result = new MigrationV0_6();
+ } else if (version.equals(VERSION_0_8)) {
+ result = new MigrationV0_8();
}
return result;
}
-// @Override
-// public Class<? extends MigrationCallBackForVersion> getCallBack(Version version) {
-// Class<? extends MigrationCallBackForVersion> result = null;
-//
-// if (version.equals(VERSION_0_5)) {
-// result = MigrationV0V0_5.class;
-// } else if (version.equals(VERSION_0_6)) {
-// result = MigrationV0_6.class;
-// }
-// return result;
-// }
-
}
}
Copied: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java (from rev 3806, trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java)
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java 2014-05-16 15:07:42 UTC (rev 3807)
@@ -0,0 +1,44 @@
+package org.chorem.lima.business.migration;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.migration.TopiaMigrationCallbackByClass;
+import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
+import org.nuiton.topia.persistence.TopiaException;
+import org.nuiton.topia.persistence.TopiaPersistenceContext;
+import org.nuiton.util.Version;
+
+
+import java.util.List;
+
+/**
+ * Migration code from 0.7.3 to 0.8.
+ *
+ * @author dCosse <cosse(a)codelutin.com>
+ * @since 0.6
+ */
+public class MigrationV0_8 extends TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(MigrationV0_8.class);
+
+ @Override
+ protected void prepareMigrationScript(TopiaPersistenceContext tx,
+ List queries,
+ boolean showSql,
+ boolean showProgression) throws TopiaException {
+
+ if (log.isInfoEnabled()) {
+ log.info("Migrates to version 0.8");
+ }
+
+ //
+ queries.add("UPDATE entry SET lettering=null WHERE lettering IS NOT NULL AND LENGTH(LTRIM(RTRIM(lettering))) = 0");
+
+ }
+
+ @Override
+ public Version getVersion() {
+ return null;
+ }
+}
1
0
r3806 - in trunk/lima-business/src: main/java/org/chorem/lima/business/accountingrules main/java/org/chorem/lima/business/ejb test/java/org/chorem/lima/business test/java/org/chorem/lima/business/accountingrules test/java/org/chorem/lima/entity
by athimel@users.chorem.org 16 May '14
by athimel@users.chorem.org 16 May '14
16 May '14
Author: athimel
Date: 2014-05-16 16:12:50 +0200 (Fri, 16 May 2014)
New Revision: 3806
Url: http://forge.chorem.org/projects/lima/repository/revisions/3806
Log:
refs #934 Migrate tests configuration
Removed:
trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java
trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-05-16 14:04:54 UTC (rev 3805)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-05-16 14:12:50 UTC (rev 3806)
@@ -30,7 +30,6 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaBusinessException;
-import org.chorem.lima.business.LimaDaoHelper;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.LimaInterceptor;
import org.chorem.lima.entity.Account;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2014-05-16 14:04:54 UTC (rev 3805)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2014-05-16 14:12:50 UTC (rev 3806)
@@ -27,7 +27,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaDaoHelper;
import org.chorem.lima.business.LimaInterceptor;
import org.chorem.lima.entity.LimaCallaoTopiaDaoSupplier;
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-05-16 14:04:54 UTC (rev 3805)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-05-16 14:12:50 UTC (rev 3806)
@@ -45,7 +45,6 @@
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.business.api.ReportService;
-import org.chorem.lima.business.ejb.ClearService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.Entry;
@@ -64,7 +63,6 @@
import org.nuiton.i18n.I18n;
import org.nuiton.i18n.init.ClassPathI18nInitializer;
import org.nuiton.topia.persistence.TopiaApplicationContextCache;
-import org.nuiton.topia.persistence.TopiaNotFoundException;
import com.google.common.base.Function;
@@ -89,7 +87,6 @@
protected static DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.ENGLISH);
- protected static ClearService clearService;
protected static AccountService accountService;
protected static EntryBookService entryBookService;
protected static FinancialPeriodService financialPeriodService;
@@ -121,7 +118,6 @@
* @throws IOException
*/
protected static void initServices() throws IOException {
- clearService = LimaServiceFactory.getService(ClearService.class);
accountService = LimaServiceFactory.getService(AccountService.class);
entryBookService = LimaServiceFactory.getService(EntryBookService.class);
financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class);
@@ -211,7 +207,8 @@
protected void initTestDatabase() throws LimaException, ParseException {
// clear database
- clearService.clearDatabase();
+// clearService.clearDatabase();
+ getTestContext().createSchema();
initTestAccounts();
initTestTransactions();
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-05-16 14:04:54 UTC (rev 3805)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-05-16 14:12:50 UTC (rev 3806)
@@ -55,7 +55,7 @@
*/
protected void importEBPData() throws IOException, LimaException, ParseException {
- clearService.clearDatabase();
+ getTestContext().createSchema();
// create fiscal period (mandatory for import)
FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
@@ -142,7 +142,7 @@
*/
@Test
public void testImportCSVPCG() throws Exception {
- clearService.clearDatabase();
+ getTestContext().createSchema();
String pcg = IOUtils.toString(ImportServiceImplTest.class.getResourceAsStream("/import/pcg_base.csv"));
importService.importAsCSV(pcg, ImportExportEntityEnum.ACCOUNT);
@@ -155,7 +155,7 @@
*/
@Test
public void testImportCSVEb() throws Exception {
- clearService.clearDatabase();
+ getTestContext().createSchema();
String pcg = IOUtils.toString(ImportServiceImplTest.class.getResourceAsStream("/import/eb_default.csv"));
importService.importAsCSV(pcg, ImportExportEntityEnum.ENTRYBOOK);
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-05-16 14:04:54 UTC (rev 3805)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-05-16 14:12:50 UTC (rev 3806)
@@ -29,7 +29,7 @@
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialPeriodImpl;
import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.entity.FiscalPeriodDAO;
+import org.chorem.lima.entity.FiscalPeriodTopiaDao;
import org.junit.Ignore;
import org.nuiton.topia.persistence.TopiaException;
@@ -67,7 +67,7 @@
super.createFiscalPeriodRules(fiscalPeriod);
List<FinancialPeriod> financialPeriods = new ArrayList<FinancialPeriod>();
try {
- FiscalPeriodDAO fiscalPeriodDAO = getDaoHelper().getFiscalPeriodDAO();
+ FiscalPeriodTopiaDao fiscalPeriodDAO = getDaoHelper().getFiscalPeriodDao();
//Checks if is not the first fiscalperiod to create
if (fiscalPeriodDAO.count() != 0) {
@@ -99,7 +99,7 @@
while (loopDate.before(endDate)) {
FinancialPeriod financialPeriod = new FinancialPeriodImpl();
//important for fiscalperiod created from import, it can be locked, so financialperiods must be locked
- financialPeriod.setLocked(fiscalPeriod.getLocked());
+ financialPeriod.setLocked(fiscalPeriod.isLocked());
financialPeriod.setBeginDate(loopDate);
loopDate = DateUtils.addMonths(loopDate, 1);
loopDate = DateUtils.truncate(loopDate, Calendar.MONTH);
Modified: trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java 2014-05-16 14:04:54 UTC (rev 3805)
+++ trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java 2014-05-16 14:12:50 UTC (rev 3806)
@@ -27,7 +27,6 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.persistence.TopiaException;
import java.util.List;
@@ -54,16 +53,16 @@
*/
@Test
public void testStringToListAccounts() throws TopiaException {
- TopiaContext tx = getTestContext().beginTransaction();
+ LimaCallaoTopiaPersistenceContext context = getTestContext().newPersistenceContext();
+
+ AccountTopiaDao accountDAO = context.getAccountDao();
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(tx);
-
List<Account> accounts = accountDAO.stringToListAccounts("50..511", false);
Assert.assertEquals(5, accounts.size());
accounts = accountDAO.stringToListAccounts("60..99", false);
Assert.assertEquals(0, accounts.size());
- tx.closeContext();
+ context.closeContext();
}
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java 2014-05-16 14:04:54 UTC (rev 3805)
+++ trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java 2014-05-16 14:12:50 UTC (rev 3806)
@@ -30,10 +30,10 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.persistence.TopiaException;
+
/**
- * Test for {@link FinancialTransactionDAO}.
+ * Test for {@link FinancialTransactionTopiaDao}.
*
* @author chatellier
* @version $Revision: 3585 $
@@ -60,8 +60,8 @@
FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0);
EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv");
- TopiaContext tx = getTestContext().beginTransaction();
- FinancialTransactionDAO ftDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(tx);
+ LimaCallaoTopiaPersistenceContext context = getTestContext().newPersistenceContext();
+ FinancialTransactionTopiaDao ftDAO = context.getFinancialTransactionDao();
List<FinancialTransaction> fTransactions = ftDAO.getAllUnbalancedTransaction(financialPeriod.getBeginDate(),
financialPeriod.getEndDate(), journalDesVentes);
Assert.assertNotNull(fTransactions);
1
0
Build failed in Jenkins: lima-ci » Lima :: callao #41
by admin+ci-chorem.org@codelutin.com 16 May '14
by admin+ci-chorem.org@codelutin.com 16 May '14
16 May '14
See <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/41/cha…>
Changes:
[dcosse] refs#934 migration topia3 en cours
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Lima :: callao 0.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ lima-callao ---
[INFO] Deleting <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ lima-callao ---
[INFO]
[INFO] --- eugene-maven-plugin:2.8:generate (generate-entities) @ lima-callao ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…>
[INFO] Will generate <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO] Copy file <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…> to <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO] Generate one file in 15.222ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…> for 1 file(s).
[INFO] Will generate <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO] Copy file <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…> to <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO] Generate one file in 1.184s.
[INFO] Process phase [model] for one entry.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:126) beforeReadFile - No properties provider filled, will instanciate a new default one
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:294) loadModelTagValue - Invalid model tag value [model.tagvalue.String] : the tagvalue 'String' is unkown.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:294) loadModelTagValue - Invalid model tag value [model.tagvalue.copyright] : the tagvalue 'copyright' is unkown.
INFO [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:270) loadModelProperties - 29 tag values were succesfull imported from <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO] No file generated.
[INFO] Apply generator TopiaMetaTransformer
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [getHeaderAmount([])<<[]>> throws [] tagvalue: {}] Operation name getHeaderAmount is already reserved for a getter/setter of an entity attribute
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [getSubAmount([])<<[]>> throws [] tagvalue: {}] Operation name getSubAmount is already reserved for a getter/setter of an entity attribute
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [org.chorem.lima.beans.FinancialTransactionSearch#account] Cet attribut n'a pas d'inverse.
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [org.chorem.lima.beans.FinancialTransactionSearch#entryBook] Cet attribut n'a pas d'inverse.
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [org.chorem.lima.beans.FinancialTransactionSearch#amountWayEnum] Cet attribut n'a pas d'inverse.
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [org.chorem.lima.beans.LetteringFilter#account] Cet attribut n'a pas d'inverse.
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [org.chorem.lima.entity.FinancialStatement#way] Cet attribut n'a pas d'inverse.
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [org.chorem.lima.beans.ReportsDatas#account] Cet attribut n'a pas d'inverse.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.FinancialTransactionImpl], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.VatStatementImpl], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.FinancialStatementImpl], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.EntryImpl], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractFinancialTransactionTopiaDao], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractVatStatementTopiaDao], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractFinancialStatementTopiaDao], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractFinancialPeriodTopiaDao], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractAccountTopiaDao], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractFiscalPeriodTopiaDao], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractClosedPeriodicEntryBookTopiaDao], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.AbstractEntryTopiaDao], already found in class-path.
[INFO] Apply generator EntityTransformer
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.FinancialTransactionImpl], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.VatStatementImpl], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.FinancialStatementImpl], already found in class-path.
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [org.chorem.lima.entity.EntryImpl], already found in class-path.
[INFO] Apply generator JavaBeanTransformer
[INFO] Add compile source root : <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ lima-callao ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 2 resources
[INFO] Copying 10 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ lima-callao ---
[INFO] Compiling 145 source files to <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/tar…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…>:[66,51] TOPIA_CREATE_DATE in org.nuiton.topia.persistence.TopiaEntity has been deprecated
[WARNING] <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…>:[50,44] TOPIA_CREATE_DATE in org.nuiton.topia.persistence.TopiaEntity has been deprecated
[WARNING] <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…>:[70,45] TOPIA_CREATE_DATE in org.nuiton.topia.persistence.TopiaEntity has been deprecated
[WARNING] <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…>: Recompile with -Xlint:unchecked for details.
[INFO] 6 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.chorem.org/jenkins/job/lima-ci/org.chorem.lima$lima-callao/ws/src…>:[28,8] org.chorem.lima.entity.FinancialStatementImpl is not abstract and does not override abstract method getSubAmount() in org.chorem.lima.entity.FinancialStatement
[INFO] 1 error
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
1
Jenkins build is back to normal : lima-ci » Lima :: business API #42
by admin+ci-chorem.org@codelutin.com 16 May '14
by admin+ci-chorem.org@codelutin.com 16 May '14
16 May '14
Author: dcosse
Date: 2014-05-16 16:04:54 +0200 (Fri, 16 May 2014)
New Revision: 3805
Url: http://forge.chorem.org/projects/lima/repository/revisions/3805
Log:
refs#935 suppression du module obsol?\195?\168te lima-negocia
Removed:
trunk/lima-neogia/
1
0
Author: dcosse
Date: 2014-05-16 16:04:17 +0200 (Fri, 16 May 2014)
New Revision: 3804
Url: http://forge.chorem.org/projects/lima/repository/revisions/3804
Log:
refs#935 suppression du module obsol?\195?\168te lima-negocia
Removed:
trunk/lima-neogia/LICENSE.txt
trunk/lima-neogia/README.txt
trunk/lima-neogia/changelog.txt
trunk/lima-neogia/pom.xml
Deleted: trunk/lima-neogia/LICENSE.txt
===================================================================
--- trunk/lima-neogia/LICENSE.txt 2014-05-16 14:03:06 UTC (rev 3803)
+++ trunk/lima-neogia/LICENSE.txt 2014-05-16 14:04:17 UTC (rev 3804)
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Deleted: trunk/lima-neogia/README.txt
===================================================================
--- trunk/lima-neogia/README.txt 2014-05-16 14:03:06 UTC (rev 3803)
+++ trunk/lima-neogia/README.txt 2014-05-16 14:04:17 UTC (rev 3804)
@@ -1 +0,0 @@
-TODO
\ No newline at end of file
Deleted: trunk/lima-neogia/changelog.txt
===================================================================
--- trunk/lima-neogia/changelog.txt 2014-05-16 14:03:06 UTC (rev 3803)
+++ trunk/lima-neogia/changelog.txt 2014-05-16 14:04:17 UTC (rev 3804)
@@ -1,10 +0,0 @@
-0.3 ??? 200902??
-
- * [chemit] 20090126 - use lutinproject 3.3 and optimzed pom
- * [chemit] 20090126 - suppress lima-commandline module (all generation in lima-ui)
-
-0.2 ??? 200?????
-???
-
-0.1 ??? 200?????
-???
\ No newline at end of file
Deleted: trunk/lima-neogia/pom.xml
===================================================================
--- trunk/lima-neogia/pom.xml 2014-05-16 14:03:06 UTC (rev 3803)
+++ trunk/lima-neogia/pom.xml 2014-05-16 14:04:17 UTC (rev 3804)
@@ -1,306 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <!-- ************************************************************* -->
- <!-- *** POM Relationships *************************************** -->
- <!-- ************************************************************* -->
- <parent>
- <groupId>org.chorem</groupId>
- <artifactId>lima</artifactId>
- <version>0.5-SNAPSHOT</version>
- </parent>
-
- <groupId>org.chorem.lima</groupId>
- <artifactId>lima-service-neogia</artifactId>
-
- <dependencies>
- <!-- sibling dependencies -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>lima-service</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!--
- Axis
- -->
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-xmlbeans</artifactId>
- </dependency>
- </dependencies>
-
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
- <name>Lima Neogia service</name>
- <description>services lima via ofbiz neogia</description>
-
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
- <packaging>jar</packaging>
-
- <properties>
- <maven.javadoc.excludePackageNames>
- org.w3.www._2004._06.xmlmime:org.xmlsoap.schemas.soap.encoding:org.ofbiz.webservice
- </maven.javadoc.excludePackageNames>
- </properties>
-
- <build>
-
- <plugins>
- <plugin>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
- <version>${axis.version}</version>
- <configuration>
- <generateServerSide>false</generateServerSide>
- <generateServerSideInterface>false</generateServerSideInterface>
- <generateServicesXml>false</generateServicesXml>
- <generateTestcase>false</generateTestcase>
- <packageName>org.chorem.lima.service.neogia</packageName>
- <outputDirectory>${maven.gen.dir}</outputDirectory>
- <databindingName>xmlbeans</databindingName>
- </configuration>
- <executions>
- <!--
- Journal
- -->
- <execution>
- <id>generate-getAllJournal</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/getAllJournal.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-removeJournal</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/removeJournal.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-addJournal</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/addJournal.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-updateJournal</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/updateJournal.wsdl</wsdlFile>
- </configuration>
- </execution>
- <!--
- Account
- -->
- <execution>
- <id>generate-getAllAccount</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/getAllAccount.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-addAccount</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/addAccount.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-removeAccount</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/removeAccount.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-updateAccount</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/updateAccount.wsdl</wsdlFile>
- </configuration>
- </execution>
- <!--
- Period
- -->
- <execution>
- <id>generate-getAllPeriod</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/getAllPeriod.wsdl</wsdlFile>
- </configuration>
- </execution>
- <!--
- Transaction
- -->
- <execution>
- <id>generate-getAllTransaction</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/getAllTransaction.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-removeTransaction</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/removeTransaction.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-updateTransaction</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/updateTransaction.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-addTransaction</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/addTransaction.wsdl</wsdlFile>
- </configuration>
- </execution>
- <!--
- Entry
- -->
- <execution>
- <id>generate-getEntryByTransaction</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/getEntryByTransaction.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-removeEntry</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/removeEntry.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-updateEntry</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/updateEntry.wsdl</wsdlFile>
- </configuration>
- </execution>
- <execution>
- <id>generate-addEntry</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/addEntry.wsdl</wsdlFile>
- </configuration>
- </execution>
- <!--
- Status
- -->
- <execution>
- <id>generate-getAllStatus</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsdl2code</goal>
- </goals>
- <configuration>
- <wsdlFile>${basedir}/target/classes/wsdl/getAllStatus.wsdl</wsdlFile>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <!-- compile phase : copy resources generated in process-resources phase -->
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>compile</phase>
- <configuration>
- <tasks>
- <copy todir="${basedir}/target/classes" verbose="${maven.verbose}" overwrite="true">
- <fileset dir="${maven.gen.dir}/resources" />
- </copy>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <filters>
- <filter>${maven.src.dir}/main/filters/filter.properties</filter>
- </filters>
- <resources>
- <resource>
- <directory>${maven.src.dir}/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- <resource>
- <directory>${maven.gen.dir}/resources</directory>
- </resource>
- </resources>
-
- </build>
-
-</project>
\ No newline at end of file
1
0
Author: dcosse
Date: 2014-05-16 16:03:06 +0200 (Fri, 16 May 2014)
New Revision: 3803
Url: http://forge.chorem.org/projects/lima/repository/revisions/3803
Log:
refs#935 suppression du module obsol?\195?\168te lima-negocia
Removed:
trunk/lima-neogia/src/
1
0