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 ed78c68 refs #1293 Traduction des dates pickers new ab7f407 refs #1293 refactoring, modification de style 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 ab7f407d838f1a5ef163886af897d19983bbc843 Author: dcosse <cosse@codelutin.com> Date: Fri Sep 18 10:27:41 2015 +0200 refs #1293 refactoring, modification de style Summary of changes: .../java/org/chorem/lima/entity/EntryTopiaDao.java | 3 ++ .../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 | 8 ++-- .../icons/action-financialPeriod-close.png | Bin 715 -> 452 bytes .../resources/icons/action-fiscalPeriod-close.png | Bin 715 -> 452 bytes 8 files changed, 43 insertions(+), 44 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 ab7f407d838f1a5ef163886af897d19983bbc843 Author: dcosse <cosse@codelutin.com> Date: Fri Sep 18 10:27:41 2015 +0200 refs #1293 refactoring, modification de style --- .../java/org/chorem/lima/entity/EntryTopiaDao.java | 3 ++ .../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 | 8 ++-- .../icons/action-financialPeriod-close.png | Bin 715 -> 452 bytes .../resources/icons/action-fiscalPeriod-close.png | Bin 715 -> 452 bytes 8 files changed, 43 insertions(+), 44 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java b/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java index 254a2d1..c5e0118 100644 --- a/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java +++ b/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java @@ -226,6 +226,9 @@ public class EntryTopiaDao extends AbstractEntryTopiaDao<Entry> { "OR " + alias + "." + Entry.PROPERTY_LETTERING + " != ''"); } + + builder.setOrderByArguments(Entry.PROPERTY_FINANCIAL_TRANSACTION + "." + FinancialTransaction.PROPERTY_TRANSACTION_DATE); + List<Entry> entries = findAll(builder.getHql(), builder.getHqlParameters()); return entries; 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 f7ee250..a7c9068 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 @@ -13,7 +13,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 @@ -225,7 +225,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 @@ -447,7 +447,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.checkAll=All lima.lettering.checkLettredEntry=Lettered 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 7c5c9a4..96aeba8 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 @@ -15,7 +15,7 @@ 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.accounts=Comptes lima.action.commandline.help=Afficher l'aide en console lima.balance=Équilibrer @@ -233,8 +233,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 @@ -458,7 +458,7 @@ lima.lettering.account=Comptes lima.lettering.account.aAll=TOUS lima.lettering.account.back=← lima.lettering.account.next=→ -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.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.checkAll=Toutes lima.lettering.checkLettredEntry=Lettrées diff --git a/lima-swing/src/main/resources/icons/action-financialPeriod-close.png b/lima-swing/src/main/resources/icons/action-financialPeriod-close.png index 08f2493..ac2fd6f 100644 Binary files a/lima-swing/src/main/resources/icons/action-financialPeriod-close.png and b/lima-swing/src/main/resources/icons/action-financialPeriod-close.png differ 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@chorem.org>.
participants (1)
-
chorem.org scm