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 47945fb refs #1241 Ajout d'un oglet consultation de compte, travail en cours new 47dd7c3 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 e3a30fd refs #1241 Ajout de la possibilité de choisir entre deux modes de sélection des entrées (Manuelle ou Balancée) 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 e3a30fde5d90862fc7fc8b0e87de60880ab10707 Author: dcosse <cosse@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 47dd7c3911a3b6ccc3703eb362a2a73c3a10a61c Author: dcosse <cosse@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 Summary of changes: .../src/main/java/org/chorem/lima/ui/MainView.css | 2 +- .../ui/accountViewer/AccountViewerEditModel.java | 40 +---- .../accountViewer/AccountViewerSelectionModel.java | 98 ++++++------ .../lima/ui/accountViewer/AccountViewerView.css | 9 ++ .../lima/ui/accountViewer/AccountViewerView.jaxx | 8 +- .../ui/accountViewer/AccountViewerViewHandler.java | 177 +++++++-------------- .../lima/ui/accountViewer/SelectionMode.java | 29 ++++ .../resources/i18n/lima-swing_en_GB.properties | 4 + .../resources/i18n/lima-swing_fr_FR.properties | 4 + .../main/resources/icons/action-account-viewer.png | Bin 0 -> 1062 bytes .../main/resources/icons/action-selection-mode.png | Bin 0 -> 1106 bytes 11 files changed, 165 insertions(+), 206 deletions(-) create mode 100644 lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/SelectionMode.java create mode 100644 lima-swing/src/main/resources/icons/action-account-viewer.png create mode 100644 lima-swing/src/main/resources/icons/action-selection-mode.png -- 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 47dd7c3911a3b6ccc3703eb362a2a73c3a10a61c Author: dcosse <cosse@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 --- .../ui/accountViewer/AccountViewerEditModel.java | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java index 0c9b98c..5c4f64f 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java @@ -62,35 +62,35 @@ public class AccountViewerEditModel implements Serializable { protected Date fiscalPeriodBeginDate; - public boolean isEqualized() { - return equalized; - } - - public void setEqualized(boolean equalized) { - boolean oldEqualized = isEqualized(); - this.equalized = equalized; - firePropertyChange(PROPERTY_EQUALIZED, oldEqualized, this.equalized); - } - - public boolean isLettred() { - return lettred; - } - - public void setLettred(boolean lettered) { - boolean oldLetter = isLettred(); - this.lettred = lettered && (BigDecimal.ZERO.equals(sold) || sold.doubleValue() == 0); - firePropertyChange(PROPERTY_LETTRED, oldLetter, this.lettred); - } - - public boolean isUnLettred() { - return unLettred; - } - - public void setUnLettred(boolean unLettred) { - boolean oldDeleter = isUnLettred(); - this.unLettred = unLettred; - firePropertyChange(PROPERTY_UNLETTRED, oldDeleter, this.unLettred); - } +// public boolean isEqualized() { +// return equalized; +// } + +// public void setEqualized(boolean equalized) { +// boolean oldEqualized = isEqualized(); +// this.equalized = equalized; +// firePropertyChange(PROPERTY_EQUALIZED, oldEqualized, this.equalized); +// } + +// public boolean isLettred() { +// return lettred; +// } + +// public void setLettred(boolean lettered) { +// boolean oldLetter = isLettred(); +// this.lettred = lettered && (BigDecimal.ZERO.equals(sold) || sold.doubleValue() == 0); +// firePropertyChange(PROPERTY_LETTRED, oldLetter, this.lettred); +// } + +// public boolean isUnLettred() { +// return unLettred; +// } + +// public void setUnLettred(boolean unLettred) { +// boolean oldDeleter = isUnLettred(); +// this.unLettred = unLettred; +// firePropertyChange(PROPERTY_UNLETTRED, oldDeleter, this.unLettred); +// } public BigDecimal getDebit() { return debit; -- 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 e3a30fde5d90862fc7fc8b0e87de60880ab10707 Author: dcosse <cosse@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) --- .../src/main/java/org/chorem/lima/ui/MainView.css | 2 +- .../ui/accountViewer/AccountViewerEditModel.java | 40 +---- .../accountViewer/AccountViewerSelectionModel.java | 98 ++++++------ .../lima/ui/accountViewer/AccountViewerView.css | 9 ++ .../lima/ui/accountViewer/AccountViewerView.jaxx | 8 +- .../ui/accountViewer/AccountViewerViewHandler.java | 177 +++++++-------------- .../lima/ui/accountViewer/SelectionMode.java | 29 ++++ .../resources/i18n/lima-swing_en_GB.properties | 4 + .../resources/i18n/lima-swing_fr_FR.properties | 4 + .../main/resources/icons/action-account-viewer.png | Bin 0 -> 1062 bytes .../main/resources/icons/action-selection-mode.png | Bin 0 -> 1106 bytes 11 files changed, 165 insertions(+), 206 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css index 177cf8b..0053bbc 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css @@ -238,7 +238,7 @@ #accountViewer { text : "lima.entries.accountViewer"; - actionIcon : "lettering"; + actionIcon : "account-viewer"; } #help { diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java index 5c4f64f..57accc3 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerEditModel.java @@ -40,18 +40,10 @@ public class AccountViewerEditModel implements Serializable { public static final String PROPERTY_GLOBAL_SOLD = "globalSold"; - public static final String PROPERTY_LETTRED = "lettred"; - - public static final String PROPERTY_UNLETTRED = "unLettred"; - - public static final String PROPERTY_EQUALIZED = "equalized"; - protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this); protected AccountViewerTableModel model; - protected boolean lettred; - protected boolean unLettred; - protected boolean equalized; + protected BigDecimal debit = BigDecimal.ZERO; protected BigDecimal credit = BigDecimal.ZERO; protected BigDecimal sold = BigDecimal.ZERO; @@ -62,36 +54,6 @@ public class AccountViewerEditModel implements Serializable { protected Date fiscalPeriodBeginDate; -// public boolean isEqualized() { -// return equalized; -// } - -// public void setEqualized(boolean equalized) { -// boolean oldEqualized = isEqualized(); -// this.equalized = equalized; -// firePropertyChange(PROPERTY_EQUALIZED, oldEqualized, this.equalized); -// } - -// public boolean isLettred() { -// return lettred; -// } - -// public void setLettred(boolean lettered) { -// boolean oldLetter = isLettred(); -// this.lettred = lettered && (BigDecimal.ZERO.equals(sold) || sold.doubleValue() == 0); -// firePropertyChange(PROPERTY_LETTRED, oldLetter, this.lettred); -// } - -// public boolean isUnLettred() { -// return unLettred; -// } - -// public void setUnLettred(boolean unLettred) { -// boolean oldDeleter = isUnLettred(); -// this.unLettred = unLettred; -// firePropertyChange(PROPERTY_UNLETTRED, oldDeleter, this.unLettred); -// } - public BigDecimal getDebit() { return debit; } 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 fa1fea5..5199a0b 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 @@ -37,6 +37,8 @@ public class AccountViewerSelectionModel extends DefaultListSelectionModel{ protected AccountViewerTableModel letteringTableModel; protected Entry entry; protected int lineSelected; + + protected boolean balancedSelectionMode; protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this); public AccountViewerSelectionModel(AccountViewerTableModel letteringTableModel){ @@ -50,43 +52,54 @@ public class AccountViewerSelectionModel extends DefaultListSelectionModel{ @Override public void setSelectionInterval(int row, int column) { - if (!letteringNotExist(row)) { - - //lettred entries - if ( isSelectionEmpty() || !isSelectedIndex(row)){ - clearSelection(); - lineSelected = row; - String currentLettring = getCurrentLettring(); - - //select entries with the same letter of the selected entry - for(Entry entry : getEntries()){ - if (StringUtils.isNotBlank(entry.getLettering())){ - if (entry.getLettering().equals(currentLettring)){ - int entryToSelect = letteringTableModel.indexOf(entry); - super.addSelectionInterval(entryToSelect, entryToSelect); + if (balancedSelectionMode) { + if (!letteringNotExist(row)) { + + //lettred entries + if ( isSelectionEmpty() || !isSelectedIndex(row)){ + clearSelection(); + lineSelected = row; + String currentLettring = getCurrentLettring(); + + //select entries with the same letter of the selected entry + for(Entry entry : getEntries()){ + if (StringUtils.isNotBlank(entry.getLettering())){ + if (entry.getLettering().equals(currentLettring)){ + int entryToSelect = letteringTableModel.indexOf(entry); + super.addSelectionInterval(entryToSelect, entryToSelect); + } } } } } - } - else { - - //unlettred entries - //To clear the selection when it changes from lettered entry to unlettered - for(Entry entry : getEntries()){ - if (!StringUtils.isBlank(entry.getLettering())) { - int entryToSelect = letteringTableModel.indexOf(entry); - super.removeSelectionInterval(entryToSelect, entryToSelect); + else { + + //unlettred entries + //To clear the selection when it changes from lettered entry to unlettered + for(Entry entry : getEntries()){ + if (!StringUtils.isBlank(entry.getLettering())) { + int entryToSelect = letteringTableModel.indexOf(entry); + super.removeSelectionInterval(entryToSelect, entryToSelect); + } } - } - if (isSelectionEmpty() || !isSelectedIndex(row)){ - super.addSelectionInterval(row, column); - }else { - super.removeSelectionInterval(row, column); - } + if (isSelectionEmpty() || !isSelectedIndex(row)){ + super.addSelectionInterval(row, column); + }else { + super.removeSelectionInterval(row, column); + } + } + } else { + super.addSelectionInterval(row, column); + //super.setSelectionInterval(row, column); } + + } + + @Override + public int getSelectionMode() { + return MULTIPLE_INTERVAL_SELECTION; } /**return true if lettering is null, or not null but empty @@ -113,24 +126,6 @@ public class AccountViewerSelectionModel extends DefaultListSelectionModel{ return letteringTableModel.get(lineSelected); } -// /**After rounding one of two entries, selection of its, and of the new entry, -// * resulting of rounding*/ -// public void selectRoundedAndNewEntries(int indexFirstRoundedEntry, int indexSecondRoundedEntry, Entry newResultRoundedEntry) { -// if (!isSelectedIndex(indexFirstRoundedEntry)) { -// addSelectionInterval(indexFirstRoundedEntry, indexFirstRoundedEntry); -// } -// if (!isSelectedIndex(indexSecondRoundedEntry)) { -// addSelectionInterval(indexSecondRoundedEntry, indexSecondRoundedEntry); -// } -// /*New entry*/ -// int newEntryIndex = letteringTableModel.indexOf(newResultRoundedEntry); -// addSelectionInterval(newEntryIndex, newEntryIndex); -// } - - @Override - public int getSelectionMode() { - return MULTIPLE_INTERVAL_SELECTION; - } public void addPropertyChangeListener(PropertyChangeListener listener) { pcs.addPropertyChangeListener(listener); @@ -155,4 +150,13 @@ public class AccountViewerSelectionModel extends DefaultListSelectionModel{ protected void firePropertyChange(String propertyName, Object newValue) { firePropertyChange(propertyName, null, newValue); } + + public void setBalancedSelectionMode(boolean balancedSelectionMode) { + this.balancedSelectionMode = balancedSelectionMode; + clearSelection(); + } + + public boolean getBalancedSelectionMode() { + return balancedSelectionMode; + } } 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..25f34fe 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,11 +52,20 @@ 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 25a1066..75a86df 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,16 +62,20 @@ <JLabel id="beginPeriodLabel"/> <JAXXDatePicker id="beginPeriodPicker" - patternLayout="dd/MM/yyy" onActionPerformed="handler.setDateStart(beginPeriodPicker.getDate())"/> <JLabel id="endPeriodLabel"/> <JAXXDatePicker id="endPeriodPicker" - patternLayout="dd/MM/yyy" onActionPerformed="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()"/> 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 bf37cb0..7e9ceca 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 @@ -75,12 +75,11 @@ import static org.nuiton.i18n.I18n.t; public class AccountViewerViewHandler { // fixme Date format should be app parameters - protected static String DATE_FORMAT = "dd/MM/yyyy"; + protected static String DATE_FORMAT = t("lima.ui.dateFormat"); protected AccountViewerView view; protected AccountViewerTable table; - /** Transaction service. */ protected FiscalPeriodService fiscalPeriodService; protected FinancialPeriodService financialPeriodService; protected AccountService accountService; @@ -89,13 +88,11 @@ public class AccountViewerViewHandler { protected LetteringFilterImpl filter; - protected BigDecimal debit = BigDecimal.ZERO; - protected BigDecimal credit = BigDecimal.ZERO; protected AccountViewerEditModel editModel; protected ErrorHelper errorHelper; - protected enum ButtonMode {DELETTRED, LETTRED, EQUALIZED, ALL} + protected SelectionMode selectionMode = SelectionMode.BALANCED; protected SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT); @@ -122,7 +119,6 @@ public class AccountViewerViewHandler { public void init() { filter = new LetteringFilterImpl(); editModel = view.getEditModel(); - //lettringSelectionModel = view.getLetteringSelectionModel(); loadComboAndRows(); editModel.addPropertyChangeListener(AccountViewerEditModel.PROPERTY_DEBIT, new PropertyChangeListener() { @@ -153,6 +149,8 @@ public class AccountViewerViewHandler { } }); + onSelectionModeChanged(selectionMode); + initializationComplete = true; updateAllEntries(); updateSoldStatus(); @@ -238,16 +236,20 @@ public class AccountViewerViewHandler { List<Entry> entries = financialTransactionService.getAllEntrieByDatesAndAccountAndLettering(filter); FiscalPeriod fiscalPeriod = fiscalPeriodService.getFiscalPeriodForDate(filter.getDateStart()); - 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)); + 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); + 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)); + } + } } - entriesAndResume.addAll(entries); view.getTableModel().setValues(entriesAndResume); } @@ -304,62 +306,10 @@ public class AccountViewerViewHandler { if (log.isDebugEnabled()) { log.debug("balanceAndActions"); } - if (view.getTable().getSelectedRows().length == 0) { - onButtonModeChanged(ButtonMode.ALL); - onBalanceChanged(null); - } else if (!letteringNotExist(view.getTable().getSelectedRow())) { - - //lettred entries - onBalanceChanged(null); + onBalanceChanged(null); + if (view.getTable().getSelectedRows().length > 0 && !letteringNotExist(view.getTable().getSelectedRow()) || + view.getTable().getSelectedRows().length > 0 && !view.getAccountViewerSelectionModel().isSelectionEmpty()) { setValuesForSelectedEntries(); - - //For U.I. buttons (Lettering and unlettering) - onButtonModeChanged(ButtonMode.DELETTRED); - } else { - if (log.isDebugEnabled()) { - log.debug("unlettred entries"); - } - int[] selectedRows = view.getTable().getSelectedRows(); - if (selectedRows.length == 2) { - if (log.isDebugEnabled()) { - log.debug("2 rows selected"); - } - /*Treatment only if one of values contains decimals*/ - AccountViewerTableModel tableModel = view.getTableModel(); - Entry firstSelectedEntry = tableModel.get(selectedRows[0]); - Entry secondSelectedEntry = tableModel.get(selectedRows[1]); - - /*Get decimals*/ - BigDecimal firstSelectedEntryAmount = firstSelectedEntry.getAmount(); - BigDecimal secondSelectedEntryAmount = secondSelectedEntry.getAmount(); - - if ( secondSelectedEntry.isDebit() != firstSelectedEntry.isDebit() - && (firstSelectedEntryAmount.subtract(secondSelectedEntryAmount).abs().compareTo(BigDecimal.ZERO) >0 - && firstSelectedEntryAmount.subtract(secondSelectedEntryAmount).abs().compareTo(BigDecimal.ONE) <0) ) { - onButtonModeChanged(ButtonMode.EQUALIZED); - } - }else { - if (log.isDebugEnabled()) { - log.debug("!2 rows selected"); - } - onButtonModeChanged(ButtonMode.ALL); - } - - //Unlettred entries - onBalanceChanged(null); - //treatment unuseful if no rows are selected - if (!view.getAccountViewerSelectionModel().isSelectionEmpty()) { - if (log.isDebugEnabled()) { - log.debug("Rows selected"); - } - setValuesForSelectedEntries(); - onButtonModeChanged(ButtonMode.LETTRED); - } else { - if (log.isDebugEnabled()) { - log.debug("No Rows selected"); - } - onButtonModeChanged(ButtonMode.ALL); - } } } @@ -377,27 +327,6 @@ public class AccountViewerViewHandler { return emptyOrNull; } - public void onButtonModeChanged(ButtonMode buttonMode) { - - switch (buttonMode) { - case DELETTRED : - editModel.setLettred(false); - editModel.setUnLettred(true); - break; - case LETTRED: - editModel.setUnLettred(false); - editModel.setLettred(true); - break; - case EQUALIZED: - editModel.setEqualized(true); - break; - default: - editModel.setLettred(false); - editModel.setUnLettred(false); - editModel.setEqualized(false); - } - } - public void setValuesForSelectedEntries() { Entry selectedEntry; AccountViewerTableModel tableModel = view.getTableModel(); @@ -520,7 +449,46 @@ public class AccountViewerViewHandler { view.getAccountViewerSelectionModel().clearSelection(); } - private class DebitCreditSold { + public void setDateStart(Date date) { + filter.setDateStart(date); + updateAllEntries(); + } + + public void setDateEnd(Date date) { + 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 BALANCED: + 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; private BigDecimal sold; @@ -560,29 +528,4 @@ public class AccountViewerViewHandler { } } - public void setDateStart(Date date) { - filter.setDateStart(date); - updateAllEntries(); - } - - public void setDateEnd(Date date) { - 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; - } - } 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 new file mode 100644 index 0000000..8d69868 --- /dev/null +++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/SelectionMode.java @@ -0,0 +1,29 @@ +package org.chorem.lima.ui.accountViewer; + +import static org.nuiton.i18n.I18n.t; + +/** + * Created by davidcosse on 15/09/15. + */ +public enum SelectionMode { + + BALANCED, MANUAL; + + @Override + public String toString() { + + String result = ""; + + switch (this) { + case MANUAL: + result = t("lima.filter.condition.selectionMode.manual"); + break; + case BALANCED: + result = t("lima.filter.condition.selectionMode.balanced"); + break; + } + + return result; + + } +} 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 001c82c..f7ee250 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 @@ -224,6 +224,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.selectionMode=Balance entry selection +lima.filter.condition.selectionMode.balanced=Balanced +lima.filter.condition.selectionMode.manual=Manual lima.filter.credit=Add filter on credit lima.filter.date.interval=Filter on date range lima.filter.date.one=Filter for one date @@ -504,6 +507,7 @@ lima.table.provisionDeprecation=Provision Deprecation lima.table.voucher=Voucher lima.title=Lutin Invoice Monitoring and Accounting lima.transaction=Transaction +lima.ui.dateFormat=MM/dd/yyy lima.update=Modify lima.update.shortcut=Update (Ctrl+M) lima.vatStatement=VAT statement chart 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 b3139f1..7c5c9a4 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 @@ -233,6 +233,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.selectionMode=Sélection des écritures balancées +lima.filter.condition.selectionMode.balanced=Balancée +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 lima.filter.date.interval=Ajouter un filtre sur un interval de dates @@ -511,6 +514,7 @@ lima.table.provisionDeprecation=Amortissements et provisions lima.table.voucher=Pièce comptable lima.title=Lutin Invoice Monitoring and Accounting lima.transaction=Transaction +lima.ui.dateFormat=dd/MM/yyy lima.update=Modifier lima.update.shortcut=Modifier (Ctrl+M) lima.vatStatement=Plan TVA diff --git a/lima-swing/src/main/resources/icons/action-account-viewer.png b/lima-swing/src/main/resources/icons/action-account-viewer.png new file mode 100644 index 0000000..f6f840b Binary files /dev/null and b/lima-swing/src/main/resources/icons/action-account-viewer.png differ diff --git a/lima-swing/src/main/resources/icons/action-selection-mode.png b/lima-swing/src/main/resources/icons/action-selection-mode.png new file mode 100644 index 0000000..594d3a1 Binary files /dev/null and b/lima-swing/src/main/resources/icons/action-selection-mode.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