branch feature/1293-addAccountViewerTab updated (2ebb4e8 -> 95381d2)
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 2ebb4e8 refs #1293 corrections et refactoring new 95381d2 refs #1293 corrections pour le cas ou aucune données existe dans Lima 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 95381d27c15a6b7a8d43c199d322581c289aaae3 Author: dcosse <cosse@codelutin.com> Date: Thu Sep 24 14:19:40 2015 +0200 refs #1293 corrections pour le cas ou aucune données existe dans Lima Summary of changes: .../ui/accountViewer/AccountViewerViewHandler.java | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1293-addAccountViewerTab in repository lima. See http://git.chorem.org/lima.git commit 95381d27c15a6b7a8d43c199d322581c289aaae3 Author: dcosse <cosse@codelutin.com> Date: Thu Sep 24 14:19:40 2015 +0200 refs #1293 corrections pour le cas ou aucune données existe dans Lima --- .../ui/accountViewer/AccountViewerViewHandler.java | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 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 fd53279..be14b20 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 @@ -341,8 +341,10 @@ public class AccountViewerViewHandler { public void updateAllEntriesForFiscalPeriodChoice(FiscalPeriod fiscalPeriod) { - setFilter(fiscalPeriod, null, fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate(), PeriodChoice.FISCAL_PERIOD); - updateAllEntries(); + if (fiscalPeriod != null) { + setFilter(fiscalPeriod, null, fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate(), PeriodChoice.FISCAL_PERIOD); + updateAllEntries(); + } } public void updateAllEntriesForFinancialPeriodChoice(FinancialPeriod financialPeriod) { @@ -531,8 +533,8 @@ public class AccountViewerViewHandler { } protected void updateFinancialPeriodCombo(FinancialPeriod defaultFinancialPeriod, List<FinancialPeriod> financialPeriods) { - view.getFinancialPeriodComboBoxModel().setObjects(financialPeriods); - if (defaultFinancialPeriod != null) { + if (CollectionUtils.isNotEmpty(financialPeriods)) { + view.getFinancialPeriodComboBoxModel().setObjects(financialPeriods); view.getFinancialPeriodComboBoxModel().setSelectedItem(defaultFinancialPeriod); } } @@ -540,16 +542,22 @@ public class AccountViewerViewHandler { protected void initFiscalPeriodCombo() { List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllFiscalPeriods(); view.getFiscalPeriodComboBoxModel().setObjects(fiscalPeriods); - view.getFiscalPeriodComboBoxModel().setSelectedItem(fiscalPeriods.get(fiscalPeriods.size() - 1)); + if (CollectionUtils.isNotEmpty(fiscalPeriods)) { + view.getFiscalPeriodComboBoxModel().setSelectedItem(fiscalPeriods.get(fiscalPeriods.size() - 1)); + } view.getFiscalPeriodComboBox().setVisible(true); } protected void initSoldPeriodView() { - view.getBeginPeriodSummary().setText(String.format(t("lima.accountingView.summaryLabel"), getDateFormat().format(filter.getFiscalPeriod().getBeginDate()), getDateFormat().format(getDayMinus1Calendar(filter.getFinancialPeriod().getBeginDate()).getTime()))); + Date ppbd = filter.getFiscalPeriod() != null ? filter.getFiscalPeriod().getBeginDate() : new Date(); + Date pped = filter.getFinancialPeriod() != null ? getDayMinus1Calendar(filter.getFinancialPeriod().getBeginDate()).getTime() : new Date(); + view.getBeginPeriodSummary().setText(String.format(t("lima.accountingView.summaryLabel"), getDateFormat().format(ppbd), getDateFormat().format(pped))); 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(t("lima.accountingView.summaryLabel"), getDateFormat().format(filter.getFiscalPeriod().getBeginDate()), getDateFormat().format(filter.getFinancialPeriod().getEndDate()))); + + Date aped = filter.getFinancialPeriod() != null ? filter.getFinancialPeriod().getEndDate() : new Date(); + view.getEndPeriodSummary().setText(String.format(t("lima.accountingView.summaryLabel"), getDateFormat().format(ppbd), getDateFormat().format(aped))); view.getEndDebit().setText(BigDecimalToString.format(BigDecimal.ZERO)); view.getEndCredit().setText(BigDecimalToString.format(BigDecimal.ZERO)); view.getEndSold().setText(BigDecimalToString.format(BigDecimal.ZERO)); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm