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
November 2015
- 1 participants
- 82 discussions
This is an automated email from the git hooks/post-receive script.
New change to branch develop in repository lima.
See http://git.chorem.org/lima.git
from 4fe0543 montée de version mineur de libs
new 3c9b729 Mise à jour fichiers de licences
new 234f3ac Mise à jour fichiers de licences
The 2 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 234f3ac8e5851853b476742db5426ffe662acbca
Author: dcosse <cosse(a)codelutin.com>
Date: Mon Nov 30 17:06:33 2015 +0100
Mise à jour fichiers de licences
commit 3c9b72997c4995f12cbbbb450cd9d0b450cb85d5
Author: dcosse <cosse(a)codelutin.com>
Date: Mon Nov 30 17:01:59 2015 +0100
Mise à jour fichiers de licences
Summary of changes:
lima-swing/src/license/THIRD-PARTY.properties | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
2
This is an automated email from the git hooks/post-receive script.
New change to branch develop in repository lima.
See http://git.chorem.org/lima.git
from 25b8310 Merge branch 'feature/1182-translation' into develop
new 4fe0543 montée de version mineur de libs
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 4fe054376362f86c3d4003b7f4f6ea9454e5547d
Author: dcosse <cosse(a)codelutin.com>
Date: Mon Nov 30 17:01:00 2015 +0100
montée de version mineur de libs
Summary of changes:
pom.xml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
1
30 Nov '15
This is an automated email from the git hooks/post-receive script.
New change to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
from ee5abac refs #1293 correction traductions
new 7898a89 refs #1293 correction de merge
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 7898a896313627636404d896110372f6cf882f9e
Author: dcosse <cosse(a)codelutin.com>
Date: Mon Nov 30 16:06:14 2015 +0100
refs #1293 correction de merge
Summary of changes:
.../src/main/java/org/chorem/lima/ui/lettering/LetteringView.css | 7 -------
.../java/org/chorem/lima/ui/lettering/LetteringViewHandler.java | 2 --
2 files changed, 9 deletions(-)
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
1
30 Nov '15
This is an automated email from the git hooks/post-receive script.
New change to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
discards 2ab9213 refs #1293 correction traductions
discards 6ad63d4 refs #1268 déplacement de donnés liées au model de l'handler au model et suppression de listener innutils
discards 95e3469 refs #1268 déplacement des models du jaxx au handler
discards 0481433 refs #1293 Correction i18n
discards 929d02f refs #1293 corrige exception dans le cas ou aucune periode financière existe avec la date choisie
discards 96ee941 refs #1293 corrections pour le cas ou aucune données existe dans Lima
discards c213b6a refs #1293 corrections et refactoring
discards 9a9ae12 refs #1293 refactoring et modification du calcul du sold précédent à l'année fiscale
discards 9e98c25 refs #1293 modification concernnt l'affichage des infos résumées
discards 58a1819 refs #1293 correction i18n
discards d9cbfd8 refs #1293 Ajout de la possibilité de choisir une consultation de compte pour un exercice, une période financière ou un interval de dates
discards a8f5dec refs #1293 refactoring, modification de style
discards 3802dc7 refs #1293 Traduction des dates pickers
discards 2d04e68 refs #1293 Correction sur les dates pickers et la recherche de compte appliquée égallement à l'onglet Lettering
discards 32dbaf1 refs #1293 Correction d'une exception survenant si un nom de compte est saisie est que aucun compte ne correspond
discards f0c6fc6 refs #1293 la validation des dates des date pickers est possible au Tab
discards 234fe5b refs #1241 Ajout de la possibilité de choisir entre deux modes de sélection des entrées (Manuelle ou Balancée)
discards d1326c2 refs #1241 Ajout de la possibilité de choisir entre deux modes de sélection des entrées (Manuelle ou Balancée) + Ajout d'icones
discards be7551f refs #1241 Ajout d'un oglet consultation de compte, travail en cours
adds a47f485 refs #1182 Ajout de traductions
adds 98ca966 refs #1182 Traduction des dates pickers
adds e9ea36e refs #1182 rétablit le fonctionnement des datepicker sur interval
adds 25b8310 Merge branch 'feature/1182-translation' into develop
new a859874 refs #1241 Ajout d'un oglet consultation de compte, travail en cours
new 67b47c2 refs #1241 Ajout de la possibilité de choisir entre deux modes de sélection des entrées (Manuelle ou Balancée) + Ajout d'icones
new b5244af refs #1241 Ajout de la possibilité de choisir entre deux modes de sélection des entrées (Manuelle ou Balancée)
new df5f528 refs #1293 la validation des dates des date pickers est possible au Tab
new da320f5 refs #1293 Correction d'une exception survenant si un nom de compte est saisie est que aucun compte ne correspond
new 45b2d0c refs #1293 Correction sur les dates pickers et la recherche de compte appliquée égallement à l'onglet Lettering
new 147c7cf refs #1293 Traduction des dates pickers
new d746f2e refs #1293 refactoring, modification de style
new 367ef5f refs #1293 Ajout de la possibilité de choisir une consultation de compte pour un exercice, une période financière ou un interval de dates
new 7b3c5c4 refs #1293 correction i18n
new f6b8fc9 refs #1293 modification concernnt l'affichage des infos résumées
new 0885bc3 refs #1293 refactoring et modification du calcul du sold précédent à l'année fiscale
new 27350cb refs #1293 corrections et refactoring
new 9f4bbb3 refs #1293 corrections pour le cas ou aucune données existe dans Lima
new a2e5011 refs #1293 corrige exception dans le cas ou aucune periode financière existe avec la date choisie
new 7ceeed6 refs #1293 Correction i18n
new 59ea9a6 refs #1268 déplacement des models du jaxx au handler
new e137b42 refs #1268 déplacement de donnés liées au model de l'handler au model et suppression de listener innutils
new ee5abac refs #1293 correction traductions
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 (2ab9213)
\
N -- N -- N refs/heads/feature/1293-addAccountViewerTab (ee5abac)
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 19 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 ee5abac225ee24638091826aac1a7460eb11cf7c
Author: dcosse <cosse(a)codelutin.com>
Date: Mon Nov 30 14:13:39 2015 +0100
refs #1293 correction traductions
commit e137b426c073b9b24fbcca224d770c404bf5e7a2
Author: dcosse <cosse(a)codelutin.com>
Date: Wed Sep 30 15:30:48 2015 +0200
refs #1268 déplacement de donnés liées au model de l'handler au model et suppression de listener innutils
commit 59ea9a6396f07ce8e2fabb11f3e842dc0a1322ba
Author: dcosse <cosse(a)codelutin.com>
Date: Wed Sep 30 14:49:39 2015 +0200
refs #1268 déplacement des models du jaxx au handler
commit 7ceeed60dfc471af1dd7c1da4fbf0a9139dfee2d
Author: dcosse <cosse(a)codelutin.com>
Date: Fri Sep 25 13:08:29 2015 +0200
refs #1293 Correction i18n
commit a2e5011e898db21f4fd3816479a87c8d4224abfb
Author: dcosse <cosse(a)codelutin.com>
Date: Fri Sep 25 13:05:56 2015 +0200
refs #1293 corrige exception dans le cas ou aucune periode financière existe avec la date choisie
commit 9f4bbb3d2f8fce6ff5828f088f32a442e23be8bf
Author: dcosse <cosse(a)codelutin.com>
Date: Thu Sep 24 14:19:40 2015 +0200
refs #1293 corrections pour le cas ou aucune données existe dans Lima
commit 27350cb95bc35003e593a4b87bc826fbaaf8783e
Author: dcosse <cosse(a)codelutin.com>
Date: Thu Sep 24 12:54:04 2015 +0200
refs #1293 corrections et refactoring
commit 0885bc333ef6679cd4c1d4efaff519e53b076554
Author: dcosse <cosse(a)codelutin.com>
Date: Wed Sep 23 22:05:15 2015 +0200
refs #1293 refactoring et modification du calcul du sold précédent à l'année fiscale
commit f6b8fc906f1c1e7b278937a7db9f007fc73f3f04
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 22 17:58:13 2015 +0200
refs #1293 modification concernnt l'affichage des infos résumées
commit 7b3c5c4c771ed690e6d0b5b128c1c6a0e81c4ff1
Author: dcosse <cosse(a)codelutin.com>
Date: Sun Sep 20 00:49:12 2015 +0200
refs #1293 correction i18n
commit 367ef5f73641745d3e01ddf924c1fdbe0e64b7f5
Author: dcosse <cosse(a)codelutin.com>
Date: Sun Sep 20 00:38:53 2015 +0200
refs #1293 Ajout de la possibilité de choisir une consultation de compte pour un exercice, une période financière ou un interval de dates
commit d746f2e8189d16b4b199b3f9a9bbb49374e7e3b3
Author: dcosse <cosse(a)codelutin.com>
Date: Fri Sep 18 10:27:41 2015 +0200
refs #1293 refactoring, modification de style
commit 147c7cf1e84787f1be2104d64c1e98650e05b430
Author: dcosse <cosse(a)codelutin.com>
Date: Wed Sep 16 22:11:13 2015 +0200
refs #1293 Traduction des dates pickers
commit 45b2d0cea148f951111be8ef416340102595ae10
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 15 17:18:09 2015 +0200
refs #1293 Correction sur les dates pickers et la recherche de compte appliquée égallement à l'onglet Lettering
commit da320f57171272aa349278907a6fefd680b40b89
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 15 16:59:42 2015 +0200
refs #1293 Correction d'une exception survenant si un nom de compte est saisie est que aucun compte ne correspond
commit df5f528d4e5658e8bcc3cfad5098985a59b4c9a7
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 15 16:57:35 2015 +0200
refs #1293 la validation des dates des date pickers est possible au Tab
commit b5244af9b7826be056f755dc15a769b55b804f5a
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 15 15:56:35 2015 +0200
refs #1241 Ajout de la possibilité de choisir entre deux modes de sélection des entrées (Manuelle ou Balancée)
commit 67b47c26bb7f1ed3fe261f2a42610f2e10add33a
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 15 15:14:19 2015 +0200
refs #1241 Ajout de la possibilité de choisir entre deux modes de sélection des entrées (Manuelle ou Balancée) + Ajout d'icones
commit a859874cfbf510506da4d7ecc027db9ad92b2b71
Author: dcosse <cosse(a)codelutin.com>
Date: Mon Sep 14 18:30:15 2015 +0200
refs #1241 Ajout d'un oglet consultation de compte, travail en cours
Summary of changes:
.../Filter/dateCondition/DateConditionHandler.java | 19 ++-
.../ui/Filter/dateCondition/DateConditionView.jaxx | 5 +-
.../DateIntervalConditionHandler.java | 19 ++-
.../DateIntervalConditionView.jaxx | 6 +-
.../ui/celleditor/DateLimaTableCellRenderer.java | 4 +-
.../lima/ui/celleditor/DateTableCellEditor.java | 154 ---------------------
.../chorem/lima/ui/common/AbstractLimaTable.java | 2 -
.../chorem/lima/ui/lettering/LetteringView.jaxx | 9 +-
.../lima/ui/lettering/LetteringViewHandler.java | 13 +-
.../resources/i18n/lima-swing_en_GB.properties | 2 +-
10 files changed, 56 insertions(+), 177 deletions(-)
delete mode 100644 lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
9
11/19: refs #1293 modification concernnt l'affichage des infos résumées
by chorem.org scm 30 Nov '15
by chorem.org scm 30 Nov '15
30 Nov '15
This is an automated email from the git hooks/post-receive script.
New commit to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
commit f6b8fc906f1c1e7b278937a7db9f007fc73f3f04
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 22 17:58:13 2015 +0200
refs #1293 modification concernnt l'affichage des infos résumées
---
.../lima/business/api/FinancialPeriodService.java | 6 +-
.../business/ejb/FinancialPeriodServiceImpl.java | 13 +-
.../lima/business/ejb/ReportServiceImpl.java | 2 +-
.../report/GeneralEntryBookReportServiceImpl.java | 2 +-
.../ProvisionalEntryBookReportServiceImpl.java | 2 +-
.../lima/entity/FinancialPeriodTopiaDao.java | 10 +-
.../lima/business/FiscalPeriodServiceImplTest.java | 4 +-
.../lima/ui/accountViewer/AccountViewerFilter.java | 41 +++
.../ui/accountViewer/AccountViewerTableModel.java | 10 -
.../lima/ui/accountViewer/AccountViewerView.css | 77 ++++-
.../lima/ui/accountViewer/AccountViewerView.jaxx | 106 +++++--
.../ui/accountViewer/AccountViewerViewHandler.java | 322 ++++++++++-----------
.../accountViewer/FinancialPeriodListRenderer.java | 68 -----
.../FinancialTransactionViewHandler.java | 4 +-
.../resources/i18n/lima-swing_en_GB.properties | 2 +
.../resources/i18n/lima-swing_fr_FR.properties | 6 +-
16 files changed, 387 insertions(+), 288 deletions(-)
diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java
index 3b078dd..4ed0a10 100644
--- a/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java
+++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java
@@ -58,6 +58,8 @@ public interface FinancialPeriodService {
List<FinancialPeriod> getAllFinancialPeriods();
- List<FinancialPeriod> getFinancialPeriods(Date beginDate,
- Date endDate);
+ FinancialPeriod getFinancialForDate(Date date);
+
+ List<FinancialPeriod> getFinancialPeriodsWithBeginDateWithin(Date beginDateFirst,
+ Date endDateLast);
}
diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
index cabbf73..02c2df2 100644
--- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
+++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
@@ -62,12 +62,21 @@ public class FinancialPeriodServiceImpl extends AbstractLimaService implements F
return result;
}
+ @Override
+ public FinancialPeriod getFinancialForDate(Date date) {
+
+ FinancialPeriodTopiaDao financialPeriodTopiaDao = getDaoHelper().getFinancialPeriodDao();
+ FinancialPeriod result = financialPeriodTopiaDao.findByDate(date);
+
+ return result;
+ }
+
/** @return all financial period from a fiscal period */
@Override
- public List<FinancialPeriod> getFinancialPeriods(Date beginDate, Date endDate) {
+ public List<FinancialPeriod> getFinancialPeriodsWithBeginDateWithin(Date beginDateFirst, Date endDateLast) {
FinancialPeriodTopiaDao financialPeriodTopiaDao = getDaoHelper().getFinancialPeriodDao();
- List<FinancialPeriod> result = financialPeriodTopiaDao.findByDates(beginDate, endDate);
+ List<FinancialPeriod> result = financialPeriodTopiaDao.findForBeginDateBetween(beginDateFirst, endDateLast);
return result;
}
diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
index 04031f4..ce9e57e 100644
--- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
+++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
@@ -406,7 +406,7 @@ public class ReportServiceImpl extends AbstractLimaService implements ReportServ
AccountTopiaDao accountTopiaDao = getDaoHelper().getAccountDao();
List<Account> accountsList;
//gets all financial periods from the fiscal period
- List<FinancialPeriod> financialPeriod = financialPeriodService.getFinancialPeriods(
+ List<FinancialPeriod> financialPeriod = financialPeriodService.getFinancialPeriodsWithBeginDateWithin(
fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate());
for (FinancialPeriod fp : financialPeriod) {
list.add(fp);
diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java
index bf4bd1e..0e843c3 100644
--- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java
+++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/GeneralEntryBookReportServiceImpl.java
@@ -106,7 +106,7 @@ public class GeneralEntryBookReportServiceImpl extends AbstractLimaService imple
try {
if (beginDate != null && endDate != null) {
- List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriods(beginDate, endDate);
+ List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriodsWithBeginDateWithin(beginDate, endDate);
BigDecimal amountDebit = BigDecimal.ZERO;
BigDecimal amountCredit = BigDecimal.ZERO;
diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java
index 206f478..c8a10f8 100644
--- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java
+++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java
@@ -102,7 +102,7 @@ public class ProvisionalEntryBookReportServiceImpl implements ProvisionalEntryBo
BigDecimal documentReportDebit = BigDecimal.ZERO;
BigDecimal documentReportCredit = BigDecimal.ZERO;
- List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriods(beginDate, endDate);
+ List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriodsWithBeginDateWithin(beginDate, endDate);
List<EntryBook> entryBooks;
diff --git a/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java b/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java
index e951ade..9d9a77d 100644
--- a/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java
+++ b/lima-business/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java
@@ -49,15 +49,15 @@ public class FinancialPeriodTopiaDao extends AbstractFinancialPeriodTopiaDao<Fin
/**
* Return all FinancialPeriod with begin date between two given dates.
*
- * @param beginDate period begin date
- * @param endDate period end date
+ * @param beginDateFirst period begin date
+ * @param beginDateLast period end date
* @return FinancialPeriod for {@code date}
*/
- public List<FinancialPeriod> findByDates(Date beginDate, Date endDate) {
+ public List<FinancialPeriod> findForBeginDateBetween(Date beginDateFirst, Date beginDateLast) {
HqlAndParametersBuilder<FinancialPeriod> builder = newHqlAndParametersBuilder();
- builder.addGreaterOrEquals(FinancialPeriod.PROPERTY_BEGIN_DATE, beginDate);
- builder.addLowerOrEquals(FinancialPeriod.PROPERTY_BEGIN_DATE, endDate);
+ builder.addGreaterOrEquals(FinancialPeriod.PROPERTY_BEGIN_DATE, beginDateFirst);
+ builder.addLowerOrEquals(FinancialPeriod.PROPERTY_BEGIN_DATE, beginDateLast);
builder.setOrderByArguments(FinancialPeriod.PROPERTY_BEGIN_DATE);
List<FinancialPeriod> financialPeriod = findAll(builder.getHql(), builder.getHqlParameters());
diff --git a/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java b/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
index 7a74550..08168f9 100644
--- a/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
+++ b/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
@@ -293,7 +293,7 @@ public class FiscalPeriodServiceImplTest extends AbstractLimaTest {
Assert.assertEquals(1, unblockedFiscalPeriods.size());
Assert.assertEquals(true, unblockedFiscalPeriods.contains(periodSave2));
- for (FinancialPeriod financialPeriod : financialPeriodService.getFinancialPeriods(periodSave1.getBeginDate(), periodSave1.getEndDate())) {
+ for (FinancialPeriod financialPeriod : financialPeriodService.getFinancialPeriodsWithBeginDateWithin(periodSave1.getBeginDate(), periodSave1.getEndDate())) {
Assert.assertEquals(true, financialPeriod.isLocked());
for (EntryBook entryBook : entryBookService.getAllEntryBooks()) {
ClosedPeriodicEntryBook closedPeriodicEntryBook =
@@ -509,7 +509,7 @@ public class FiscalPeriodServiceImplTest extends AbstractLimaTest {
Assert.assertEquals(1, unblockedFiscalPeriods.size());
Assert.assertEquals(true, unblockedFiscalPeriods.contains(periodSave2));
- for (FinancialPeriod financialPeriod : financialPeriodService.getFinancialPeriods(periodSave1.getBeginDate(), periodSave1.getEndDate())) {
+ for (FinancialPeriod financialPeriod : financialPeriodService.getFinancialPeriodsWithBeginDateWithin(periodSave1.getBeginDate(), periodSave1.getEndDate())) {
Assert.assertEquals(true, financialPeriod.isLocked());
for (EntryBook entryBook : entryBookService.getAllEntryBooks()) {
ClosedPeriodicEntryBook closedPeriodicEntryBook =
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerFilter.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerFilter.java
new file mode 100644
index 0000000..362cf69
--- /dev/null
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerFilter.java
@@ -0,0 +1,41 @@
+package org.chorem.lima.ui.accountViewer;
+
+import org.chorem.lima.beans.LetteringFilterImpl;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * Created by davidcosse on 21/09/15.
+ */
+public class AccountViewerFilter extends LetteringFilterImpl {
+
+ protected PeriodChoice periodChoice = PeriodChoice.FINANCIAL_PERIOD;
+
+ protected FinancialPeriod financialPeriod;
+
+ protected FiscalPeriod fiscalPeriod;
+
+ public PeriodChoice getPeriodChoice() {
+ return periodChoice;
+ }
+
+ public void setPeriodChoice(PeriodChoice periodChoice) {
+ this.periodChoice = periodChoice;
+ }
+
+ public FinancialPeriod getFinancialPeriod() {
+ return financialPeriod;
+ }
+
+ public void setFinancialPeriod(FinancialPeriod financialPeriod) {
+ this.financialPeriod = financialPeriod;
+ }
+
+ public FiscalPeriod getFiscalPeriod() {
+ return fiscalPeriod;
+ }
+
+ public void setFiscalPeriod(FiscalPeriod fiscalPeriod) {
+ this.fiscalPeriod = fiscalPeriod;
+ }
+}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java
index 3180fbf..767d234 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java
@@ -43,12 +43,6 @@ public class AccountViewerTableModel extends AbstractLimaTableModel<Entry> {
/** serialVersionUID. */
private static final long serialVersionUID = 1L;
- public BigDecimal getPreviousPeriodSold() {
- return previousPeriodSold;
- }
-
- protected BigDecimal previousPeriodSold;
-
@Override
protected void initColumn() {
addColumn(new AbstractColumn<AccountViewerTableModel>(Date.class, t("lima.table.date"), false) {
@@ -127,8 +121,4 @@ public class AccountViewerTableModel extends AbstractLimaTableModel<Entry> {
});
}
-
- public void setPreviousPeriodSold(BigDecimal previousPeriodSold) {
- this.previousPeriodSold = previousPeriodSold;
- }
}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
index 07b91f7..9682494 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
@@ -68,7 +68,7 @@
}
#fiscalPeriodComboBox {
- visible : {PeriodChoice.FISCAL_PERIOD.equals(periodChoice)};
+ visible : {PeriodChoice.FISCAL_PERIOD.equals(periodChoice) || PeriodChoice.FINANCIAL_PERIOD.equals(periodChoice)};
toolTipText : "lima.entries.fiscalYear";
renderer : "{new org.chorem.lima.ui.common.FiscalPeriodListRenderer()}";
}
@@ -76,7 +76,7 @@
#financialPeriodComboBox {
preferredSize : {new Dimension(200, 22)};
toolTipText : "lima.entries.financialPeriod";
- renderer : "{new org.chorem.lima.ui.accountViewer.FinancialPeriodListRenderer()}";
+ renderer : "{new org.chorem.lima.ui.common.FinancialPeriodListRenderer()}";
}
#refresh {
@@ -84,12 +84,79 @@
actionIcon : "refresh";
}
+#beginDebitLabel {
+ text : "lima.table.debit";
+}
+
+#beginDebit {
+ editable : false;
+}
+
+#beginCreditLabel {
+ text : "lima.table.credit";
+}
+
+#beginCredit {
+ editable : false;
+}
+
+#beginSoldLabel {
+ text : "lima.table.balance";
+}
+
+#beginSold {
+ editable : false;
+}
+
#table {
sortable : false;
rowHeight : 22;
}
-#balanceStatusLabel {
- horizontalTextPosition:{JLabel.RIGHT};
- border: {BorderFactory.createEmptyBorder(0, 0, 0, 20)};
+#endDebitLabel {
+ text : "lima.table.debit";
+}
+
+#endDebit {
+ editable : false;
+}
+
+#endCreditLabel {
+ text : "lima.table.credit";
}
+
+#endCredit {
+ editable : false;
+}
+
+#endSoldLabel {
+ text : "lima.table.balance";
+}
+
+#endSold {
+ editable : false;
+}
+
+#selectionDebitLabel {
+ text : "lima.table.debit";
+}
+
+#selectionDebit {
+ editable : false;
+}
+
+#selectionCreditLabel {
+ text : "lima.table.credit";
+}
+
+#selectionCredit {
+ editable : false;
+}
+
+#selectionSoldLabel {
+ text : "lima.table.balance";
+}
+
+#selectionSold {
+ editable : false;
+}
\ No newline at end of file
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
index e615d60..e394d6c 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
@@ -21,6 +21,7 @@
<JPanel layout="{new BorderLayout()}">
<import>
+ java.awt.FlowLayout
java.awt.Dimension
org.chorem.lima.util.WrapToolBarLayout
org.chorem.lima.ui.common.FinancialPeriodComboBoxModel
@@ -41,10 +42,10 @@
<script>
<![CDATA[
- void $afterCompleteSetup() {
- handler.init();
- }
- ]]>
+ void $afterCompleteSetup() {
+ handler.init();
+ }
+ ]]>
</script>
<JToolBar styleClass="toolbar"
@@ -71,7 +72,7 @@
<JLabel id="beginPeriodLabel"/>
- <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="fiscalPeriodComboBoxModel"/>
+ <org.chorem.lima.ui.common.FiscalPeriodComboBoxModel id="fiscalPeriodComboBoxModel"/>
<JComboBox id="fiscalPeriodComboBox"
model="{fiscalPeriodComboBoxModel}"
onItemStateChanged="handler.onFiscalPeriodChange(event)"/>
@@ -102,21 +103,88 @@
<JButton id="refresh"
onActionPerformed="handler.updateAllEntries(null)"/>
-
</JToolBar>
- <JScrollPane constraints="BorderLayout.CENTER">
- <AccountViewerTableModel id="tableModel"/>
- <AccountViewerSelectionModel id='accountViewerSelectionModel' constructorParams='tableModel'
- onValueChanged="handler.balanceAndActions()"/>
-
- <AccountViewerTable id="table"
- constructorParams="handler"
- model="{tableModel}"
- selectionModel="{accountViewerSelectionModel}"/>
- </JScrollPane>
-
- <JPanel constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}">
- <JLabel id='balanceStatusLabel' constraints="BorderLayout.EAST"/>
+
+ <JPanel layout="{new BorderLayout()}"
+ constraints="BorderLayout.CENTER">
+
+ <JPanel constraints="BorderLayout.NORTH" layout="{new FlowLayout(FlowLayout.RIGHT)}" id="beginBalanceStatus">
+ <JLabel id="beginPeriodSummary" />
+ <JLabel id="beginDebitLabel" />
+ <JTextField id="beginDebit"/>
+ <JLabel id="beginCreditLabel" />
+ <JTextField id="beginCredit"/>
+ <JLabel id="beginSoldLabel" />
+ <JTextField id="beginSold"/>
+ </JPanel>
+
+ <JScrollPane constraints="BorderLayout.CENTER">
+ <AccountViewerTableModel id="tableModel"/>
+ <AccountViewerSelectionModel id='accountViewerSelectionModel' constructorParams='tableModel'
+ onValueChanged="handler.balanceAndActions()"/>
+
+ <AccountViewerTable id="table"
+ constructorParams="handler"
+ model="{tableModel}"
+ selectionModel="{accountViewerSelectionModel}"/>
+ </JScrollPane>
+
+ <JPanel constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}">
+ <Table id='endBalanceStatus' constraints="BorderLayout.EAST">
+ <row>
+ <cell anchor="east">
+ <JLabel id="endPeriodSummary" />
+ </cell>
+
+ <cell anchor="east">
+ <JLabel id="endDebitLabel" />
+ </cell>
+ <cell anchor="west">
+ <JTextField id="endDebit"/>
+ </cell>
+
+ <cell anchor="east">
+ <JLabel id="endCreditLabel" />
+ </cell>
+ <cell anchor="west">
+ <JTextField id="endCredit"/>
+ </cell>
+
+ <cell anchor="east">
+ <JLabel id="endSoldLabel" />
+ </cell>
+ <cell anchor="west">
+ <JTextField id="endSold"/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor="east">
+ <JLabel id="selectionDescription" />
+ </cell>
+
+ <cell anchor="east">
+ <JLabel id="selectionDebitLabel" />
+ </cell>
+ <cell anchor="west">
+ <JTextField id="selectionDebit"/>
+ </cell>
+
+ <cell anchor="east">
+ <JLabel id="selectionCreditLabel" />
+ </cell>
+ <cell anchor="west">
+ <JTextField id="selectionCredit"/>
+ </cell>
+
+ <cell anchor="east">
+ <JLabel id="selectionSoldLabel" />
+ </cell>
+ <cell anchor="west">
+ <JTextField id="selectionSold"/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
</JPanel>
</JPanel>
\ No newline at end of file
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
index 50a17a0..f1450f5 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
@@ -22,7 +22,6 @@
package org.chorem.lima.ui.accountViewer;
-import com.google.common.collect.Lists;
import jaxx.runtime.SwingUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.time.DateUtils;
@@ -39,16 +38,11 @@ import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.EntryImpl;
import org.chorem.lima.entity.FinancialPeriod;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.ui.combobox.AccountComboBox;
import org.chorem.lima.util.BigDecimalToString;
import org.chorem.lima.util.ErrorHelper;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderFactory;
import javax.swing.*;
import java.awt.event.ActionEvent;
@@ -59,9 +53,7 @@ import java.beans.PropertyChangeListener;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Calendar;
-import java.util.Collection;
import java.util.Date;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -87,7 +79,7 @@ public class AccountViewerViewHandler {
protected FinancialTransactionService financialTransactionService;
protected FiscalPeriodService fiscalPeriodService;
- protected LetteringFilterImpl filter;
+ protected AccountViewerFilter filter;
protected AccountViewerEditModel editModel;
@@ -100,6 +92,7 @@ public class AccountViewerViewHandler {
protected boolean initializationComplete;
public AccountViewerViewHandler(AccountViewerView view) {
+
initializationComplete = false;
this.view = view;
initShortCuts();
@@ -117,9 +110,11 @@ public class AccountViewerViewHandler {
* Init all combo box in view.
*/
public void init() {
- filter = new LetteringFilterImpl();
+ filter = new AccountViewerFilter();
editModel = view.getEditModel();
- initViewWithDefaultFinancialPeriod();
+ initFiscalPeriodView();
+ initDefaultFinancialPeriodView();
+ initSoldPeriodView();
editModel.addPropertyChangeListener(AccountViewerEditModel.PROPERTY_DEBIT, new PropertyChangeListener() {
@Override
@@ -157,7 +152,6 @@ public class AccountViewerViewHandler {
SwingUtil.fixTableColumnWidth(view.getTable(), 4, 50);
initializationComplete = true;
- updateAllEntries(null);
updateSoldStatus();
}
@@ -170,7 +164,6 @@ public class AccountViewerViewHandler {
//To block reaction of the dual key 'ctrl+a' (Selection of all lines)
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK), "none");
-
// refresh
binding = "refresh";
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), binding);
@@ -193,28 +186,30 @@ public class AccountViewerViewHandler {
}
protected void onPeriodChoiceChanged(PeriodChoice periodChoice) {
- if (initializationComplete) {
- switch (periodChoice) {
- case FINANCIAL_PERIOD:
- view.getFiscalPeriodComboBox().setVisible(false);
- view.getFinancialPeriodComboBox().setVisible(true);
- view.getBeginPeriodPicker().setVisible(false);
- view.getEndPeriodPicker().setVisible(false);
- initViewWithDefaultFinancialPeriod();
- break;
- case FISCAL_PERIOD:
- view.getFiscalPeriodComboBox().setVisible(true);
- view.getFinancialPeriodComboBox().setVisible(false);
- view.getBeginPeriodPicker().setVisible(false);
- view.getEndPeriodPicker().setVisible(false);
- initFiscalPeriodModel();
- break;
- case DATE:
- view.getFiscalPeriodComboBox().setVisible(false);
- view.getFinancialPeriodComboBox().setVisible(false);
- view.getBeginPeriodPicker().setVisible(true);
- view.getEndPeriodPicker().setVisible(true);
- break;
+ if (initializationComplete && !filter.getPeriodChoice().equals(periodChoice)) {
+ filter.setPeriodChoice(periodChoice);
+ switch (periodChoice) {
+ case FINANCIAL_PERIOD:
+ view.getFiscalPeriodComboBox().setVisible(true);
+ view.getFinancialPeriodComboBox().setVisible(true);
+ view.getBeginPeriodPicker().setVisible(false);
+ view.getEndPeriodPicker().setVisible(false);
+ initDefaultFinancialPeriodView();
+ break;
+ case FISCAL_PERIOD:
+ view.getFiscalPeriodComboBox().setVisible(true);
+ view.getFinancialPeriodComboBox().setVisible(false);
+ view.getBeginPeriodPicker().setVisible(false);
+ view.getEndPeriodPicker().setVisible(false);
+ initFiscalPeriodView();
+ break;
+ case DATE:
+ view.getFiscalPeriodComboBox().setVisible(false);
+ view.getFinancialPeriodComboBox().setVisible(false);
+ view.getBeginPeriodPicker().setVisible(true);
+ view.getEndPeriodPicker().setVisible(true);
+ initDateIntervalView();
+ break;
}
updateAllEntries(null);
}
@@ -256,31 +251,48 @@ public class AccountViewerViewHandler {
}
protected void onFiscalPeriodChange(java.awt.event.ItemEvent event) {
- if (initializationComplete) {
- FiscalPeriod fiscalPeriod = (FiscalPeriod) event.getItem();
- updateAllEntriesForFiscalPeriodChange(fiscalPeriod);
+ FiscalPeriod fiscalPeriod = (FiscalPeriod) event.getItem();
+ if (initializationComplete && filter.getFiscalPeriod() != fiscalPeriod) {
+ filter.setFiscalPeriod(fiscalPeriod);
+
+ //FISCAL_PERIOD
+ if (PeriodChoice.FISCAL_PERIOD.equals(view.getPeriodChoice().getSelectedItem())) {
+ updateAllEntriesForFiscalPeriodChange(fiscalPeriod);
+ } else {
+ //FINANCIAL_PERIOD
+ initDefaultFinancialPeriodView();
+ }
}
}
protected void onFinancialPeriodChange(java.awt.event.ItemEvent event) {
- if (initializationComplete) {
- FinancialPeriod financialPeriod = (FinancialPeriod) event.getItem();
+ FinancialPeriod financialPeriod = (FinancialPeriod) event.getItem();
+ if (initializationComplete && filter.getFinancialPeriod() != financialPeriod) {
+ filter.setFinancialPeriod(financialPeriod);
updateAllEntriesForFinancialPeriodChange(financialPeriod);
}
}
public void onDateStartChange(Date date) {
if (initializationComplete) {
- filter.setDateStart(date);
- updateAllEntriesForDateChange();
+ if (date != null && !DateUtils.isSameDay(date, filter.getDateStart())) {
+ filter.setDateStart(date);
+ if (filter.getDateEnd().before(date)) {
+ filter.setDateEnd(filter.getDateEnd().before(date) ? date : filter.getDateEnd());
+ view.getEndPeriodPicker().setDate(filter.getDateEnd());
+ }
+ updateAllEntriesForDateChange();
+ }
}
}
public void onDateEndChange(Date date) {
if (initializationComplete) {
- filter.setDateEnd(date);
- updateAllEntriesForDateChange();
+ if (date != null && !DateUtils.isSameDay(date, filter.getDateEnd())) {
+ filter.setDateEnd(date);
+ updateAllEntriesForDateChange();
+ }
}
}
@@ -300,32 +312,32 @@ public class AccountViewerViewHandler {
public void updateSoldStatus() {
if (initializationComplete) {
- view.getBalanceStatusLabel().setText(t("lima.lettering.accountViewerBalanceStatus",
- getDateFormat().format(editModel.getFiscalPeriodBeginDate()),
- getDateFormat().format(filter.getDateEnd()),
-
- BigDecimalToString.format(editModel.getGlobalDebit()),
- BigDecimalToString.format(editModel.getGlobalCredit()),
- BigDecimalToString.format(editModel.getGlobalSold()),
-
- BigDecimalToString.format(editModel.getDebit()),
- BigDecimalToString.format(editModel.getCredit()),
- BigDecimalToString.format(editModel.getSold())));
+ view.getSelectionDescription().setText(t("lima.accountViewer.selectionDescription"));
+ view.getSelectionDebit().setText(BigDecimalToString.format(editModel.getDebit()));
+ view.getSelectionCredit().setText(BigDecimalToString.format(editModel.getCredit()));
+ view.getSelectionSold().setText(BigDecimalToString.format(editModel.getSold()));
}
}
public void updateAllEntriesForFiscalPeriodChange(FiscalPeriod fiscalPeriod) {
- filter.setDateStart(fiscalPeriod.getBeginDate());
- filter.setDateEnd(fiscalPeriod.getEndDate());
+ if (!DateUtils.isSameDay(fiscalPeriod.getBeginDate(), filter.getDateStart()) ||
+ !DateUtils.isSameDay(fiscalPeriod.getEndDate(), filter.getDateEnd())) {
+ filter.setDateStart(fiscalPeriod.getBeginDate());
+ filter.setDateEnd(fiscalPeriod.getEndDate());
- updateAllEntries(fiscalPeriod);
+ updateAllEntries(fiscalPeriod);
+ }
}
public void updateAllEntriesForFinancialPeriodChange(FinancialPeriod financialPeriod) {
- filter.setDateStart(financialPeriod.getBeginDate());
- filter.setDateEnd(financialPeriod.getEndDate());
- updateAllEntries(null);
+ if (!DateUtils.isSameDay(financialPeriod.getBeginDate(), filter.getDateStart()) ||
+ !DateUtils.isSameDay(financialPeriod.getEndDate(), filter.getDateEnd())) {
+ filter.setDateStart(financialPeriod.getBeginDate());
+ filter.setDateEnd(financialPeriod.getEndDate());
+
+ updateAllEntries(null);
+ }
}
public void updateAllEntriesForDateChange() {
@@ -333,91 +345,95 @@ public class AccountViewerViewHandler {
}
public void updateAllEntries(FiscalPeriod fiscalPeriod) {
-
if (initializationComplete
&& filter.getAccount() != null
&& filter.getDateStart() != null
&& filter.getDateEnd() != null) {
-
- List<Entry> entriesAndResume = Lists.newArrayList();
-
List<Entry> entries = financialTransactionService.getAllEntrieByDatesAndAccountAndLettering(filter);
fiscalPeriod = fiscalPeriod == null ? fiscalPeriodService.getFiscalPeriodForDate(filter.getDateStart()) : fiscalPeriod;
+ LetteringFilter previousPeriodFilter = computePreviousPeriodFilter(fiscalPeriod);
+ LetteringFilter actualPeriodFilter = computeActualPeriodFilter(fiscalPeriod);
+ setViewPreviousSold(previousPeriodFilter);
+ setViewActualSold(fiscalPeriod, actualPeriodFilter);
- if (CollectionUtils.isNotEmpty(entries)) {
- // can be null if there are no fiscal period for the begin date
- if (fiscalPeriod != null) {
- LetteringFilter previousPeriodFilter = computePreviousPeriodFilter(fiscalPeriod);
- LetteringFilter actualPeriodFilter = computeActualPeriodFilter(fiscalPeriod);
- addPreviousSoldToModel(previousPeriodFilter);
- addPreviousSoldEntryToEntries(entriesAndResume, entries, previousPeriodFilter);
- addActualSoldToModel(fiscalPeriod, actualPeriodFilter);
- }
- }
- entriesAndResume.addAll(entries);
- view.getTableModel().setValues(entriesAndResume);
+ view.getTableModel().setValues(entries);
}
onBalanceChanged(null);
}
- public void initFiscalPeriodModel() {
+ public void initFiscalPeriodView() {
+ List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllFiscalPeriods();
+ view.getFiscalPeriodComboBoxModel().setObjects(fiscalPeriods);
+
FiscalPeriod fiscalPeriod = fiscalPeriodService.getLastFiscalPeriod();
if (fiscalPeriod != null) {
+ filter.setFiscalPeriod(fiscalPeriod);
+ filter.setDateStart(fiscalPeriod.getBeginDate());
+ filter.setDateEnd(fiscalPeriod.getEndDate());
view.getFiscalPeriodComboBox().setSelectedItem(fiscalPeriod);
- view.getBeginPeriodPicker().setDate(fiscalPeriod.getBeginDate());
- view.getEndPeriodPicker().setDate(fiscalPeriod.getEndDate());
+ view.getFiscalPeriodComboBox().setVisible(true);
}
}
- public void initViewWithDefaultFinancialPeriod() {
- List<FinancialPeriod> financialPeriods = financialPeriodService.getAllFinancialPeriods();
- view.getFinancialPeriodComboBoxModel().setObjects(financialPeriods);
-
- FiscalPeriod fiscalPeriod = fiscalPeriodService.getLastFiscalPeriod();
-
- FinancialPeriod defaultFinancialPeriod = getDefaultFinancialPeriod(financialPeriods, fiscalPeriod);
-
- Calendar calendar = Calendar.getInstance();
- int lastCurrentMonthDay = calendar.getActualMaximum(Calendar.DATE);
- int firstCurrentMonthDay = calendar.getActualMinimum(Calendar.DATE);
-
- Date defaultDateBeginFinancialPeriod, defaultDateEndCurrent;
- defaultDateBeginFinancialPeriod = defaultFinancialPeriod == null ? DateUtils.setDays(new Date(), firstCurrentMonthDay) : defaultFinancialPeriod.getBeginDate();
- defaultDateEndCurrent = defaultFinancialPeriod == null ? DateUtils.setDays(new Date(), lastCurrentMonthDay) : defaultFinancialPeriod.getEndDate();
-
- view.getFinancialPeriodComboBoxModel().setSelectedItem(defaultFinancialPeriod);
-
- view.getBeginPeriodPicker().setDate(defaultDateBeginFinancialPeriod);
- view.getEndPeriodPicker().setDate(defaultDateEndCurrent);
-
- filter.setDateStart(defaultDateBeginFinancialPeriod);
- filter.setDateEnd(defaultDateEndCurrent);
+ public void initDateIntervalView() {
+ FiscalPeriod fiscalPeriod = (FiscalPeriod) view.getFiscalPeriodComboBox().getSelectedItem();
+ FinancialPeriod defaultFinancialPeriod;
+ if (fiscalPeriod != null) {
+ Date today = new Date();
+ defaultFinancialPeriod = financialPeriodService.getFinancialForDate(today);
- editModel.setFiscalPeriodBeginDate(fiscalPeriod != null ? fiscalPeriod.getBeginDate() : defaultDateBeginFinancialPeriod);
+ if (defaultFinancialPeriod == null) {
+ defaultFinancialPeriod = financialPeriodService.getFinancialForDate(fiscalPeriod.getEndDate());
+ }
+ filter.setDateStart(defaultFinancialPeriod.getBeginDate());
+ filter.setDateEnd(defaultFinancialPeriod.getEndDate());
+ view.getBeginPeriodPicker().setDate(defaultFinancialPeriod.getBeginDate());
+ view.getEndPeriodPicker().setDate(defaultFinancialPeriod.getEndDate());
+ }
}
- protected FinancialPeriod getDefaultFinancialPeriod(List<FinancialPeriod> financialPeriods, FiscalPeriod fiscalPeriod) {
- FinancialPeriod defaultFinancialPeriod = null;
+ public void initDefaultFinancialPeriodView() {
+ FiscalPeriod fiscalPeriod = (FiscalPeriod) view.getFiscalPeriodComboBox().getSelectedItem();
- if ((fiscalPeriod != null && fiscalPeriod.getFinancialPeriod() != null)) {
-
- Collection<FinancialPeriod> fiscalPeriodFinancialPeriods = financialPeriodService.getFinancialPeriods(fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate());
- Iterator<FinancialPeriod> financialPeriodIterator = fiscalPeriodFinancialPeriods.iterator();
- if (financialPeriodIterator.hasNext()) {
- defaultFinancialPeriod = financialPeriodIterator.next();
+ FinancialPeriod defaultFinancialPeriod = null;
+ if (fiscalPeriod != null) {
+ List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriodsWithBeginDateWithin(fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate());
+ view.getFinancialPeriodComboBoxModel().setObjects(financialPeriods);
+
+ boolean isCurrentDatePartOfSelectedFiscalPeriod;
+ Date today = new Date();
+ isCurrentDatePartOfSelectedFiscalPeriod = fiscalPeriod.getBeginDate().before(today) && (fiscalPeriod.getEndDate().after(today));
+ if (isCurrentDatePartOfSelectedFiscalPeriod) {
+ defaultFinancialPeriod = financialPeriodService.getFinancialForDate(today);
+ } else if (!financialPeriods.isEmpty()) {
+ defaultFinancialPeriod = financialPeriods.get(financialPeriods.size() - 1);
}
+ view.getFinancialPeriodComboBoxModel().setSelectedItem(defaultFinancialPeriod);
}
- defaultFinancialPeriod = defaultFinancialPeriod != null ? defaultFinancialPeriod : CollectionUtils.isNotEmpty(financialPeriods) ? financialPeriods.get(0) : null;
- return defaultFinancialPeriod;
+ Date defaultDateBegin, defaultDateEnd;
+ Calendar calendar = Calendar.getInstance();
+ int firstCurrentMonthDay = calendar.getActualMinimum(Calendar.DATE);
+ int lastCurrentMonthDay = calendar.getActualMaximum(Calendar.DATE);
+ defaultDateBegin = defaultFinancialPeriod == null ? DateUtils.setDays(new Date(), firstCurrentMonthDay) : defaultFinancialPeriod.getBeginDate();
+ defaultDateEnd = defaultFinancialPeriod == null ? DateUtils.setDays(new Date(), lastCurrentMonthDay) : defaultFinancialPeriod.getEndDate();
+
+ filter.setDateStart(defaultDateBegin);
+ filter.setDateEnd(defaultDateEnd);
+
+ editModel.setFiscalPeriodBeginDate(defaultFinancialPeriod != null ? defaultFinancialPeriod.getBeginDate() : defaultDateBegin);
}
- protected void addPreviousSoldEntryToEntries(List<Entry> entriesAndResume, List<Entry> entries, LetteringFilter previousPeriodFilter) {
- // no previous sold to add if selected starting date is same as fiscal period one
- if (!DateUtils.isSameDay(filter.getDateStart(), previousPeriodFilter.getDateStart()) && CollectionUtils.isNotEmpty(entries)) {
- entriesAndResume.add(getFirstLinePreviousSoldEntry(entries, previousPeriodFilter));
- }
+ protected void initSoldPeriodView() {
+ view.getBeginPeriodSummary().setText(String.format("Pour la période du %s au %s,", getDateFormat().format(editModel.getFiscalPeriodBeginDate()), getDateFormat().format(filter.getDateEnd())));
+ view.getBeginDebit().setText(BigDecimalToString.format(BigDecimal.ZERO));
+ view.getBeginCredit().setText(BigDecimalToString.format(BigDecimal.ZERO));
+ view.getBeginSold().setText(BigDecimalToString.format(BigDecimal.ZERO));
+ view.getEndPeriodSummary().setText(String.format("Pour la période du %s au %s,", getDateFormat().format(editModel.getFiscalPeriodBeginDate()), getDateFormat().format(filter.getDateEnd())));
+ view.getEndDebit().setText(BigDecimalToString.format(BigDecimal.ZERO));
+ view.getEndCredit().setText(BigDecimalToString.format(BigDecimal.ZERO));
+ view.getEndSold().setText(BigDecimalToString.format(BigDecimal.ZERO));
}
protected void addFiscalPeriodBeginDate(FiscalPeriod fiscalPeriod) {
@@ -426,45 +442,25 @@ public class AccountViewerViewHandler {
}
}
- protected Entry getFirstLinePreviousSoldEntry(List<Entry> entries, LetteringFilter previousPeriodFilter) {
- Entry firstEntry = entries.get(0);
- FinancialTransaction firstTransaction = firstEntry.getFinancialTransaction();
- FinancialTransaction firstLineTransaction = new FinancialTransactionImpl();
- Binder<FinancialTransaction, FinancialTransaction> binder = BinderFactory.newBinder(FinancialTransaction.class);
- binder.copyExcluding(firstTransaction, firstLineTransaction, FinancialTransaction.PROPERTY_TOPIA_ID);
- Date previousSoldEndDate = getDayMinus1Calendar(previousPeriodFilter).getTime();
- firstLineTransaction.setTransactionDate(previousSoldEndDate);
-
- Entry resumeEntry = new EntryImpl();
- resumeEntry.setDescription(String.format(t("lima.accountViewer.previousSold"), getDateFormat().format(previousSoldEndDate)));
- resumeEntry.setAmount(view.getTableModel().getPreviousPeriodSold().abs());
- resumeEntry.setDebit(BigDecimal.ZERO.compareTo(view.getTableModel().getPreviousPeriodSold()) < 0);
- resumeEntry.setFinancialTransaction(firstLineTransaction);
- return resumeEntry;
- }
-
- protected void addPreviousSoldToModel(LetteringFilter previousPeriodFilter) {
- BigDecimal previousSold;
- if (previousPeriodFilter == null) {
- previousSold = BigDecimal.ZERO;
- } else {
- List<Object[]> initialDebitCredit = financialTransactionService.getAccountEntriesDebitCreditFromIncludingToExcludingPeriod(previousPeriodFilter);
- DebitCreditSold debitCreditSold = new DebitCreditSold().invoke(initialDebitCredit);
- previousSold = debitCreditSold.getSold();
- }
- view.getTableModel().setPreviousPeriodSold(previousSold);
+ protected void setViewPreviousSold(LetteringFilter previousPeriodFilter) {
+ List<Object[]> initialDebitCredit = financialTransactionService.getAccountEntriesDebitCreditFromIncludingToExcludingPeriod(previousPeriodFilter);
+ DebitCreditSold debitCreditSold = new DebitCreditSold().invoke(initialDebitCredit);
+ view.getBeginPeriodSummary().setText(String.format("Pour la période du %s au %s,", getDateFormat().format(previousPeriodFilter.getDateStart()), getDateFormat().format(previousPeriodFilter.getDateEnd())));
+ view.getBeginDebit().setText(BigDecimalToString.format(debitCreditSold.getDebit()));
+ view.getBeginCredit().setText(BigDecimalToString.format(debitCreditSold.getCredit()));
+ view.getBeginSold().setText(BigDecimalToString.format(debitCreditSold.getSold()));
}
- protected void addActualSoldToModel(FiscalPeriod fiscalPeriod, LetteringFilter actualPeriodFilter) {
+ protected void setViewActualSold(FiscalPeriod fiscalPeriod, LetteringFilter actualPeriodFilter) {
addFiscalPeriodBeginDate(fiscalPeriod);
List<Object[]> initialDebitCredit = financialTransactionService.getAccountEntriesDebitCreditFromIncludingToIncludingPeriod(actualPeriodFilter);
DebitCreditSold debitCreditSold = new DebitCreditSold().invoke(initialDebitCredit);
- editModel.setGlobalDebit(debitCreditSold.getDebit());
- editModel.setGlobalCredit(debitCreditSold.getCredit());
- editModel.setGlobalSold(debitCreditSold.getSold());
+ view.getEndPeriodSummary().setText(String.format("Pour la période du %s au %s,", getDateFormat().format(actualPeriodFilter.getDateStart()), getDateFormat().format(actualPeriodFilter.getDateEnd())));
+ view.getEndDebit().setText(BigDecimalToString.format(debitCreditSold.getDebit()));
+ view.getEndCredit().setText(BigDecimalToString.format(debitCreditSold.getCredit()));
+ view.getEndSold().setText(BigDecimalToString.format(debitCreditSold.getSold()));
}
-
public void balanceAndActions() {
if (log.isDebugEnabled()) {
log.debug("balanceAndActions");
@@ -541,27 +537,19 @@ public class AccountViewerViewHandler {
}
protected LetteringFilter computePreviousPeriodFilter(FiscalPeriod fiscalPeriod) {
- LetteringFilter previousPeriodFilter = null;
-
- if (fiscalPeriod != null) {
- previousPeriodFilter = new LetteringFilterImpl();
- previousPeriodFilter.setDateStart(fiscalPeriod.getBeginDate());
- previousPeriodFilter.setDateEnd(filter.getDateStart());
- previousPeriodFilter.setAccount(filter.getAccount());
- }
+ LetteringFilter previousPeriodFilter = new LetteringFilterImpl();
+ previousPeriodFilter.setDateStart(fiscalPeriod == null ? filter.getDateStart() : fiscalPeriod.getBeginDate());
+ previousPeriodFilter.setDateEnd(filter.getDateStart());
+ previousPeriodFilter.setAccount(filter.getAccount());
return previousPeriodFilter;
}
private LetteringFilter computeActualPeriodFilter(FiscalPeriod fiscalPeriod) {
- LetteringFilter actualPeriodFilter = null;
-
- if (fiscalPeriod != null) {
- actualPeriodFilter = new LetteringFilterImpl();
- actualPeriodFilter.setDateStart(fiscalPeriod.getBeginDate());
- actualPeriodFilter.setDateEnd(filter.getDateEnd());
- actualPeriodFilter.setAccount(filter.getAccount());
- }
+ LetteringFilter actualPeriodFilter = new LetteringFilterImpl();
+ actualPeriodFilter.setDateStart(fiscalPeriod == null ? filter.getDateStart() : fiscalPeriod.getBeginDate());
+ actualPeriodFilter.setDateEnd(filter.getDateEnd());
+ actualPeriodFilter.setAccount(filter.getAccount());
return actualPeriodFilter;
}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/FinancialPeriodListRenderer.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/FinancialPeriodListRenderer.java
deleted file mode 100644
index cb1498c..0000000
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/FinancialPeriodListRenderer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * #%L
- * Lima :: Swing
- * %%
- * 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.ui.accountViewer;
-
-import org.chorem.lima.LimaSwingConfig;
-import org.chorem.lima.entity.FinancialPeriod;
-
-import javax.swing.*;
-import java.awt.*;
-import java.text.DateFormat;
-import java.util.Locale;
-
-/**
- * Financial period list renderer.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class FinancialPeriodListRenderer extends DefaultListCellRenderer {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = -1L;
-
- // afiche le mois en lettre et le numero de la période, pour eviter les confusions entre deux mois identique pour des exercice de plus de 12 mois
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value,
- int index, boolean isSelected, boolean cellHasFocus) {
-
- FinancialPeriod financialPeriod = (FinancialPeriod)value;
- Object newValue = financialPeriod;
- if (financialPeriod != null) {
- newValue = String.format("%s - %s", getDateFormat().format(financialPeriod.getBeginDate()), getDateFormat().format(financialPeriod.getEndDate()));
- }
- return super.getListCellRendererComponent(list, newValue, index, isSelected,
- cellHasFocus);
- }
-
- protected DateFormat getDateFormat() {
- Locale locale = LimaSwingConfig.getInstance().getLocale();
- DateFormat result = DateFormat.getDateInstance(DateFormat.SHORT, locale);
- return result;
- }
-
-}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
index 027dff2..20e358a 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
@@ -307,8 +307,8 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo
if ( event.getStateChange() == ItemEvent.SELECTED ) {
FiscalPeriod selectedFiscalPeriod = (FiscalPeriod) event.getItem();
- List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriods(selectedFiscalPeriod.getBeginDate(),
- selectedFiscalPeriod.getEndDate());
+ List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriodsWithBeginDateWithin(selectedFiscalPeriod.getBeginDate(),
+ selectedFiscalPeriod.getEndDate());
if (log.isDebugEnabled()) {
log.debug(String.format("Loaded %d financial periods", financialPeriods.size()));
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
index da2a007..d35494e 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
@@ -15,6 +15,7 @@ lima.account.remove.error.usedAccount=There are financial statement on this acco
lima.account.update.error.invalidAccountNumber=Invalid account number\: %1$s
lima.account.update.form=Update account
lima.accountViewer.previousSold=<html><b>On %s the sold was</b></html>
+lima.accountViewer.selectionDescription=For selected entries,
lima.accounts=Accounts
lima.action.commandline.help=Show help in console
lima.balance=Balance
@@ -533,6 +534,7 @@ lima.table.letter=Letter
lima.table.locked=Loked
lima.table.number=Account Number
lima.table.provisionDeprecation=Provision Deprecation
+lima.table.sold=
lima.table.voucher=Voucher
lima.title=Lutin Invoice Monitoring and Accounting
lima.transaction=Transaction
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
index 9a5adac..7a76b10 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
@@ -17,7 +17,8 @@ lima.account.remove.confirm.title=Suppression d'un compte
lima.account.remove.error.usedAccount=Il exist des transactions sur ce compte
lima.account.update.error.invalidAccountNumber=Le numéro du compte %1$s n'est pas valide
lima.account.update.form=Modification d'un compte
-lima.accountViewer.previousSold=Solde au %s
+lima.accountViewer.previousSold=<html><b>Solde au %s</b></html>
+lima.accountViewer.selectionDescription=Pour la sélection,
lima.accounts=Comptes
lima.action.commandline.help=Afficher l'aide en console
lima.balance=Équilibrer
@@ -469,8 +470,6 @@ lima.lettering.account=Comptes
lima.lettering.account.aAll=TOUS
lima.lettering.account.back=←
lima.lettering.account.next=→
-lima.lettering.accountViewerBalanceStatus=<html>Période du <b>%s</b> au <b>%s</b>\: solde \=<b>%s - %s \= %s</b> - Pour la sélection le solde est\: <b>%s - %s \= %s</b>
-lima.lettering.balanceStatus=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b>
lima.lettering.accountViewerBalanceStatus=<html>Pour la période du %s au %s\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b> - Pour la sélection\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b>
lima.lettering.balanceStatus=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b>. Entrées sélectionnées\: Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b>
lima.lettering.checkAll=Toutes
@@ -541,6 +540,7 @@ lima.table.letter=Lettre
lima.table.locked=Clos
lima.table.number=Numéro de compte
lima.table.provisionDeprecation=Amortissements et provisions
+lima.table.sold=
lima.table.voucher=Pièce comptable
lima.title=Lutin Invoice Monitoring and Accounting
lima.transaction=Transaction
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
0
This is an automated email from the git hooks/post-receive script.
New commit to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
commit 7b3c5c4c771ed690e6d0b5b128c1c6a0e81c4ff1
Author: dcosse <cosse(a)codelutin.com>
Date: Sun Sep 20 00:49:12 2015 +0200
refs #1293 correction i18n
---
lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties | 6 +++---
lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
index 9ad9420..da2a007 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
@@ -226,9 +226,9 @@ lima.filter=Filter
lima.filter.account=Add account filter
lima.filter.condition.all=Valid all criteria
lima.filter.condition.one=Valid at least one criteria
-lima.filter.condition.periodChoice.date=
-lima.filter.condition.periodChoice.financialPeriod=
-lima.filter.condition.periodChoice.fiscalPeriod=
+lima.filter.condition.periodChoice.date=Date interval
+lima.filter.condition.periodChoice.financialPeriod=Financial period
+lima.filter.condition.periodChoice.fiscalPeriod=Fiscal period
lima.filter.condition.selectionMode=Balance entry selection
lima.filter.condition.selectionMode.lettered=Lettered
lima.filter.condition.selectionMode.manual=Manual
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
index 7a84f05..9a5adac 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
@@ -236,9 +236,9 @@ lima.filter.account=Ajouter un filtre sur les comptes
lima.filter.condition.all=Valide toutes les conditions
lima.filter.condition.delete=Supprimer la condition
lima.filter.condition.one=Valide au moins une condition
-lima.filter.condition.periodChoice.date=Dates
-lima.filter.condition.periodChoice.financialPeriod=Périodes fiscales
-lima.filter.condition.periodChoice.fiscalPeriod=Execrices
+lima.filter.condition.periodChoice.date=Interval de Dates
+lima.filter.condition.periodChoice.financialPeriod=Période Financière
+lima.filter.condition.periodChoice.fiscalPeriod=Execrice
lima.filter.condition.selectionMode=Sélection des écritures lettrées
lima.filter.condition.selectionMode.lettered=Lettré
lima.filter.condition.selectionMode.manual=Manuelle
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
0
09/19: refs #1293 Ajout de la possibilité de choisir une consultation de compte pour un exercice, une période financière ou un interval de dates
by chorem.org scm 30 Nov '15
by chorem.org scm 30 Nov '15
30 Nov '15
This is an automated email from the git hooks/post-receive script.
New commit to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
commit 367ef5f73641745d3e01ddf924c1fdbe0e64b7f5
Author: dcosse <cosse(a)codelutin.com>
Date: Sun Sep 20 00:38:53 2015 +0200
refs #1293 Ajout de la possibilité de choisir une consultation de compte pour un exercice, une période financière ou un interval de dates
---
.../accountViewer/AccountViewerSelectionModel.java | 12 +-
.../lima/ui/accountViewer/AccountViewerView.css | 24 +-
.../lima/ui/accountViewer/AccountViewerView.jaxx | 168 +++++-----
.../ui/accountViewer/AccountViewerViewHandler.java | 350 +++++++++++++--------
.../accountViewer/FinancialPeriodListRenderer.java | 68 ++++
.../chorem/lima/ui/accountViewer/PeriodChoice.java | 34 ++
.../ui/combobox/FiscalPeriodComboBoxModel.java | 2 +-
.../lima/ui/common/FiscalPeriodComboBoxModel.java | 12 +
.../resources/i18n/lima-swing_en_GB.properties | 3 +
.../resources/i18n/lima-swing_fr_FR.properties | 3 +
10 files changed, 466 insertions(+), 210 deletions(-)
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerSelectionModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerSelectionModel.java
index 5199a0b..4a24d0c 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerSelectionModel.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerSelectionModel.java
@@ -38,7 +38,7 @@ public class AccountViewerSelectionModel extends DefaultListSelectionModel{
protected Entry entry;
protected int lineSelected;
- protected boolean balancedSelectionMode;
+ protected boolean letteredSelectionMode;
protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
public AccountViewerSelectionModel(AccountViewerTableModel letteringTableModel){
@@ -52,7 +52,7 @@ public class AccountViewerSelectionModel extends DefaultListSelectionModel{
@Override
public void setSelectionInterval(int row, int column) {
- if (balancedSelectionMode) {
+ if (letteredSelectionMode) {
if (!letteringNotExist(row)) {
//lettred entries
@@ -151,12 +151,12 @@ public class AccountViewerSelectionModel extends DefaultListSelectionModel{
firePropertyChange(propertyName, null, newValue);
}
- public void setBalancedSelectionMode(boolean balancedSelectionMode) {
- this.balancedSelectionMode = balancedSelectionMode;
+ public void setLetteredSelectionMode(boolean letteredSelectionMode) {
+ this.letteredSelectionMode = letteredSelectionMode;
clearSelection();
}
- public boolean getBalancedSelectionMode() {
- return balancedSelectionMode;
+ public boolean getLetteredSelectionMode() {
+ return letteredSelectionMode;
}
}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
index f0bd618..07b91f7 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
@@ -48,15 +48,37 @@
}
#beginPeriodLabel {
+ visible : {PeriodChoice.DATE.equals(periodChoice)};
text : "lima.lettering.period.begin";
labelFor : {beginPeriodPicker};
}
+#beginPeriodPicker {
+ visible : {PeriodChoice.DATE.equals(periodChoice)};
+}
+
#endPeriodLabel {
+ visible : {PeriodChoice.DATE.equals(periodChoice)};
text : "lima.lettering.period.end";
labelFor : {endPeriodPicker};
}
+#endPeriodPicker {
+ visible : {PeriodChoice.DATE.equals(periodChoice)};
+}
+
+#fiscalPeriodComboBox {
+ visible : {PeriodChoice.FISCAL_PERIOD.equals(periodChoice)};
+ toolTipText : "lima.entries.fiscalYear";
+ renderer : "{new org.chorem.lima.ui.common.FiscalPeriodListRenderer()}";
+}
+
+#financialPeriodComboBox {
+ preferredSize : {new Dimension(200, 22)};
+ toolTipText : "lima.entries.financialPeriod";
+ renderer : "{new org.chorem.lima.ui.accountViewer.FinancialPeriodListRenderer()}";
+}
+
#refresh {
toolTipText : "lima.lettering.refresh";
actionIcon : "refresh";
@@ -69,5 +91,5 @@
#balanceStatusLabel {
horizontalTextPosition:{JLabel.RIGHT};
- border: {BorderFactory.createEmptyBorder(0, 0, 0, 20)}
+ border: {BorderFactory.createEmptyBorder(0, 0, 0, 20)};
}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
index 8b46423..e615d60 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
@@ -20,83 +20,103 @@
<JPanel layout="{new BorderLayout()}">
- <import>
- java.awt.Dimension
- org.chorem.lima.util.WrapToolBarLayout
- org.chorem.lima.ui.common.FinancialPeriodComboBoxModel
- org.chorem.lima.util.BigDecimalToString
- org.chorem.lima.ui.lettering.TypeEntry
- org.chorem.lima.entity.Account
- javax.swing.ListSelectionModel
- org.jdesktop.swingx.JXDatePicker
- static org.nuiton.i18n.I18n.t
- org.chorem.lima.ui.combobox.AccountComboBox
- </import>
-
- <AccountViewerViewHandler id="handler" constructorParams="this"/>
-
- <AccountViewerEditModel id='editModel'/>
-
- <script>
- <![CDATA[
+ <import>
+ java.awt.Dimension
+ org.chorem.lima.util.WrapToolBarLayout
+ org.chorem.lima.ui.common.FinancialPeriodComboBoxModel
+ org.chorem.lima.util.BigDecimalToString
+ org.chorem.lima.ui.lettering.TypeEntry
+ org.chorem.lima.entity.Account
+ javax.swing.ListSelectionModel
+ org.jdesktop.swingx.JXDatePicker
+ static org.nuiton.i18n.I18n.t
+ org.chorem.lima.ui.combobox.AccountComboBox
+ org.chorem.lima.ui.LimaRendererUtil
+ org.chorem.lima.entity.FinancialPeriod
+ </import>
+
+ <AccountViewerViewHandler id="handler" constructorParams="this"/>
+
+ <AccountViewerEditModel id='editModel'/>
+
+ <script>
+ <![CDATA[
void $afterCompleteSetup() {
handler.init();
}
]]>
- </script>
-
- <JToolBar styleClass="toolbar"
- constraints="BorderLayout.PAGE_START"
- layout="{new WrapToolBarLayout()}">
-
- <JLabel id="accountLabel"/>
- <AccountComboBox id="accountComboBox"
- constraints="BorderLayout.CENTER"
- onPropertyChange="{getHandler().accountComboBoxChange(event);}"/>
- <JButton id="back"
- onActionPerformed="handler.back(accountComboBox)"/>
- <JButton id="next"
- onActionPerformed="handler.next(accountComboBox)"/>
-
- <JToolBar.Separator/>
-
- <JLabel id="beginPeriodLabel"/>
- <JAXXDatePicker id="beginPeriodPicker"
- constructorParams="handler.getLocale()"
- formats="{handler.getDateFormat()}"
- onPropertyChange="handler.setDateStart(beginPeriodPicker.getDate())"/>
-
- <JLabel id="endPeriodLabel"/>
- <JAXXDatePicker id="endPeriodPicker"
- constructorParams="handler.getLocale()"
- formats="{handler.getDateFormat()}"
- onPropertyChange="handler.setDateEnd(endPeriodPicker.getDate())"/>
-
- <JToolBar.Separator/>
-
- <JLabel id='balancedSelectionModeLabel' actionIcon='selection-mode'/>
- <EnumEditor id='balancedSelectionMode'
- genericType='SelectionMode'
- constructorParams='SelectionMode.class'
- onItemStateChanged="handler.onSelectionModeChanged(balancedSelectionMode.getSelectedItem())" />
-
- <JButton id="refresh"
- onActionPerformed="handler.updateAllEntries()"/>
-
- </JToolBar>
- <JScrollPane constraints="BorderLayout.CENTER">
- <AccountViewerTableModel id="tableModel"/>
- <AccountViewerSelectionModel id='accountViewerSelectionModel' constructorParams='tableModel'
- onValueChanged="handler.balanceAndActions()"/>
-
- <AccountViewerTable id="table"
- constructorParams="handler"
- model="{tableModel}"
- selectionModel="{accountViewerSelectionModel}"/>
- </JScrollPane>
-
- <JPanel constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}">
- <JLabel id='balanceStatusLabel' constraints="BorderLayout.EAST"/>
- </JPanel>
+ </script>
+
+ <JToolBar styleClass="toolbar"
+ constraints="BorderLayout.PAGE_START"
+ layout="{new WrapToolBarLayout()}">
+
+ <JLabel id="accountLabel"/>
+ <AccountComboBox id="accountComboBox"
+ constraints="BorderLayout.CENTER"
+ onPropertyChange="handler.onAccountChange(event)"/>
+
+ <JButton id="back"
+ onActionPerformed="handler.onBackChange(accountComboBox)"/>
+ <JButton id="next"
+ onActionPerformed="handler.onNextChange(accountComboBox)"/>
+
+ <JToolBar.Separator/>
+
+ <JLabel id='periodChoiceLabel' actionIcon='choose-fiscal-year'/>
+ <EnumEditor id='periodChoice'
+ genericType='PeriodChoice'
+ constructorParams='PeriodChoice.class'
+ onItemStateChanged="handler.onPeriodChoiceChanged(periodChoice.getSelectedItem())"/>
+
+ <JLabel id="beginPeriodLabel"/>
+
+ <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="fiscalPeriodComboBoxModel"/>
+ <JComboBox id="fiscalPeriodComboBox"
+ model="{fiscalPeriodComboBoxModel}"
+ onItemStateChanged="handler.onFiscalPeriodChange(event)"/>
+
+ <org.chorem.lima.ui.common.FinancialPeriodComboBoxModel id="financialPeriodComboBoxModel"/>
+ <JComboBox id="financialPeriodComboBox"
+ model="{financialPeriodComboBoxModel}"
+ onItemStateChanged="handler.onFinancialPeriodChange(event)"/>
+
+ <JAXXDatePicker id="beginPeriodPicker"
+ constructorParams="handler.getLocale()"
+ formats="{handler.getDateFormat()}"
+ onPropertyChange="handler.onDateStartChange(beginPeriodPicker.getDate())"/>
+
+ <JLabel id="endPeriodLabel"/>
+
+ <JAXXDatePicker id="endPeriodPicker"
+ constructorParams="handler.getLocale()"
+ formats="{handler.getDateFormat()}"
+ onPropertyChange="handler.onDateEndChange(endPeriodPicker.getDate())"/>
+ <JToolBar.Separator/>
+
+ <JLabel id='selectionModeLabel' actionIcon='selection-mode'/>
+ <EnumEditor id='letteredSelectionMode'
+ genericType='SelectionMode'
+ constructorParams='SelectionMode.class'
+ onItemStateChanged="handler.onSelectionModeChanged(letteredSelectionMode.getSelectedItem())"/>
+
+ <JButton id="refresh"
+ onActionPerformed="handler.updateAllEntries(null)"/>
+
+ </JToolBar>
+ <JScrollPane constraints="BorderLayout.CENTER">
+ <AccountViewerTableModel id="tableModel"/>
+ <AccountViewerSelectionModel id='accountViewerSelectionModel' constructorParams='tableModel'
+ onValueChanged="handler.balanceAndActions()"/>
+
+ <AccountViewerTable id="table"
+ constructorParams="handler"
+ model="{tableModel}"
+ selectionModel="{accountViewerSelectionModel}"/>
+ </JScrollPane>
+
+ <JPanel constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}">
+ <JLabel id='balanceStatusLabel' constraints="BorderLayout.EAST"/>
+ </JPanel>
</JPanel>
\ No newline at end of file
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
index f74ba39..50a17a0 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
@@ -40,6 +40,7 @@ import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryImpl;
+import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.entity.FiscalPeriod;
@@ -58,7 +59,9 @@ import java.beans.PropertyChangeListener;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Calendar;
+import java.util.Collection;
import java.util.Date;
+import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -116,7 +119,7 @@ public class AccountViewerViewHandler {
public void init() {
filter = new LetteringFilterImpl();
editModel = view.getEditModel();
- loadComboAndRows();
+ initViewWithDefaultFinancialPeriod();
editModel.addPropertyChangeListener(AccountViewerEditModel.PROPERTY_DEBIT, new PropertyChangeListener() {
@Override
@@ -154,27 +157,10 @@ public class AccountViewerViewHandler {
SwingUtil.fixTableColumnWidth(view.getTable(), 4, 50);
initializationComplete = true;
- updateAllEntries();
+ updateAllEntries(null);
updateSoldStatus();
}
- public void updateSoldStatus() {
- if (initializationComplete) {
- view.getBalanceStatusLabel().setText(t("lima.lettering.accountViewerBalanceStatus",
- getDateFormat().format(editModel.getFiscalPeriodBeginDate()),
- getDateFormat().format(filter.getDateEnd()),
-
- BigDecimalToString.format(editModel.getGlobalDebit()),
- BigDecimalToString.format(editModel.getGlobalCredit()),
- BigDecimalToString.format(editModel.getGlobalSold()),
-
- BigDecimalToString.format(editModel.getDebit()),
- BigDecimalToString.format(editModel.getCredit()),
- BigDecimalToString.format(editModel.getSold())));
- }
- }
-
-
protected void initShortCuts() {
InputMap inputMap= view.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
@@ -193,40 +179,160 @@ public class AccountViewerViewHandler {
@Override
public void actionPerformed(ActionEvent e) {
- updateAllEntries();
+ updateAllEntries(null);
}
});
}
- public void loadComboAndRows(){
+ public void onAccountChange(PropertyChangeEvent event) {
+ if (initializationComplete) {
+ if (event.getPropertyName().equals(AccountComboBox.PROPERTY_SELECTED_ITEM) && event.getNewValue() != null && event.getNewValue() instanceof Account) {
+ setAccount((Account) event.getNewValue());
+ }
+ }
+ }
- //By default, we have the beginning of the fiscal period (Or of current
- //date if no fiscal period) and the end of the current fiscal period
- FiscalPeriod fiscalPeriod = fiscalPeriodService.getLastFiscalPeriod();
- Date defaultDateBegFiscalPeriod, defaultDateEndCurrent;
+ protected void onPeriodChoiceChanged(PeriodChoice periodChoice) {
+ if (initializationComplete) {
+ switch (periodChoice) {
+ case FINANCIAL_PERIOD:
+ view.getFiscalPeriodComboBox().setVisible(false);
+ view.getFinancialPeriodComboBox().setVisible(true);
+ view.getBeginPeriodPicker().setVisible(false);
+ view.getEndPeriodPicker().setVisible(false);
+ initViewWithDefaultFinancialPeriod();
+ break;
+ case FISCAL_PERIOD:
+ view.getFiscalPeriodComboBox().setVisible(true);
+ view.getFinancialPeriodComboBox().setVisible(false);
+ view.getBeginPeriodPicker().setVisible(false);
+ view.getEndPeriodPicker().setVisible(false);
+ initFiscalPeriodModel();
+ break;
+ case DATE:
+ view.getFiscalPeriodComboBox().setVisible(false);
+ view.getFinancialPeriodComboBox().setVisible(false);
+ view.getBeginPeriodPicker().setVisible(true);
+ view.getEndPeriodPicker().setVisible(true);
+ break;
+ }
+ updateAllEntries(null);
+ }
+ }
- Calendar calendar = Calendar.getInstance();
- int lastCurrentMonthDay = calendar.getActualMaximum(Calendar.DATE);
- int firstCurrentMonthDay = calendar.getActualMinimum(Calendar.DATE);
+ /**
+ * Select previous value in combo box.
+ *
+ * @param accountComboBox account combo box
+ */
+ public void onBackChange(AccountComboBox accountComboBox) {
+ if (initializationComplete) {
+ JComboBox comboBox = accountComboBox.getCombobox();
+ int row = comboBox.getSelectedIndex();
- if (fiscalPeriod != null){
- defaultDateBegFiscalPeriod = fiscalPeriod.getBeginDate();
- defaultDateEndCurrent = fiscalPeriod.getEndDate();
- } else{
- defaultDateBegFiscalPeriod = DateUtils.setDays(new Date(), firstCurrentMonthDay);
- defaultDateEndCurrent = DateUtils.setDays(new Date(), lastCurrentMonthDay);
+ if (row > 0) {
+ comboBox.setSelectedIndex(row - 1);
+ }
+ view.getAccountViewerSelectionModel().clearSelection();
}
+ }
- view.getBeginPeriodPicker().setDate(defaultDateBegFiscalPeriod);
- view.getEndPeriodPicker().setDate(defaultDateEndCurrent);
+ /**
+ * Select next value in combo box.
+ *
+ * @param accountComboBox combo box
+ */
+ public void onNextChange(AccountComboBox accountComboBox) {
+ if (initializationComplete) {
+ JComboBox comboBox = accountComboBox.getCombobox();
+ int size = comboBox.getItemCount();
+ int row = comboBox.getSelectedIndex();
- editModel.setFiscalPeriodBeginDate(defaultDateBegFiscalPeriod);
+ if (row < size - 1) {
+ comboBox.setSelectedIndex(row + 1);
+ }
+ view.getAccountViewerSelectionModel().clearSelection();
+ }
+ }
- filter.setDateStart(defaultDateBegFiscalPeriod);
- filter.setDateEnd(defaultDateEndCurrent);
+ protected void onFiscalPeriodChange(java.awt.event.ItemEvent event) {
+ if (initializationComplete) {
+ FiscalPeriod fiscalPeriod = (FiscalPeriod) event.getItem();
+ updateAllEntriesForFiscalPeriodChange(fiscalPeriod);
+ }
}
- public void updateAllEntries() {
+
+ protected void onFinancialPeriodChange(java.awt.event.ItemEvent event) {
+ if (initializationComplete) {
+ FinancialPeriod financialPeriod = (FinancialPeriod) event.getItem();
+ updateAllEntriesForFinancialPeriodChange(financialPeriod);
+ }
+ }
+
+ public void onDateStartChange(Date date) {
+ if (initializationComplete) {
+ filter.setDateStart(date);
+ updateAllEntriesForDateChange();
+ }
+ }
+
+ public void onDateEndChange(Date date) {
+ if (initializationComplete) {
+ filter.setDateEnd(date);
+ updateAllEntriesForDateChange();
+ }
+ }
+
+ public void onSelectionModeChanged(SelectionMode selectionMode) {
+
+ switch (selectionMode) {
+ case LETTERED:
+ view.getAccountViewerSelectionModel().setLetteredSelectionMode(true);
+ break;
+ case MANUAL:
+ view.getAccountViewerSelectionModel().setLetteredSelectionMode(false);
+ break;
+ default:
+ view.getAccountViewerSelectionModel().setLetteredSelectionMode(true);
+ }
+ }
+
+ public void updateSoldStatus() {
+ if (initializationComplete) {
+ view.getBalanceStatusLabel().setText(t("lima.lettering.accountViewerBalanceStatus",
+ getDateFormat().format(editModel.getFiscalPeriodBeginDate()),
+ getDateFormat().format(filter.getDateEnd()),
+
+ BigDecimalToString.format(editModel.getGlobalDebit()),
+ BigDecimalToString.format(editModel.getGlobalCredit()),
+ BigDecimalToString.format(editModel.getGlobalSold()),
+
+ BigDecimalToString.format(editModel.getDebit()),
+ BigDecimalToString.format(editModel.getCredit()),
+ BigDecimalToString.format(editModel.getSold())));
+ }
+ }
+
+
+ public void updateAllEntriesForFiscalPeriodChange(FiscalPeriod fiscalPeriod) {
+ filter.setDateStart(fiscalPeriod.getBeginDate());
+ filter.setDateEnd(fiscalPeriod.getEndDate());
+
+ updateAllEntries(fiscalPeriod);
+ }
+
+ public void updateAllEntriesForFinancialPeriodChange(FinancialPeriod financialPeriod) {
+ filter.setDateStart(financialPeriod.getBeginDate());
+ filter.setDateEnd(financialPeriod.getEndDate());
+ updateAllEntries(null);
+ }
+
+ public void updateAllEntriesForDateChange() {
+ updateAllEntries(null);
+ }
+
+ public void updateAllEntries(FiscalPeriod fiscalPeriod) {
if (initializationComplete
&& filter.getAccount() != null
@@ -236,7 +342,7 @@ public class AccountViewerViewHandler {
List<Entry> entriesAndResume = Lists.newArrayList();
List<Entry> entries = financialTransactionService.getAllEntrieByDatesAndAccountAndLettering(filter);
- FiscalPeriod fiscalPeriod = fiscalPeriodService.getFiscalPeriodForDate(filter.getDateStart());
+ fiscalPeriod = fiscalPeriod == null ? fiscalPeriodService.getFiscalPeriodForDate(filter.getDateStart()) : fiscalPeriod;
if (CollectionUtils.isNotEmpty(entries)) {
// can be null if there are no fiscal period for the begin date
@@ -255,6 +361,58 @@ public class AccountViewerViewHandler {
onBalanceChanged(null);
}
+ public void initFiscalPeriodModel() {
+ FiscalPeriod fiscalPeriod = fiscalPeriodService.getLastFiscalPeriod();
+ if (fiscalPeriod != null) {
+ view.getFiscalPeriodComboBox().setSelectedItem(fiscalPeriod);
+ view.getBeginPeriodPicker().setDate(fiscalPeriod.getBeginDate());
+ view.getEndPeriodPicker().setDate(fiscalPeriod.getEndDate());
+ }
+ }
+
+ public void initViewWithDefaultFinancialPeriod() {
+ List<FinancialPeriod> financialPeriods = financialPeriodService.getAllFinancialPeriods();
+ view.getFinancialPeriodComboBoxModel().setObjects(financialPeriods);
+
+ FiscalPeriod fiscalPeriod = fiscalPeriodService.getLastFiscalPeriod();
+
+ FinancialPeriod defaultFinancialPeriod = getDefaultFinancialPeriod(financialPeriods, fiscalPeriod);
+
+ Calendar calendar = Calendar.getInstance();
+ int lastCurrentMonthDay = calendar.getActualMaximum(Calendar.DATE);
+ int firstCurrentMonthDay = calendar.getActualMinimum(Calendar.DATE);
+
+ Date defaultDateBeginFinancialPeriod, defaultDateEndCurrent;
+ defaultDateBeginFinancialPeriod = defaultFinancialPeriod == null ? DateUtils.setDays(new Date(), firstCurrentMonthDay) : defaultFinancialPeriod.getBeginDate();
+ defaultDateEndCurrent = defaultFinancialPeriod == null ? DateUtils.setDays(new Date(), lastCurrentMonthDay) : defaultFinancialPeriod.getEndDate();
+
+ view.getFinancialPeriodComboBoxModel().setSelectedItem(defaultFinancialPeriod);
+
+ view.getBeginPeriodPicker().setDate(defaultDateBeginFinancialPeriod);
+ view.getEndPeriodPicker().setDate(defaultDateEndCurrent);
+
+ filter.setDateStart(defaultDateBeginFinancialPeriod);
+ filter.setDateEnd(defaultDateEndCurrent);
+
+ editModel.setFiscalPeriodBeginDate(fiscalPeriod != null ? fiscalPeriod.getBeginDate() : defaultDateBeginFinancialPeriod);
+ }
+
+ protected FinancialPeriod getDefaultFinancialPeriod(List<FinancialPeriod> financialPeriods, FiscalPeriod fiscalPeriod) {
+ FinancialPeriod defaultFinancialPeriod = null;
+
+ if ((fiscalPeriod != null && fiscalPeriod.getFinancialPeriod() != null)) {
+
+ Collection<FinancialPeriod> fiscalPeriodFinancialPeriods = financialPeriodService.getFinancialPeriods(fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate());
+ Iterator<FinancialPeriod> financialPeriodIterator = fiscalPeriodFinancialPeriods.iterator();
+ if (financialPeriodIterator.hasNext()) {
+ defaultFinancialPeriod = financialPeriodIterator.next();
+ }
+ }
+
+ defaultFinancialPeriod = defaultFinancialPeriod != null ? defaultFinancialPeriod : CollectionUtils.isNotEmpty(financialPeriods) ? financialPeriods.get(0) : null;
+ return defaultFinancialPeriod;
+ }
+
protected void addPreviousSoldEntryToEntries(List<Entry> entriesAndResume, List<Entry> entries, LetteringFilter previousPeriodFilter) {
// no previous sold to add if selected starting date is same as fiscal period one
if (!DateUtils.isSameDay(filter.getDateStart(), previousPeriodFilter.getDateStart()) && CollectionUtils.isNotEmpty(entries)) {
@@ -382,13 +540,6 @@ public class AccountViewerViewHandler {
}
}
- protected Calendar getDayMinus1Calendar(LetteringFilter previousPeriodFilter) {
- Calendar cal = Calendar.getInstance();
- cal.setTime(previousPeriodFilter.getDateEnd());
- cal.add(Calendar.DATE, -1);
- return cal;
- }
-
protected LetteringFilter computePreviousPeriodFilter(FiscalPeriod fiscalPeriod) {
LetteringFilter previousPeriodFilter = null;
@@ -415,86 +566,6 @@ public class AccountViewerViewHandler {
return actualPeriodFilter;
}
- public void accountComboBoxChange(PropertyChangeEvent event) {
- if (event.getPropertyName().equals(AccountComboBox.PROPERTY_SELECTED_ITEM) && event.getNewValue() != null && event.getNewValue() instanceof Account) {
- setAccount((Account) event.getNewValue());
- }
- }
-
- /**
- * Select previous value in combo box.
- *
- * @param accountComboBox account combo box
- */
- public void back(AccountComboBox accountComboBox) {
- JComboBox comboBox = accountComboBox.getCombobox();
- int row = comboBox.getSelectedIndex();
-
- if (row > 0) {
- comboBox.setSelectedIndex(row - 1);
- }
- view.getAccountViewerSelectionModel().clearSelection();
- }
-
- /**
- * Select next value in combo box.
- *
- * @param accountComboBox combo box
- */
- public void next(AccountComboBox accountComboBox) {
- JComboBox comboBox = accountComboBox.getCombobox();
- int size = comboBox.getItemCount();
- int row = comboBox.getSelectedIndex();
-
- if (row < size - 1) {
- comboBox.setSelectedIndex(row + 1);
- }
- view.getAccountViewerSelectionModel().clearSelection();
- }
-
- public void setDateStart(Date date) {
- if (initializationComplete) {
- filter.setDateStart(date);
- updateAllEntries();
- }
- }
-
- public void setDateEnd(Date date) {
- if (initializationComplete) {
- filter.setDateEnd(date);
- updateAllEntries();
- }
- }
-
- public void setAccount(Account account) {
- if (filter != null) {
- filter.setAccount(account);
- updateAllEntries();
- }
- }
-
- public Account getAccount() {
- Account account = null;
- if (filter != null) {
- account = filter.getAccount();
- }
- return account;
- }
-
- public void onSelectionModeChanged(SelectionMode selectionMode) {
-
- switch (selectionMode) {
- case LETTERED:
- view.getAccountViewerSelectionModel().setBalancedSelectionMode(true);
- break;
- case MANUAL:
- view.getAccountViewerSelectionModel().setBalancedSelectionMode(false);
- break;
- default:
- view.getAccountViewerSelectionModel().setBalancedSelectionMode(true);
- }
- }
-
protected class DebitCreditSold {
private BigDecimal debit;
private BigDecimal credit;
@@ -535,6 +606,29 @@ public class AccountViewerViewHandler {
}
}
+ public void setAccount(Account account) {
+ if (filter != null) {
+ filter.setAccount(account);
+ updateAllEntries(null);
+ }
+ }
+
+ public Account getAccount() {
+ Account account = null;
+ if (filter != null) {
+ account = filter.getAccount();
+ }
+ return account;
+ }
+
+ protected Calendar getDayMinus1Calendar(LetteringFilter previousPeriodFilter) {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(previousPeriodFilter.getDateEnd());
+ cal.add(Calendar.DATE, -1);
+ return cal;
+ }
+
+
protected DateFormat getDateFormat() {
Locale locale = LimaSwingConfig.getInstance().getLocale();
DateFormat result = DateFormat.getDateInstance(DateFormat.SHORT, locale);
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/FinancialPeriodListRenderer.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/FinancialPeriodListRenderer.java
new file mode 100644
index 0000000..cb1498c
--- /dev/null
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/FinancialPeriodListRenderer.java
@@ -0,0 +1,68 @@
+/*
+ * #%L
+ * Lima :: Swing
+ * %%
+ * 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.ui.accountViewer;
+
+import org.chorem.lima.LimaSwingConfig;
+import org.chorem.lima.entity.FinancialPeriod;
+
+import javax.swing.*;
+import java.awt.*;
+import java.text.DateFormat;
+import java.util.Locale;
+
+/**
+ * Financial period list renderer.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FinancialPeriodListRenderer extends DefaultListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -1L;
+
+ // afiche le mois en lettre et le numero de la période, pour eviter les confusions entre deux mois identique pour des exercice de plus de 12 mois
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ FinancialPeriod financialPeriod = (FinancialPeriod)value;
+ Object newValue = financialPeriod;
+ if (financialPeriod != null) {
+ newValue = String.format("%s - %s", getDateFormat().format(financialPeriod.getBeginDate()), getDateFormat().format(financialPeriod.getEndDate()));
+ }
+ return super.getListCellRendererComponent(list, newValue, index, isSelected,
+ cellHasFocus);
+ }
+
+ protected DateFormat getDateFormat() {
+ Locale locale = LimaSwingConfig.getInstance().getLocale();
+ DateFormat result = DateFormat.getDateInstance(DateFormat.SHORT, locale);
+ return result;
+ }
+
+}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/PeriodChoice.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/PeriodChoice.java
new file mode 100644
index 0000000..cc8ade3
--- /dev/null
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/PeriodChoice.java
@@ -0,0 +1,34 @@
+package org.chorem.lima.ui.accountViewer;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * Created by davidcosse on 15/09/15.
+ */
+public enum PeriodChoice {
+
+ FINANCIAL_PERIOD, FISCAL_PERIOD, DATE;
+
+ @Override
+ public String toString() {
+
+ String result;
+
+ switch (this) {
+ case FINANCIAL_PERIOD:
+ result = t("lima.filter.condition.periodChoice.financialPeriod");
+ break;
+ case FISCAL_PERIOD:
+ result = t("lima.filter.condition.periodChoice.fiscalPeriod");
+ break;
+ case DATE:
+ result = t("lima.filter.condition.periodChoice.date");
+ break;
+ default:
+ result = t("lima.filter.condition.periodChoice.financialPeriod");
+ }
+
+ return result;
+
+ }
+}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java
index 9a2a118..36986d0 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java
@@ -86,7 +86,7 @@ public class FiscalPeriodComboBoxModel extends AbstractListModel implements Comb
return selectedFiscalPeriod;
}
- //get unblocked fiscal periods data list
+ //get unblocked fiscal periods data list
public List<FiscalPeriod> getDataList() {
List<FiscalPeriod> result = fiscalPeriodService.getAllUnblockedFiscalPeriods();
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java
index d0ff510..27c38f2 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java
@@ -38,4 +38,16 @@ public class FiscalPeriodComboBoxModel extends GenericComboBoxModel<FiscalPeriod
/** serialVersionUID. */
private static final long serialVersionUID = 3017195549616278980L;
+ /*By default, selection of the first financial period (Because a
+* transaction concern one financial period)
+*/
+ @Override
+ public Object getElementAt(int index) {
+ if (getSelectedItem() == null){
+ setSelectedItem(objects.get(0));
+ return objects.get(0);
+ }
+ return objects.get(index);
+ }
+
}
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
index 588228c..9ad9420 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
@@ -226,6 +226,9 @@ lima.filter=Filter
lima.filter.account=Add account filter
lima.filter.condition.all=Valid all criteria
lima.filter.condition.one=Valid at least one criteria
+lima.filter.condition.periodChoice.date=
+lima.filter.condition.periodChoice.financialPeriod=
+lima.filter.condition.periodChoice.fiscalPeriod=
lima.filter.condition.selectionMode=Balance entry selection
lima.filter.condition.selectionMode.lettered=Lettered
lima.filter.condition.selectionMode.manual=Manual
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
index 7a29d75..7a84f05 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
@@ -236,6 +236,9 @@ lima.filter.account=Ajouter un filtre sur les comptes
lima.filter.condition.all=Valide toutes les conditions
lima.filter.condition.delete=Supprimer la condition
lima.filter.condition.one=Valide au moins une condition
+lima.filter.condition.periodChoice.date=Dates
+lima.filter.condition.periodChoice.financialPeriod=Périodes fiscales
+lima.filter.condition.periodChoice.fiscalPeriod=Execrices
lima.filter.condition.selectionMode=Sélection des écritures lettrées
lima.filter.condition.selectionMode.lettered=Lettré
lima.filter.condition.selectionMode.manual=Manuelle
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
0
This is an automated email from the git hooks/post-receive script.
New commit to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
commit d746f2e8189d16b4b199b3f9a9bbb49374e7e3b3
Author: dcosse <cosse(a)codelutin.com>
Date: Fri Sep 18 10:27:41 2015 +0200
refs #1293 refactoring, modification de style
---
.../ui/accountViewer/AccountViewerTableModel.java | 14 +-----
.../ui/accountViewer/AccountViewerViewHandler.java | 50 ++++++++++++---------
.../lima/ui/accountViewer/SelectionMode.java | 6 +--
.../resources/i18n/lima-swing_en_GB.properties | 6 +--
.../resources/i18n/lima-swing_fr_FR.properties | 6 ++-
.../resources/icons/action-fiscalPeriod-close.png | Bin 715 -> 452 bytes
6 files changed, 40 insertions(+), 42 deletions(-)
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java
index e6a3a5a..3180fbf 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerTableModel.java
@@ -22,9 +22,7 @@
package org.chorem.lima.ui.accountViewer;
-import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.ui.common.AbstractColumn;
import org.chorem.lima.ui.common.AbstractLimaTableModel;
@@ -61,19 +59,11 @@ public class AccountViewerTableModel extends AbstractLimaTableModel<Entry> {
}
});
- addColumn(new AbstractColumn<AccountViewerTableModel>(EntryBook.class, t("lima.table.entryBook"), false) {
+ addColumn(new AbstractColumn<AccountViewerTableModel>(String.class, t("lima.table.entryBook"), false) {
@Override
public Object getValueAt(int row) {
Entry entry = tableModel.get(row);
- return entry.getFinancialTransaction().getEntryBook();
- }
- });
-
- addColumn(new AbstractColumn<AccountViewerTableModel>(Account.class, t("lima.table.account"), false) {
- @Override
- public Object getValueAt(int row) {
- Entry entry = tableModel.get(row);
- return entry.getAccount();
+ return entry.getFinancialTransaction().getEntryBook().getCode();
}
});
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
index 569d1a6..f74ba39 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
@@ -23,6 +23,7 @@
package org.chorem.lima.ui.accountViewer;
import com.google.common.collect.Lists;
+import jaxx.runtime.SwingUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
@@ -75,17 +76,13 @@ import static org.nuiton.i18n.I18n.t;
*/
public class AccountViewerViewHandler {
- // fixme Date format should be app parameters
- protected static String DATE_FORMAT = t("lima.ui.dateFormat");
-
protected AccountViewerView view;
- protected AccountViewerTable table;
- protected FiscalPeriodService fiscalPeriodService;
- protected FinancialPeriodService financialPeriodService;
protected AccountService accountService;
- protected FinancialTransactionService financialTransactionService;
protected EntryBookService entryBookService;
+ protected FinancialPeriodService financialPeriodService;
+ protected FinancialTransactionService financialTransactionService;
+ protected FiscalPeriodService fiscalPeriodService;
protected LetteringFilterImpl filter;
@@ -93,22 +90,23 @@ public class AccountViewerViewHandler {
protected ErrorHelper errorHelper;
- protected SelectionMode selectionMode = SelectionMode.BALANCED;
+ protected SelectionMode selectionMode = SelectionMode.LETTERED;
private static final Log log = LogFactory.getLog(AccountViewerViewHandler.class);
-
protected boolean initializationComplete;
public AccountViewerViewHandler(AccountViewerView view) {
initializationComplete = false;
this.view = view;
initShortCuts();
- financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class);
- fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodService.class);
+
accountService = LimaServiceFactory.getService(AccountService.class);
- financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class);
entryBookService = LimaServiceFactory.getService(EntryBookService.class);
+ financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class);
+ financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class);
+ fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodService.class);
+
errorHelper = new ErrorHelper(LimaSwingConfig.getInstance());
}
@@ -150,6 +148,11 @@ public class AccountViewerViewHandler {
onSelectionModeChanged(selectionMode);
+ SwingUtil.fixTableColumnWidth(view.getTable(), 0, 100);
+ SwingUtil.fixTableColumnWidth(view.getTable(), 1, 60);
+ SwingUtil.fixTableColumnWidth(view.getTable(), 2, 80);
+ SwingUtil.fixTableColumnWidth(view.getTable(), 4, 50);
+
initializationComplete = true;
updateAllEntries();
updateSoldStatus();
@@ -240,13 +243,9 @@ public class AccountViewerViewHandler {
if (fiscalPeriod != null) {
LetteringFilter previousPeriodFilter = computePreviousPeriodFilter(fiscalPeriod);
LetteringFilter actualPeriodFilter = computeActualPeriodFilter(fiscalPeriod);
- setPreviousSold(previousPeriodFilter);
- setActualSold(fiscalPeriod, actualPeriodFilter);
-
- // no previous sold to add if selected starting date is same as fiscal period one
- if (!DateUtils.isSameDay(filter.getDateStart(), previousPeriodFilter.getDateStart()) && CollectionUtils.isNotEmpty(entries)) {
- entriesAndResume.add(getFirstLinePreviousSoldEntry(entries, previousPeriodFilter));
- }
+ addPreviousSoldToModel(previousPeriodFilter);
+ addPreviousSoldEntryToEntries(entriesAndResume, entries, previousPeriodFilter);
+ addActualSoldToModel(fiscalPeriod, actualPeriodFilter);
}
}
entriesAndResume.addAll(entries);
@@ -256,6 +255,13 @@ public class AccountViewerViewHandler {
onBalanceChanged(null);
}
+ protected void addPreviousSoldEntryToEntries(List<Entry> entriesAndResume, List<Entry> entries, LetteringFilter previousPeriodFilter) {
+ // no previous sold to add if selected starting date is same as fiscal period one
+ if (!DateUtils.isSameDay(filter.getDateStart(), previousPeriodFilter.getDateStart()) && CollectionUtils.isNotEmpty(entries)) {
+ entriesAndResume.add(getFirstLinePreviousSoldEntry(entries, previousPeriodFilter));
+ }
+ }
+
protected void addFiscalPeriodBeginDate(FiscalPeriod fiscalPeriod) {
if (fiscalPeriod != null) {
editModel.setFiscalPeriodBeginDate(fiscalPeriod.getBeginDate());
@@ -279,7 +285,7 @@ public class AccountViewerViewHandler {
return resumeEntry;
}
- protected void setPreviousSold(LetteringFilter previousPeriodFilter) {
+ protected void addPreviousSoldToModel(LetteringFilter previousPeriodFilter) {
BigDecimal previousSold;
if (previousPeriodFilter == null) {
previousSold = BigDecimal.ZERO;
@@ -291,7 +297,7 @@ public class AccountViewerViewHandler {
view.getTableModel().setPreviousPeriodSold(previousSold);
}
- protected void setActualSold(FiscalPeriod fiscalPeriod, LetteringFilter actualPeriodFilter) {
+ protected void addActualSoldToModel(FiscalPeriod fiscalPeriod, LetteringFilter actualPeriodFilter) {
addFiscalPeriodBeginDate(fiscalPeriod);
List<Object[]> initialDebitCredit = financialTransactionService.getAccountEntriesDebitCreditFromIncludingToIncludingPeriod(actualPeriodFilter);
DebitCreditSold debitCreditSold = new DebitCreditSold().invoke(initialDebitCredit);
@@ -478,7 +484,7 @@ public class AccountViewerViewHandler {
public void onSelectionModeChanged(SelectionMode selectionMode) {
switch (selectionMode) {
- case BALANCED:
+ case LETTERED:
view.getAccountViewerSelectionModel().setBalancedSelectionMode(true);
break;
case MANUAL:
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/SelectionMode.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/SelectionMode.java
index 8d69868..e2f112f 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/SelectionMode.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/SelectionMode.java
@@ -7,7 +7,7 @@ import static org.nuiton.i18n.I18n.t;
*/
public enum SelectionMode {
- BALANCED, MANUAL;
+ LETTERED, MANUAL;
@Override
public String toString() {
@@ -18,8 +18,8 @@ public enum SelectionMode {
case MANUAL:
result = t("lima.filter.condition.selectionMode.manual");
break;
- case BALANCED:
- result = t("lima.filter.condition.selectionMode.balanced");
+ case LETTERED:
+ result = t("lima.filter.condition.selectionMode.lettered");
break;
}
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
index 2b0a17d..588228c 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
@@ -14,7 +14,7 @@ lima.account.remove.confirm.title=Delete account
lima.account.remove.error.usedAccount=There are financial statement on this account
lima.account.update.error.invalidAccountNumber=Invalid account number\: %1$s
lima.account.update.form=Update account
-lima.accountViewer.previousSold=Solde au %s
+lima.accountViewer.previousSold=<html><b>On %s the sold was</b></html>
lima.accounts=Accounts
lima.action.commandline.help=Show help in console
lima.balance=Balance
@@ -227,7 +227,7 @@ lima.filter.account=Add account filter
lima.filter.condition.all=Valid all criteria
lima.filter.condition.one=Valid at least one criteria
lima.filter.condition.selectionMode=Balance entry selection
-lima.filter.condition.selectionMode.balanced=Balanced
+lima.filter.condition.selectionMode.lettered=Lettered
lima.filter.condition.selectionMode.manual=Manual
lima.filter.credit=Add filter on credit
lima.filter.date.interval=Filter on date range
@@ -454,7 +454,7 @@ lima.lettering.account=Accounts
lima.lettering.account.aAll=All
lima.lettering.account.back=←
lima.lettering.account.next=→
-lima.lettering.accountViewerBalanceStatus=<html>From %s to %s\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b> - Selected entries\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b>
+lima.lettering.accountViewerBalanceStatus=<html>From %s to %s\: Sold is\: <b>%s - %s \= %s</b> - Selected entries sold\: <b>%s - %s \= %s</b>
lima.lettering.balanceStatus=
lima.lettering.balanceStatus=<html>Debit\: <b>%s</b> - Credit\: <b>%s</b> - Sold\: <b>%s</b>. Selected entries\: Debit\: <b>%s</b> - Credit\: <b>%s</b> - Sold\: <b>%s</b>
lima.lettering.checkAll=All
diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
index 2b17f4e..7a29d75 100644
--- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
+++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
@@ -236,8 +236,8 @@ lima.filter.account=Ajouter un filtre sur les comptes
lima.filter.condition.all=Valide toutes les conditions
lima.filter.condition.delete=Supprimer la condition
lima.filter.condition.one=Valide au moins une condition
-lima.filter.condition.selectionMode=Sélection des écritures balancées
-lima.filter.condition.selectionMode.balanced=Balancée
+lima.filter.condition.selectionMode=Sélection des écritures lettrées
+lima.filter.condition.selectionMode.lettered=Lettré
lima.filter.condition.selectionMode.manual=Manuelle
lima.filter.credit=Ajouter un filtre sur les crédits
lima.filter.date=Ajouter un filtre sur les dates
@@ -466,6 +466,8 @@ lima.lettering.account=Comptes
lima.lettering.account.aAll=TOUS
lima.lettering.account.back=←
lima.lettering.account.next=→
+lima.lettering.accountViewerBalanceStatus=<html>Période du <b>%s</b> au <b>%s</b>\: solde \=<b>%s - %s \= %s</b> - Pour la sélection le solde est\: <b>%s - %s \= %s</b>
+lima.lettering.balanceStatus=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b>
lima.lettering.accountViewerBalanceStatus=<html>Pour la période du %s au %s\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b> - Pour la sélection\: D\: <b>%s</b> - C\: <b>%s</b> - S\: <b>%s</b>
lima.lettering.balanceStatus=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b>. Entrées sélectionnées\: Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b>
lima.lettering.checkAll=Toutes
diff --git a/lima-swing/src/main/resources/icons/action-fiscalPeriod-close.png b/lima-swing/src/main/resources/icons/action-fiscalPeriod-close.png
index 08f2493..ac2fd6f 100644
Binary files a/lima-swing/src/main/resources/icons/action-fiscalPeriod-close.png and b/lima-swing/src/main/resources/icons/action-fiscalPeriod-close.png differ
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
0
This is an automated email from the git hooks/post-receive script.
New commit to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
commit 147c7cf1e84787f1be2104d64c1e98650e05b430
Author: dcosse <cosse(a)codelutin.com>
Date: Wed Sep 16 22:11:13 2015 +0200
refs #1293 Traduction des dates pickers
---
.../lima/ui/accountViewer/AccountViewerView.css | 9 ---------
.../lima/ui/accountViewer/AccountViewerView.jaxx | 4 ++++
.../ui/accountViewer/AccountViewerViewHandler.java | 22 ++++++++++++++++------
3 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
index 25f34fe..f0bd618 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.css
@@ -52,20 +52,11 @@
labelFor : {beginPeriodPicker};
}
-#beginPeriodPicker {
- patternLayout: {handler.DATE_FORMAT};
-}
-
#endPeriodLabel {
text : "lima.lettering.period.end";
labelFor : {endPeriodPicker};
}
-#endPeriodPicker {
- patternLayout: {handler.DATE_FORMAT};
-}
-
-
#refresh {
toolTipText : "lima.lettering.refresh";
actionIcon : "refresh";
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
index 2a13c27..8b46423 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerView.jaxx
@@ -62,10 +62,14 @@
<JLabel id="beginPeriodLabel"/>
<JAXXDatePicker id="beginPeriodPicker"
+ constructorParams="handler.getLocale()"
+ formats="{handler.getDateFormat()}"
onPropertyChange="handler.setDateStart(beginPeriodPicker.getDate())"/>
<JLabel id="endPeriodLabel"/>
<JAXXDatePicker id="endPeriodPicker"
+ constructorParams="handler.getLocale()"
+ formats="{handler.getDateFormat()}"
onPropertyChange="handler.setDateEnd(endPeriodPicker.getDate())"/>
<JToolBar.Separator/>
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
index 37a4ba7..569d1a6 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
@@ -55,10 +55,11 @@ import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
+import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
+import java.util.Locale;
import static org.nuiton.i18n.I18n.t;
@@ -94,8 +95,6 @@ public class AccountViewerViewHandler {
protected SelectionMode selectionMode = SelectionMode.BALANCED;
- protected SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT);
-
private static final Log log = LogFactory.getLog(AccountViewerViewHandler.class);
@@ -159,8 +158,8 @@ public class AccountViewerViewHandler {
public void updateSoldStatus() {
if (initializationComplete) {
view.getBalanceStatusLabel().setText(t("lima.lettering.accountViewerBalanceStatus",
- dateFormatter.format(editModel.getFiscalPeriodBeginDate()),
- dateFormatter.format(filter.getDateEnd()),
+ getDateFormat().format(editModel.getFiscalPeriodBeginDate()),
+ getDateFormat().format(filter.getDateEnd()),
BigDecimalToString.format(editModel.getGlobalDebit()),
BigDecimalToString.format(editModel.getGlobalCredit()),
@@ -273,7 +272,7 @@ public class AccountViewerViewHandler {
firstLineTransaction.setTransactionDate(previousSoldEndDate);
Entry resumeEntry = new EntryImpl();
- resumeEntry.setDescription(String.format(t("lima.accountViewer.previousSold"), dateFormatter.format(previousSoldEndDate)));
+ resumeEntry.setDescription(String.format(t("lima.accountViewer.previousSold"), getDateFormat().format(previousSoldEndDate)));
resumeEntry.setAmount(view.getTableModel().getPreviousPeriodSold().abs());
resumeEntry.setDebit(BigDecimal.ZERO.compareTo(view.getTableModel().getPreviousPeriodSold()) < 0);
resumeEntry.setFinancialTransaction(firstLineTransaction);
@@ -530,4 +529,15 @@ public class AccountViewerViewHandler {
}
}
+ protected DateFormat getDateFormat() {
+ Locale locale = LimaSwingConfig.getInstance().getLocale();
+ DateFormat result = DateFormat.getDateInstance(DateFormat.SHORT, locale);
+ return result;
+ }
+
+ protected Locale getLocale() {
+ Locale locale = LimaSwingConfig.getInstance().getLocale();
+ return locale;
+ }
+
}
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
0
06/19: refs #1293 Correction sur les dates pickers et la recherche de compte appliquée égallement à l'onglet Lettering
by chorem.org scm 30 Nov '15
by chorem.org scm 30 Nov '15
30 Nov '15
This is an automated email from the git hooks/post-receive script.
New commit to branch feature/1293-addAccountViewerTab in repository lima.
See http://git.chorem.org/lima.git
commit 45b2d0cea148f951111be8ef416340102595ae10
Author: dcosse <cosse(a)codelutin.com>
Date: Tue Sep 15 17:18:09 2015 +0200
refs #1293 Correction sur les dates pickers et la recherche de compte appliquée égallement à l'onglet Lettering
---
.../lima/ui/accountViewer/AccountViewerViewHandler.java | 6 ++----
.../java/org/chorem/lima/ui/lettering/LetteringView.css | 8 ++++++++
.../chorem/lima/ui/lettering/LetteringViewHandler.java | 16 +++++++++++-----
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
index 7cef851..37a4ba7 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java
@@ -411,10 +411,8 @@ public class AccountViewerViewHandler {
}
public void accountComboBoxChange(PropertyChangeEvent event) {
- if (event.getPropertyName().equals(AccountComboBox.PROPERTY_SELECTED_ITEM)) {
- if (event.getNewValue() != null && event.getNewValue() instanceof Account) {
- setAccount((Account) event.getNewValue());
- }
+ if (event.getPropertyName().equals(AccountComboBox.PROPERTY_SELECTED_ITEM) && event.getNewValue() != null && event.getNewValue() instanceof Account) {
+ setAccount((Account) event.getNewValue());
}
}
diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css
index f5c7736..520059d 100644
--- a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css
+++ b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css
@@ -70,11 +70,19 @@
labelFor : {beginPeriodPicker};
}
+#beginPeriodPicker {
+ patternLayout: {handler.DATE_FORMAT};
+}
+
#endPeriodLabel {
text : "lima.lettering.period.end";
labelFor : {endPeriodPicker};
}
+#endPeriodPicker {
+ patternLayout: {handler.DATE_FORMAT};
+}
+
#letteredEntryLabel {
actionIcon : "choose-entry";
labelFor : {letteredEntryComboBox};
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 15f9759..67abdc7 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
@@ -80,6 +80,8 @@ import static org.nuiton.i18n.I18n.t;
*/
public class LetteringViewHandler{
+ protected static String DATE_FORMAT = t("lima.ui.dateFormat");
+
protected LetteringView view;
/** Transaction service. */
@@ -500,7 +502,7 @@ public class LetteringViewHandler{
}
public void accountComboBoxChange(PropertyChangeEvent event) {
- if (event.getPropertyName().equals(AccountComboBox.PROPERTY_SELECTED_ITEM) && event.getNewValue() instanceof Account) {
+ if (event.getPropertyName().equals(AccountComboBox.PROPERTY_SELECTED_ITEM) && event.getNewValue() != null && event.getNewValue() instanceof Account) {
setAccount((Account) event.getNewValue());
}
}
@@ -627,13 +629,17 @@ public class LetteringViewHandler{
public void setDateStart(Date date) {
- filter.setDateStart(date);
- updateAllEntries();
+ if (initializationComplete) {
+ filter.setDateStart(date);
+ updateAllEntries();
+ }
}
public void setDateEnd(Date date) {
- filter.setDateEnd(date);
- updateAllEntries();
+ if (initializationComplete) {
+ filter.setDateEnd(date);
+ updateAllEntries();
+ }
}
public void setAccount(Account account) {
--
To stop receiving notification emails like this one, please contact
chorem.org SCM administrator <admin+scm(a)chorem.org>.
1
0