branch feature/1317-les-ecritures-de-regulations-vont-dans-le-journal-Extourne updated (3db99ed -> 7671291)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1317-les-ecritures-de-regulations-vont-dans-le-journal-Extourne in repository lima. See https://gitlab.nuiton.org/chorem/lima.git discards 3db99ed refs #1317 Crée une transaction Extourne ou placer les écritures créer pour équilibrer un lettrage adds c99ab61 Fix build adds ca457cc Update parent pom adds 144659a doc(README.md): Actualisation du README avec le contenu de l'index du site adds e099d71 refs #1316 ajout de logs adds 5da06cc refs #1316 changement de comportement, il est possible de rechercher un compte tant qu'aucune correspondance a été trouvée, une fois une correspondance unique trouvée la recherche est intérompue (peut-être reprise avec F12) et l'utilisateur peut alors passer sur une autre cellule adds 9622606 refs #1317 déclaration de licences manquante adds bc1f7e6 refs #1317 déclaration de licences manquante adds f761cfc refs #1317 déclaration de licences manquante adds 60c6329 refs #1317 déclaration de licences manquante adds 434a917 refs #1317 déclaration de licences manquante adds 5f97fd8 refs #1317 déclaration de licences manquante adds 9294f5d refs #1317 déclaration de licences manquante adds 7ea6ec6 refs #1317 déclaration de licences manquante adds d7915e5 Merge branch 'feature/1316-Rendre-utilisable-la-selection-de-compte' into develop adds 15845a6 refs #1361 correction sur affichage des erreurs d'import adds eb099f7 refs #1314 monté de version des libs new 7671291 refs #1317 Crée une transaction Extourne ou placer les écritures créer pour équilibrer un lettrage This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (3db99ed) \ N -- N -- N refs/heads/feature/1317-les-ecritures-de-regulations-vont-dans-le-journal-Extourne (7671291) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 767129104f51d3c4be2c3cca6e036780c1edc3df Author: dcosse <cosse@codelutin.com> Date: Sun Feb 21 00:43:12 2016 +0100 refs #1317 Crée une transaction Extourne ou placer les écritures créer pour équilibrer un lettrage Summary of changes: .gitignore | 5 ++ src/site/rst/index.rst => README.md | 38 +++------ README.txt | 4 + changelog.txt | 16 ---- lima-business-api/.gitignore | 1 + .../README.txt => lima-business-api/README.md | 0 lima-business-api/README.txt | 0 .../org/chorem/lima/business/ImportResult.java | 2 + .../chorem/lima/business/api/TreasuryService.java | 22 +++++ lima-business/.gitignore | 1 + .../changelog.txt => lima-business/README.md | 0 lima-business/changelog.txt | 2 - lima-business/pom.xml | 4 + .../lima/business/ejb/ImportServiceImpl.java | 4 +- .../lima/business/ejb/TreasuryServiceImpl.java | 22 +++++ .../ejb/report/AccountReportServiceImpl.java | 22 +++++ .../business/ejb/report/CommonsDocumentReport.java | 22 +++++ .../resources/i18n/lima-business_fr_FR.properties | 2 +- lima-callao/.gitignore | 1 + lima-callao/{README.txt => README.md} | 0 lima-callao/changelog.txt | 2 - lima-report/.gitignore | 1 + lima-report/{README.txt => README.md} | 0 lima-server/{README.txt => README.md} | 0 lima-server/src/license/THIRD-PARTY.properties | 7 +- lima-swing/.gitignore | 1 + lima-swing/{README.txt => README.md} | 0 lima-swing/changelog.txt | 47 ---------- lima-swing/pom.xml | 4 + lima-swing/src/license/THIRD-PARTY.properties | 7 +- .../chorem/lima/ui/accountViewer/PeriodChoice.java | 22 +++++ .../lima/ui/accountViewer/SelectionMode.java | 22 +++++ .../lima/ui/celleditor/AccountTableCellEditor.java | 37 ++++++-- .../chorem/lima/ui/combobox/AccountComboBox.java | 7 +- .../chorem/lima/ui/common/AbstractLimaTable.java | 4 + .../ui/financialtransaction/AccountColumn.java | 4 + .../chorem/lima/ui/importexport/ImportExport.java | 99 +++++++++------------- .../resources/i18n/lima-swing_fr_FR.properties | 2 +- pom.xml | 30 ++++--- 39 files changed, 279 insertions(+), 185 deletions(-) copy src/site/rst/index.rst => README.md (85%) delete mode 100644 changelog.txt create mode 100644 lima-business-api/.gitignore rename lima-business/README.txt => lima-business-api/README.md (100%) delete mode 100644 lima-business-api/README.txt create mode 100644 lima-business/.gitignore rename lima-business-api/changelog.txt => lima-business/README.md (100%) delete mode 100644 lima-business/changelog.txt create mode 100644 lima-callao/.gitignore rename lima-callao/{README.txt => README.md} (100%) delete mode 100644 lima-callao/changelog.txt create mode 100644 lima-report/.gitignore rename lima-report/{README.txt => README.md} (100%) rename lima-server/{README.txt => README.md} (100%) create mode 100644 lima-swing/.gitignore rename lima-swing/{README.txt => README.md} (100%) delete mode 100644 lima-swing/changelog.txt -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1317-les-ecritures-de-regulations-vont-dans-le-journal-Extourne in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 767129104f51d3c4be2c3cca6e036780c1edc3df Author: dcosse <cosse@codelutin.com> Date: Sun Feb 21 00:43:12 2016 +0100 refs #1317 Crée une transaction Extourne ou placer les écritures créer pour équilibrer un lettrage --- .../business/api/FinancialTransactionService.java | 5 ++- .../ejb/FinancialTransactionServiceImpl.java | 45 ++++++++++++++++++---- .../lima/ui/lettering/LetteringViewHandler.java | 8 ++++ 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java index d653bc8..43eb782 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java @@ -110,13 +110,14 @@ public interface FinancialTransactionService { /** * From to selected entries, create one with same account and * difference between the amounts, and another one with - * account 658 or 758 and an amount conversely of the first created + * account 658 or 758 and entrybook Extourne + * and an amount conversely of the first created * @param firstEntrySelected first entry selected * @param secondEntrySelected second entry selected * @return table of the two new entries * */ Entry[] getEntriesFromEqualizing(Entry firstEntrySelected, Entry secondEntrySelected) - throws LockedFinancialPeriodException, LockedEntryBookException; + throws LockedFinancialPeriodException, LockedEntryBookException, AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException; /** * Retourne toutes les entrées d'une transaction diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java index 71f5d0d..cd0d9c2 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java @@ -33,6 +33,7 @@ import org.chorem.lima.beans.LetteringFilter; import org.chorem.lima.business.AccountingRules; import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; +import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; @@ -81,10 +82,17 @@ import static org.nuiton.i18n.I18n.t; @TransactionAttribute public class FinancialTransactionServiceImpl extends AbstractLimaService implements FinancialTransactionService { + protected static final Log log = LogFactory.getLog(FinancialTransactionServiceImpl.class); + public static final String EXTOURNE = "EXT"; + @EJB protected AccountService accountService; - protected static final Log log = LogFactory.getLog(FinancialTransactionServiceImpl.class); + @EJB + protected EntryBookService entryBookService; + + @EJB + protected FinancialTransactionService financialTransactionService; @Override public FinancialTransaction createNewFinancialTransaction(){ @@ -198,7 +206,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme @Override public Entry[] getEntriesFromEqualizing(Entry firstEntrySelected, Entry secondEntrySelected) - throws LockedFinancialPeriodException, LockedEntryBookException { + throws LockedFinancialPeriodException, LockedEntryBookException, AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException { Entry newSameAccountEntry = null; Entry newCostOrProductEntry = null; @@ -223,13 +231,15 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme Entry costOrProductEntry; /*Set result in the amount of the new entries*/ + FinancialTransaction newFinancialTransaction = createNewExtourneFinantialTransaction(firstEntrySelected, secondEntrySelected); + if (firstEntryDebitSubtract.compareTo(BigDecimal.ZERO) != 0) { - sameAccountEntry = copyEntryWithoutAmount(firstEntrySelected); - costOrProductEntry = copyEntryWithoutAmount(firstEntrySelected); + sameAccountEntry = copyEntryWithoutAmount(firstEntrySelected, newFinancialTransaction); + costOrProductEntry = copyEntryWithoutAmount(firstEntrySelected, newFinancialTransaction); amountsCalculation(firstEntryDebitSubtract, sameAccountEntry, costOrProductEntry); } else { - sameAccountEntry = copyEntryWithoutAmount(secondEntrySelected); - costOrProductEntry = copyEntryWithoutAmount(secondEntrySelected); + sameAccountEntry = copyEntryWithoutAmount(secondEntrySelected, newFinancialTransaction); + costOrProductEntry = copyEntryWithoutAmount(secondEntrySelected, newFinancialTransaction); amountsCalculation(secondEntryDebitSubtract, sameAccountEntry, costOrProductEntry); } @@ -252,6 +262,21 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme return entries; } + protected FinancialTransaction createNewExtourneFinantialTransaction(Entry firstEntrySelected, Entry secondEntrySelected) throws AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException, LockedFinancialPeriodException, LockedEntryBookException { + FinancialTransaction newFinancialTransaction = financialTransactionService.createNewFinancialTransaction(); + EntryBook entryBook = entryBookService.getEntryBookByCode(EXTOURNE); + if (entryBook == null) { + entryBook = firstEntrySelected.getFinancialTransaction().getEntryBook(); + } + newFinancialTransaction.setEntryBook(entryBook); + + Date lastTransactionDate = secondEntrySelected.getFinancialTransaction().getTransactionDate().after(firstEntrySelected.getFinancialTransaction().getTransactionDate()) ? + secondEntrySelected.getFinancialTransaction().getTransactionDate() : firstEntrySelected.getFinancialTransaction().getTransactionDate(); + newFinancialTransaction.setTransactionDate(lastTransactionDate); + newFinancialTransaction = financialTransactionService.createFinancialTransaction(newFinancialTransaction); + return newFinancialTransaction; + } + /**Debit and credit calculation for one entry, with its amount * @param entry Entry for calculation * @return table of two big decimal, representing respectively debit and credit @@ -270,13 +295,14 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme } /**Copy parametrised entry, without amount*/ - protected Entry copyEntryWithoutAmount(Entry entryToCopy) { + protected Entry copyEntryWithoutAmount(Entry entryToCopy, FinancialTransaction newFinancialTransaction) { Entry copiedEntry = new EntryImpl(); + newFinancialTransaction.addEntry(copiedEntry); + copiedEntry.setFinancialTransaction(newFinancialTransaction); copiedEntry.setAccount(entryToCopy.getAccount()); copiedEntry.setDescription(entryToCopy.getDescription()); copiedEntry.setDetail(entryToCopy.getDetail()); - copiedEntry.setFinancialTransaction(entryToCopy.getFinancialTransaction()); copiedEntry.setVoucher(entryToCopy.getVoucher()); return copiedEntry; @@ -561,6 +587,9 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); Entry newEntry = entryTopiaDao.create(entry); + if (log.isDebugEnabled()) { + log.debug("Nex "); + } return newEntry; } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java index bfb9238..5c2df81 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java @@ -37,6 +37,8 @@ import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.FiscalPeriodService; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; import org.chorem.lima.business.exceptions.LockedEntryBookException; import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; import org.chorem.lima.business.exceptions.UnbalancedEntriesException; @@ -498,6 +500,12 @@ public class LetteringViewHandler{ e.getClosedPeriodicEntryBook().getEntryBook().getLabel(), e.getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(), e.getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate())); + } catch (AfterLastFiscalPeriodException e) { + errorHelper.showErrorMessage(t("lima.entries.add.entry.error.afterLastFiscalPeriod", + e.getDate())); + } catch (BeforeFirstFiscalPeriodException e) { + errorHelper.showErrorMessage(t("lima.entries.add.entry.error.beforeFirstFiscalPeriod", + e.getDate())); } } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm