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
- 1853 discussions
r3498 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business-api/src/main/java/org/chorem/lima/business/api lima-callao/src/main/java/org/chorem/lima/entity lima-swing/src/main/java/org/chorem/lima/ui/lettering
by mallon@users.chorem.org 06 Jul '12
by mallon@users.chorem.org 06 Jul '12
06 Jul '12
Author: mallon
Date: 2012-07-06 15:19:17 +0200 (Fri, 06 Jul 2012)
New Revision: 3498
Url: http://chorem.org/repositories/revision/lima/3498
Log:
Correction concernant la gestion du filtre sur le lettrage des ?\195?\169critures (Boolean) et la requ?\195?\170te de chargement du tableau.
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-07-06 12:04:32 UTC (rev 3497)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-07-06 13:19:17 UTC (rev 3498)
@@ -267,22 +267,22 @@
* @param filtreLettre lettering
* */
@Override
- public List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, String filtreLettre) throws LimaException {
+ public List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean filtreLettre) throws LimaException {
List<FinancialTransaction> financialTransactions = null;
List<Entry> entries = new ArrayList<Entry>();
- try{
+ /* try{
FinancialTransactionDAO transactionDAO = getDaoHelper().getFinancialTransactionDAO();
financialTransactions = transactionDAO.findAllByDates(beginDate, endDate);
}catch (Exception ex){
throw new LimaException("Can't get financial transactions", ex);
- }
+ }*/
try {
EntryDAO entryDAO = getDaoHelper().getEntryDAO();
- for (FinancialTransaction financialTransaction : financialTransactions){
- entries.addAll(entryDAO.findAllEntryByAccountAndLettering(financialTransaction, account, filtreLettre));
- }
+ //for (FinancialTransaction financialTransaction : financialTransactions){
+ entries = entryDAO.findAllEntryByAccountAndLettering(beginDate, endDate, account, filtreLettre);
+ // }
} catch (Exception ex) {
throw new LimaException("Can't get entries", ex);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-07-06 12:04:32 UTC (rev 3497)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-07-06 13:19:17 UTC (rev 3498)
@@ -78,5 +78,5 @@
String getNewLetters() throws LimaException;
- List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, String filtreLettre) throws LimaException;
+ List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean filtreLettre) throws LimaException;
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-07-06 12:04:32 UTC (rev 3497)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-07-06 13:19:17 UTC (rev 3498)
@@ -178,25 +178,37 @@
/**
* Retourne toutes les entrées d'une transaction
* pour un compte et un lettrage
- *
- * @param financialTransaction transaction sur laquelle les entrées sont filtrées
+ * @param beginDate debut de la période
+ * @param endDate fin de la période
* @param account compte sur lequel les entrées sont filtrées
* @param filtreLettre toutes (all), non-lettrées ("null") ou lettrées ("notNull")
* @throws TopiaException
* */
- public List<Entry> findAllEntryByAccountAndLettering(FinancialTransaction financialTransaction, Account account, String filtreLettre) throws TopiaException {
+ public List<Entry> findAllEntryByAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean filtreLettre) throws TopiaException {
List<Entry> entries = null;
+ /* String query = "FROM " + FinancialTransaction.class.getName() + " T"+
+ " WHERE :beginDate <= T.transactionDate" +
+ " AND T.transactionDate <= :endDate" +
+ " ORDER BY T.transactionDate, T." + FinancialTransaction.TOPIA_CREATE_DATE;*/
- String query = "from " + Entry.class.getName() + " E " +
- " where E.financialTransaction = :financialTransaction" +
- " and E.account = :account ";
- if (filtreLettre.equals("null")){
- query += " and E.lettering is null";
- }else if (filtreLettre.equals("notNull")){
- query += " and E.lettering is not null";
+ String query = "Select E from " + Entry.class.getName() + " E, " + FinancialTransaction.class.getName() + " F" +
+ " where E.financialTransaction = F" +
+ " and E.account = :account ";
+
+ if (filtreLettre != null){
+ if (filtreLettre){
+ query += " and E.lettering is null";
+ }else if (!filtreLettre){
+ query += " and E.lettering is not null";
+ }
}
+ System.out.println(query);
- entries = context.findAll(query, "financialTransaction", financialTransaction, "account", account);
+ query += " and :beginDate <= F.transactionDate" +
+ " AND F.transactionDate <= :endDate"+
+ " ORDER BY F.transactionDate, F." + FinancialTransaction.TOPIA_CREATE_DATE;
+
+ entries = context.findAll(query, "account", account, "beginDate", beginDate, "endDate", endDate);
return entries;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2012-07-06 12:04:32 UTC (rev 3497)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2012-07-06 13:19:17 UTC (rev 3498)
@@ -64,7 +64,7 @@
<org.chorem.lima.ui.common.AccountComboBoxModel id="accountComboBoxModel"/>
<JComboBox id="accountComboBox" model="{accountComboBoxModel}"
renderer="{new org.chorem.lima.ui.common.AccountListRenderer()}"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), ( letteredCheckGroup.isSelected(noLettredEntryCheckBox.getModel()) || letteredCheckGroup.isSelected(lettredEntryCheckBox.getModel())))"/>
<JButton id="backCount" text="lima.ui.account.buttonback"
onActionPerformed="handler.back(accountComboBox)"/>
<JButton id="nextCount" text="lima.ui.account.buttonnext"
@@ -80,7 +80,7 @@
</cell>
<cell>
<JXDatePicker id="pickerDebut"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), ( letteredCheckGroup.isSelected(noLettredEntryCheckBox.getModel()) || letteredCheckGroup.isSelected(lettredEntryCheckBox.getModel())))"/>
</cell>
</row>
<row>
@@ -89,7 +89,7 @@
</cell>
<cell>
<JXDatePicker id="pickerFin"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), ( letteredCheckGroup.isSelected(noLettredEntryCheckBox.getModel()) || letteredCheckGroup.isSelected(lettredEntryCheckBox.getModel())))"/>
</cell>
</row>
</Table>
@@ -100,8 +100,8 @@
<Table>
<row>
<cell>
- <JRadioButton id="lettredEntryCheckBox" buttonGroup="letteredCheckGroup" value="notNull"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
+ <JRadioButton id="lettredEntryCheckBox" buttonGroup="letteredCheckGroup"
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), letteredCheckGroup.isSelected(noLettredEntryCheckBox.getModel()))"/>
</cell>
<cell>
<JLabel text="lima.ui.lettering.checkLettredEntry"/>
@@ -109,8 +109,8 @@
</row>
<row>
<cell>
- <JRadioButton id="noLettredEntryCheckBox" selected="true" buttonGroup="letteredCheckGroup" value="null"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
+ <JRadioButton id="noLettredEntryCheckBox" selected="true" buttonGroup="letteredCheckGroup"
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), letteredCheckGroup.isSelected(noLettredEntryCheckBox.getModel()))"/>
</cell>
<cell>
<JLabel text="lima.ui.lettering.checkNoLettredEntry"/>
@@ -118,8 +118,8 @@
</row>
<row>
<cell>
- <JRadioButton id="allCheckBox" buttonGroup="letteredCheckGroup" value="all"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
+ <JRadioButton id="allCheckBox" buttonGroup="letteredCheckGroup"
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), null)"/>
</cell>
<cell>
<JLabel text="lima.ui.lettering.checkAll"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-06 12:04:32 UTC (rev 3497)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-06 13:19:17 UTC (rev 3498)
@@ -131,25 +131,25 @@
log.debug("Val select letter : " + view.getLetteredCheckGroup().getSelectedButton().getName());
//Load entry with the default dates, default account 4 and with no letter
- updateAllEntries(defaultDateBegFiscalPeriod, defaultDateEndCurrent, (Account)view.getAccountComboBoxModel().getSelectedItem(), (String)view.getLetteredCheckGroup().getSelectedValue());
+ updateAllEntries(defaultDateBegFiscalPeriod, defaultDateEndCurrent, (Account)view.getAccountComboBoxModel().getSelectedItem(), view.getLetteredCheckGroup().isSelected(view.getNoLettredEntryCheckBox().getModel()));
if (log.isInfoEnabled()) {
log.info("Nb entries model (After update all entries) : " + view.getTableModel().getNumberOfEntries());
}
}
- protected List<Entry> findAllEntries(Date selectedBeginDate, Date selectedEndDate, Account compte, String filtreLettre){
+ protected List<Entry> findAllEntries(Date selectedBeginDate, Date selectedEndDate, Account compte, Boolean filtreLettre){
if (selectedBeginDate != null && selectedEndDate != null) {
if (log.isInfoEnabled()) {
log.info("FiltreLettre : " + filtreLettre);
}
List<Entry> entries =
- financialTransactionService.getAllEntrieByDatesAndAccountAndLettering(selectedBeginDate, selectedEndDate, compte, filtreLettre);
+ financialTransactionService.getAllEntrieByDatesAndAccountAndLettering(selectedBeginDate, selectedEndDate, compte, filtreLettre);
return entries;
}
return null;
}
- public void updateAllEntries(Date selectedBeginDate, Date selectedEndDate, Account compte, String filtreLettre) {
+ public void updateAllEntries(Date selectedBeginDate, Date selectedEndDate, Account compte, Boolean filtreLettre) {
if (selectedBeginDate != null && selectedEndDate != null){
log.debug("updateAllEntries");
1
0
r3497 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/resources/i18n lima-swing/src/main/java/org/chorem/lima/enums lima-swing/src/main/java/org/chorem/lima/ui lima-swing/src/main/java/org/chorem/lima/ui/importexport lima-swing/src/main/resources/i18n
by echatellier@users.chorem.org 06 Jul '12
by echatellier@users.chorem.org 06 Jul '12
06 Jul '12
Author: echatellier
Date: 2012-07-06 14:04:32 +0200 (Fri, 06 Jul 2012)
New Revision: 3497
Url: http://chorem.org/repositories/revision/lima/3497
Log:
fixes #685 : apply provided patch
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-07-06 12:04:32 UTC (rev 3497)
@@ -396,11 +396,11 @@
public String importAllAsCSV(String datas) throws LimaException {
StringBuilder result = new StringBuilder();
- LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements =
- new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
+ Map<String, List<FinancialStatementImport>> financialStatements =
+ new LinkedHashMap<String, List<FinancialStatementImport>>();
- LinkedHashMap<String, ArrayList<VatStatementImport>> vatStatements =
- new LinkedHashMap<String, ArrayList<VatStatementImport>>();
+ Map<String, List<VatStatementImport>> vatStatements =
+ new LinkedHashMap<String, List<VatStatementImport>>();
List<FiscalPeriod> fiscalPeriods = new ArrayList<FiscalPeriod>();
@@ -484,21 +484,31 @@
*/
@Override
public String importAsCSV(String datas,
- ImportExportEntityEnum importExportEntityEnum) throws LimaException {
+ ImportExportEntityEnum importExportEntityEnum)
+ throws LimaException {
StringBuilder result = new StringBuilder();
// FinancialStatements
- LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements = null;
+ Map<String, List<FinancialStatementImport>> financialStatements = null;
// VatStatement
- LinkedHashMap<String, ArrayList<VatStatementImport>> vatStatements = null;
+ Map<String, List<VatStatementImport>> vatStatements = null;
+ // Transactions and entries
+ Map<Integer, FinancialTransactionImport> financialTransactions = null;
+ Map<Integer, List<EntryImport>> entries = null;
+
switch (importExportEntityEnum) {
case FINANCIALSTATEMENT:
- financialStatements = new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
+ financialStatements = new LinkedHashMap<String, List<FinancialStatementImport>>();
break;
case VATSTATEMENT:
- vatStatements = new LinkedHashMap<String, ArrayList<VatStatementImport>>();
+ vatStatements = new LinkedHashMap<String, List<VatStatementImport>>();
break;
+ case FINANCIALTRANSACTION:
+ case ENTRY:
+ financialTransactions = new HashMap<Integer, FinancialTransactionImport>();
+ entries = new HashMap<Integer, List<EntryImport>>();
+ break;
}
try {
@@ -507,7 +517,9 @@
CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum) {
+ if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum
+ || importExportEntityEnum == ImportExportEntityEnum.FINANCIALTRANSACTION
+ || importExportEntityEnum == ImportExportEntityEnum.ENTRY) {
switch (importExportEntityEnum) {
case ENTRYBOOK:
result.append(importEntryBooksChartCSV(nextLine));
@@ -523,6 +535,23 @@
result.append(importVatStatementChartCSV(nextLine,
vatStatements));
break;
+ case FINANCIALTRANSACTION:
+ case ENTRY:
+ // Entries and transactions always go along
+ ImportExportEntityEnum type =
+ ImportExportEntityEnum.valueOfLabel(nextLine[0]);
+ if (type != null) {
+ switch (type) {
+ case FINANCIALTRANSACTION:
+ importFinancialTransactionsCSV(nextLine,
+ financialTransactions);
+ break;
+ case ENTRY:
+ importEntriesCSV(nextLine, entries);
+ break;
+ }
+ }
+ break;
}
}
}
@@ -535,6 +564,11 @@
case VATSTATEMENT:
result.append(createVatStatements(vatStatements));
break;
+ case FINANCIALTRANSACTION:
+ case ENTRY:
+ result.append(createFinancialTransactionsAndEntries(
+ financialTransactions, entries));
+ break;
}
} catch (Exception ex) {
@@ -597,31 +631,36 @@
/**
* Import and create accounts Structure : TYPE | accountNumber | label
- * | thirdparty | masterAccountNumber | generalLedgerNumber
+ * | [thirdparty]
*
- * @param nextLine
- * @param topiaContext
- * @return
- * @throws LimaException
+ * @param nextLine The line to import
+ * @return Success or error message
+ * @throws LimaException If the line format is invalid
* @throws TopiaException
*/
protected String importAccountsChartsCSV(String[] nextLine)
throws LimaException, TopiaException {
-
+ // Check line format
+ if (nextLine.length < 3
+ || ! nextLine[0].equals(ImportExportEntityEnum.ACCOUNT.getLabel())) {
+ throw new LimaException(_("lima-business.import.lineformatmismatch"));
+ }
+
StringBuilder result = new StringBuilder();
- String accountNumber = nextLine[1];
- String label = nextLine[2];
- String thirdParty = nextLine[3];
AccountDAO accountDAO = getDaoHelper().getAccountDAO();
-
- // if not exist, create it
+ String accountNumber = nextLine[1];
+ // if not exists, create it
if (accountDAO.findByAccountNumber(accountNumber) == null) {
Account account = new AccountImpl();
account.setAccountNumber(accountNumber);
+ String label = nextLine[2];
account.setLabel(label);
- account.setThirdParty(thirdParty);
+ if (nextLine.length > 3) {
+ String thirdParty = nextLine[3];
+ account.setThirdParty(thirdParty);
+ }
accountDAO.create(account);
result.append(_("lima-business.import.accountadded",
@@ -741,7 +780,7 @@
* @throws TopiaException
*/
protected String importFinancialsStatementChartCSV(String[] nextLine,
- LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements) throws LimaException, TopiaException {
+ Map<String, List<FinancialStatementImport>> financialStatements) throws LimaException, TopiaException {
StringBuilder result = new StringBuilder();
String label = nextLine[1];
@@ -802,7 +841,7 @@
* @throws TopiaException
*/
protected String importVatStatementChartCSV(String[] nextLine,
- Map<String, ArrayList<VatStatementImport>> vatStatements) throws LimaException, TopiaException {
+ Map<String, List<VatStatementImport>> vatStatements) throws LimaException, TopiaException {
StringBuilder result = new StringBuilder();
@@ -842,12 +881,10 @@
/**
* Import and create financialtransactions Structure : TYPE | NumTransac |
- * TransactionDate | AmountDebit | AmountCredit | FinancialPeriod BeginDate
- * | FinancialPeriod EndDate | EntryBook Code
+ * TransactionDate | AmountDebit | AmountCredit | EntryBook Code
*
* @param nextLine
* @param financialTransactions
- * @param topiaContext
* @throws LimaException
*/
protected void importFinancialTransactionsCSV(String[] nextLine,
@@ -864,13 +901,10 @@
/**
* Import and create entries Structure : TYPE | NumTransac | Description |
- * Amount | Debit | Lettering | Detail | Voucher | Position
- * | FinancialTransaction Date | FinancialTransaction EntryBookCode |
- * FinancialTransaction AmountDebit | FinancialTransaction AmountCredit
+ * Amount | Debit | Lettering | Detail | Voucher | Position | Account
*
* @param nextLine
* @param entries
- * @param topiaContext
* @throws LimaException
*/
protected void importEntriesCSV(String[] nextLine,
@@ -904,13 +938,13 @@
* @deprecated do only one method import without bean use (and remove beans)
*/
@Deprecated
- protected String createFinancialStatements(Map<String, ArrayList<FinancialStatementImport>> financialStatements) throws LimaException, TopiaException {
+ protected String createFinancialStatements(Map<String, List<FinancialStatementImport>> financialStatements) throws LimaException, TopiaException {
StringBuilder result = new StringBuilder();
FinancialStatementDAO financialStatementDAO = getDaoHelper().getFinancialStatementDAO();
while (financialStatements.size() > 0) {
- for (Iterator<ArrayList<FinancialStatementImport>> itr = financialStatements
+ for (Iterator<List<FinancialStatementImport>> itr = financialStatements
.values().iterator(); itr.hasNext(); ) {
List<FinancialStatementImport> financialStatementImports =
itr.next();
@@ -987,14 +1021,14 @@
* @deprecated do only one method import without bean use (and remove beans)
*/
@Deprecated
- protected String createVatStatements(Map<String, ArrayList<VatStatementImport>> vatStatements) throws LimaException, TopiaException {
+ protected String createVatStatements(Map<String, List<VatStatementImport>> vatStatements) throws LimaException, TopiaException {
StringBuilder result = new StringBuilder();
VatStatementDAO vatStatementDAO = getDaoHelper().getVatStatementDAO();
while (vatStatements.size() > 0) {
- for (Iterator<ArrayList<VatStatementImport>> itr = vatStatements
+ for (Iterator<List<VatStatementImport>> itr = vatStatements
.values().iterator(); itr.hasNext(); ) {
List<VatStatementImport> vatStatementImports =
itr.next();
@@ -1161,7 +1195,6 @@
financialTransaction.addEntry(entry);
}
}
-
return result.toString();
}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2012-07-06 12:04:32 UTC (rev 3497)
@@ -85,6 +85,7 @@
lima-business.import.fiscalperiodadded=SUCCESS \: The fiscalPeriod %s - %s is created \! \n
lima-business.import.fiscalperiodalreadyexist=FAILED \: The fiscal period %s - %s already exists \!\n
lima-business.import.identityadded=SUCCESS \: The identity %s is created \! \n
+lima-business.import.lineformatmismatch=Line format is invalid.
lima-business.import.noaccount=ERROR \: This file contains no account
lima-business.import.nofiscalperiodopen=FAILED \: No Fiscal period open \! \n
lima-business.import.transactionadded=SUCCES \: FinancialTransaction, %s - %s, added\n
Modified: trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2012-07-06 12:04:32 UTC (rev 3497)
@@ -85,6 +85,7 @@
lima-business.import.fiscalperiodadded=Succès \: Exercice %s - %s ajoutée \! \n
lima-business.import.fiscalperiodalreadyexist=u00C9chec \: L'exerice %s - %s existe déjà \!\n
lima-business.import.identityadded=Succès \: Identité %s ajoutée \! \n
+lima-business.import.lineformatmismatch=Le format de la ligne est incorrect.
lima-business.import.noaccount=Erreur \: Ce fichier ne contient aucun compte.
lima-business.import.nofiscalperiodopen=u00C9chec \: Aucun exercice ouvert \! \n
lima-business.import.transactionadded=Succès \: Transaction, %s, %s, ajoutée\n
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2012-07-06 12:04:32 UTC (rev 3497)
@@ -33,6 +33,7 @@
CSV_ENTRYBOOKS_EXPORT(false, true), CSV_ENTRYBOOKS_IMPORT(true, true),
CSV_FINANCIALSTATEMENTS_EXPORT(false, true), CSV_FINANCIALSTATEMENTS_IMPORT(true, true),
CSV_VAT_EXPORT(false, true), CSV_VAT_IMPORT(true, true),
+ CSV_ENTRIES_IMPORT(true, true),
PDF_VAT_EXPORT(false, true), PDF_VAT_IMPORT(true, true),
EBP_ACCOUNTCHARTS_EXPORT(false, false), EBP_ENTRIES_EXPORT(false, false),
EBP_ACCOUNTCHARTS_IMPORT(true, false), EBP_ENTRIES_IMPORT(true, false);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2012-07-06 12:04:32 UTC (rev 3497)
@@ -74,6 +74,8 @@
onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT)'/>
<JMenuItem text="lima.ui.importexport.vatstatements"
onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_VAT_IMPORT)'/>
+ <JMenuItem text="lima.ui.importexport.financialtransactions"
+ onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ENTRIES_IMPORT)'/>
</JMenu>
<JMenu text="lima.ui.importexport.export" actionIcon='export-element'>
<JMenuItem text="lima.ui.importexport.all"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2012-07-06 12:04:32 UTC (rev 3497)
@@ -174,6 +174,10 @@
datas = extractFile(filePath, charset.getEncoding());
result = importService.importAsCSV(datas, ImportExportEntityEnum.VATSTATEMENT);
break;
+ case CSV_ENTRIES_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.ENTRY);
+ break;
case PDF_VAT_IMPORT:
int response = JOptionPane.showConfirmDialog(waitView,
_("lima.importexport.usevatpdf"),
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-07-06 12:04:32 UTC (rev 3497)
@@ -311,6 +311,7 @@
lima.ui.importexport.export=Export
lima.ui.importexport.export.terminated=Export terminated
lima.ui.importexport.financialstatements=FinancialStatements chart
+lima.ui.importexport.financialtransactions=Moves
lima.ui.importexport.import=
lima.ui.importexport.import.terminated=Import terminated
lima.ui.importexport.import.vatpdfimport=The PDF has been imported. It can be found inside the Lima resources directory
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-07-06 10:17:38 UTC (rev 3496)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-07-06 12:04:32 UTC (rev 3497)
@@ -311,6 +311,7 @@
lima.ui.importexport.export=Export
lima.ui.importexport.export.terminated=Export terminé
lima.ui.importexport.financialstatements=Plan BCR
+lima.ui.importexport.financialtransactions=Écritures
lima.ui.importexport.import=Importer
lima.ui.importexport.import.terminated=Import terminé
lima.ui.importexport.import.vatpdfimport=Le PDF a bien été importé dans le répertoire des ressources de Lima
1
0
r3496 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business-api/src/main/java/org/chorem/lima/business/api lima-callao/src/main/java/org/chorem/lima/entity lima-swing/src/main/java/org/chorem/lima/ui/common lima-swing/src/main/java/org/chorem/lima/ui/lettering
by mallon@users.chorem.org 06 Jul '12
by mallon@users.chorem.org 06 Jul '12
06 Jul '12
Author: mallon
Date: 2012-07-06 12:17:38 +0200 (Fri, 06 Jul 2012)
New Revision: 3496
Url: http://chorem.org/repositories/revision/lima/3496
Log:
Correction et optimisation sur le filtrage par comptes, p?\195?\169riode et lettrage : cr?\195?\169ation et utilisation d'une nouvelle requ?\195?\170te de s?\195?\169lection.
fixes #683
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-07-06 10:17:38 UTC (rev 3496)
@@ -25,25 +25,21 @@
package org.chorem.lima.business.ejb;
-import static org.nuiton.i18n.I18n._;
-
-import java.awt.Color;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-import javax.ejb.EJB;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-
+import com.lowagie.text.BadElementException;
+import com.lowagie.text.Cell;
+import com.lowagie.text.Chapter;
+import com.lowagie.text.DocWriter;
+import com.lowagie.text.Document;
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.Element;
+import com.lowagie.text.Font;
+import com.lowagie.text.PageSize;
+import com.lowagie.text.Paragraph;
+import com.lowagie.text.Phrase;
+import com.lowagie.text.Rectangle;
+import com.lowagie.text.Table;
+import com.lowagie.text.html.HtmlWriter;
+import com.lowagie.text.pdf.PdfWriter;
import org.apache.pdfbox.examples.fdf.SetField;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.chorem.lima.beans.BalanceTrial;
@@ -72,22 +68,24 @@
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.VatStatement;
-import com.lowagie.text.BadElementException;
-import com.lowagie.text.Cell;
-import com.lowagie.text.Chapter;
-import com.lowagie.text.DocWriter;
-import com.lowagie.text.Document;
-import com.lowagie.text.DocumentException;
-import com.lowagie.text.Element;
-import com.lowagie.text.Font;
-import com.lowagie.text.PageSize;
-import com.lowagie.text.Paragraph;
-import com.lowagie.text.Phrase;
-import com.lowagie.text.Rectangle;
-import com.lowagie.text.Table;
-import com.lowagie.text.html.HtmlWriter;
-import com.lowagie.text.pdf.PdfWriter;
+import javax.ejb.EJB;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import java.awt.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import static org.nuiton.i18n.I18n._;
+
@Stateless
@Remote(DocumentService.class)
@TransactionAttribute
@@ -750,7 +748,7 @@
// TODO echatellier 20120509, was not about only
// balanced transaction here, normal ?
- List<Entry> entries = entryDAO.findAllEntryOfTransaction(closedPeriodicEntryBook.getEntryBook(),
+ List<Entry> entries = entryDAO.findAllEntryByDateForEntryBook(closedPeriodicEntryBook.getEntryBook(),
closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(),
closedPeriodicEntryBook.getFinancialPeriod().getEndDate());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-07-06 10:17:38 UTC (rev 3496)
@@ -260,6 +260,41 @@
}
/**
+ * Get all entries by dates, account and lettering
+ * @param beginDate begin date
+ * @param endDate end date
+ * @param account acount
+ * @param filtreLettre lettering
+ * */
+ @Override
+ public List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, String filtreLettre) throws LimaException {
+ List<FinancialTransaction> financialTransactions = null;
+ List<Entry> entries = new ArrayList<Entry>();
+
+ try{
+ FinancialTransactionDAO transactionDAO = getDaoHelper().getFinancialTransactionDAO();
+ financialTransactions = transactionDAO.findAllByDates(beginDate, endDate);
+ }catch (Exception ex){
+ throw new LimaException("Can't get financial transactions", ex);
+ }
+
+ try {
+ EntryDAO entryDAO = getDaoHelper().getEntryDAO();
+ for (FinancialTransaction financialTransaction : financialTransactions){
+ entries.addAll(entryDAO.findAllEntryByAccountAndLettering(financialTransaction, account, filtreLettre));
+ }
+ } catch (Exception ex) {
+ throw new LimaException("Can't get entries", ex);
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Entries size : " + entries.size());
+ }
+
+ return entries;
+ }
+
+ /**
* Method used by update entry and remove entry for update amounts.
*/
@Override
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-07-06 10:17:38 UTC (rev 3496)
@@ -25,17 +25,18 @@
package org.chorem.lima.business.api;
-import java.util.Date;
-import java.util.List;
-
import org.chorem.lima.beans.FinancialTransactionSearch;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FiscalPeriod;
+import java.util.Date;
+import java.util.List;
+
/**
* Transaction service.
*
@@ -76,4 +77,6 @@
void removeEntry(Entry entry) throws LimaException;
String getNewLetters() throws LimaException;
+
+ List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, String filtreLettre) throws LimaException;
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-07-06 10:17:38 UTC (rev 3496)
@@ -161,8 +161,8 @@
* @param endDate end date
* @throws TopiaException
*/
- public List<Entry> findAllEntryOfTransaction(EntryBook entryBook, Date beginDate,
- Date endDate) throws TopiaException {
+ public List<Entry> findAllEntryByDateForEntryBook(EntryBook entryBook, Date beginDate,
+ Date endDate) throws TopiaException {
String query = "FROM " + Entry.class.getName() + " E" +
// entre les 2 dates
" WHERE :beginDate <= E.financialTransaction.transactionDate" +
@@ -176,6 +176,31 @@
}
/**
+ * Retourne toutes les entrées d'une transaction
+ * pour un compte et un lettrage
+ *
+ * @param financialTransaction transaction sur laquelle les entrées sont filtrées
+ * @param account compte sur lequel les entrées sont filtrées
+ * @param filtreLettre toutes (all), non-lettrées ("null") ou lettrées ("notNull")
+ * @throws TopiaException
+ * */
+ public List<Entry> findAllEntryByAccountAndLettering(FinancialTransaction financialTransaction, Account account, String filtreLettre) throws TopiaException {
+ List<Entry> entries = null;
+
+ String query = "from " + Entry.class.getName() + " E " +
+ " where E.financialTransaction = :financialTransaction" +
+ " and E.account = :account ";
+ if (filtreLettre.equals("null")){
+ query += " and E.lettering is null";
+ }else if (filtreLettre.equals("notNull")){
+ query += " and E.lettering is not null";
+ }
+
+ entries = context.findAll(query, "financialTransaction", financialTransaction, "account", account);
+ return entries;
+ }
+
+ /**
* Retourne la somme des entrées des transaction entre
* deux dates pour un journal donné.
*
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java 2012-07-06 10:17:38 UTC (rev 3496)
@@ -25,17 +25,17 @@
package org.chorem.lima.entity;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
import org.apache.commons.collections.CollectionUtils;
import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.beans.FinancialTransactionSearch;
import org.hibernate.HibernateException;
import org.nuiton.topia.TopiaException;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
/**
* Ajout de requetes specifiques aux financial transaction sur le DAO.
*
@@ -261,7 +261,7 @@
return result;
}
-
+
/**
* Search financial transaction.
*
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AccountComboBoxModel.java 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AccountComboBoxModel.java 2012-07-06 10:17:38 UTC (rev 3496)
@@ -40,7 +40,7 @@
/*By default, selection of the account 4*/
@Override
- public Object getElementAt(int index) {
+ public Account getElementAt(int index) {
if (getSelectedItem() == null){
int indexAccountFour = 0;
for (Account compte : objects){
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2012-07-06 10:17:38 UTC (rev 3496)
@@ -28,8 +28,7 @@
<import>
org.chorem.lima.ui.common.AccountComboBoxModel
org.chorem.lima.ui.common.FinancialPeriodComboBoxModel
- org.chorem.lima.entity.FiscalPeriod
- org.chorem.lima.entity.FinancialPeriod
+ org.chorem.lima.entity.Account
javax.swing.ListSelectionModel
org.jdesktop.swingx.JXDatePicker;
</import>
@@ -65,7 +64,7 @@
<org.chorem.lima.ui.common.AccountComboBoxModel id="accountComboBoxModel"/>
<JComboBox id="accountComboBox" model="{accountComboBoxModel}"
renderer="{new org.chorem.lima.ui.common.AccountListRenderer()}"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), accountComboBox.getSelectedItem(), letteredCheckGroup.getSelectedButton().getName())"/>
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
<JButton id="backCount" text="lima.ui.account.buttonback"
onActionPerformed="handler.back(accountComboBox)"/>
<JButton id="nextCount" text="lima.ui.account.buttonnext"
@@ -81,7 +80,7 @@
</cell>
<cell>
<JXDatePicker id="pickerDebut"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), accountComboBox.getSelectedItem(), letteredCheckGroup.getSelectedButton().getName())"/>
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
</cell>
</row>
<row>
@@ -90,7 +89,7 @@
</cell>
<cell>
<JXDatePicker id="pickerFin"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), accountComboBox.getSelectedItem(), letteredCheckGroup.getSelectedButton().getName())"/>
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
</cell>
</row>
</Table>
@@ -101,8 +100,8 @@
<Table>
<row>
<cell>
- <JRadioButton id="lettredEntryCheckBox" buttonGroup="letteredCheckGroup"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), accountComboBox.getSelectedItem(), letteredCheckGroup.getSelectedButton().getName())"/>
+ <JRadioButton id="lettredEntryCheckBox" buttonGroup="letteredCheckGroup" value="notNull"
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
</cell>
<cell>
<JLabel text="lima.ui.lettering.checkLettredEntry"/>
@@ -110,8 +109,8 @@
</row>
<row>
<cell>
- <JRadioButton id="noLettredEntryCheckBox" selected="true" buttonGroup="letteredCheckGroup"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), accountComboBox.getSelectedItem(), letteredCheckGroup.getSelectedButton().getName())"/>
+ <JRadioButton id="noLettredEntryCheckBox" selected="true" buttonGroup="letteredCheckGroup" value="null"
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
</cell>
<cell>
<JLabel text="lima.ui.lettering.checkNoLettredEntry"/>
@@ -119,8 +118,8 @@
</row>
<row>
<cell>
- <JRadioButton id="allCheckBox" buttonGroup="letteredCheckGroup"
- onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), accountComboBox.getSelectedItem(), letteredCheckGroup.getSelectedButton().getName())"/>
+ <JRadioButton id="allCheckBox" buttonGroup="letteredCheckGroup" value="all"
+ onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), (String)letteredCheckGroup.getSelectedValue())"/>
</cell>
<cell>
<JLabel text="lima.ui.lettering.checkAll"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-06 07:57:01 UTC (rev 3495)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-06 10:17:38 UTC (rev 3496)
@@ -36,7 +36,6 @@
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.service.LimaServiceFactory;
@@ -132,40 +131,25 @@
log.debug("Val select letter : " + view.getLetteredCheckGroup().getSelectedButton().getName());
//Load entry with the default dates, default account 4 and with no letter
- updateAllEntries(defaultDateBegFiscalPeriod, defaultDateEndCurrent, view.getAccountComboBoxModel().getSelectedItem(), view.getLetteredCheckGroup().getSelectedButton().getName());
+ updateAllEntries(defaultDateBegFiscalPeriod, defaultDateEndCurrent, (Account)view.getAccountComboBoxModel().getSelectedItem(), (String)view.getLetteredCheckGroup().getSelectedValue());
if (log.isInfoEnabled()) {
log.info("Nb entries model (After update all entries) : " + view.getTableModel().getNumberOfEntries());
}
}
- protected List<Entry> findAllEntries(Date selectedBeginDate, Date selectedEndDate, Object compte, String filtreLettre){
-
- List<Entry> entries = new ArrayList<Entry>();
- List<Entry> entriesAccount = new ArrayList<Entry>();
+ protected List<Entry> findAllEntries(Date selectedBeginDate, Date selectedEndDate, Account compte, String filtreLettre){
if (selectedBeginDate != null && selectedEndDate != null) {
- List<FinancialTransaction> financialtransactions =
- financialTransactionService.getAllFinancialTransactions(selectedBeginDate, selectedEndDate);
- for (FinancialTransaction financialtransaction : financialtransactions) {
- entries = (List<Entry>) financialtransaction.getEntry();
+ if (log.isInfoEnabled()) {
+ log.info("FiltreLettre : " + filtreLettre);
}
- if (compte != null){
- for(Entry entry : entries){
- log.debug("entry.getLettering() : " + entry.getLettering());
- log.debug("name radioButton : " + filtreLettre);
- //0 for lettered, 1 for no-lettered and 2 for all entries
- if (compte.equals(entry.getAccount()) && ( (filtreLettre.equals("noLettredEntryCheckBox") & entry.getLettering() == null))
- || (filtreLettre.equals("lettredEntryCheckBox") & entry.getLettering() != null) || filtreLettre.equals("allCheckBox")){
- entriesAccount.add(entry);
- }
- }
- log.debug("entriesAccount size : " + entriesAccount.size());
- return entriesAccount;
- }
+ List<Entry> entries =
+ financialTransactionService.getAllEntrieByDatesAndAccountAndLettering(selectedBeginDate, selectedEndDate, compte, filtreLettre);
+ return entries;
}
- return entries;
+ return null;
}
- public void updateAllEntries(Date selectedBeginDate, Date selectedEndDate, Object compte, String filtreLettre) {
+ public void updateAllEntries(Date selectedBeginDate, Date selectedEndDate, Account compte, String filtreLettre) {
if (selectedBeginDate != null && selectedEndDate != null){
log.debug("updateAllEntries");
1
0
r3495 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering
by mallon@users.chorem.org 06 Jul '12
by mallon@users.chorem.org 06 Jul '12
06 Jul '12
Author: mallon
Date: 2012-07-06 09:57:01 +0200 (Fri, 06 Jul 2012)
New Revision: 3495
Url: http://chorem.org/repositories/revision/lima/3495
Log:
Correction pour la d?\195?\169s?\195?\169lection de lignes quand :
- une ?\195?\169criture lettr?\195?\169e est s?\195?\169lectionn?\195?\169e, puis une non-lettr?\195?\169e s?\195?\169lectionn?\195?\169e ?\195?\160 son tour.
- un filtre est utilis?\195?\169.
refs #681
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 16:31:54 UTC (rev 3494)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-06 07:57:01 UTC (rev 3495)
@@ -154,10 +154,16 @@
// no line selected or line selected different of the current
if (isSelectionEmpty() || currentEntry != null || !currentLettring.equals(entryAt.getLettering())){
-
+ if (log.isInfoEnabled()) {
+ log.info("First");
+ }
//Test not null for currentEntry cause of selection before of entry without letter
- if (currentEntry != null){
+ if (currentEntry != null && currentLettring==null){
+ if (log.isInfoEnabled()) {
+ log.info("First_A");
+ }
super.clearSelection();
+ currentEntry = null;
debitTotal = BigDecimal.ZERO;
creditTotal = BigDecimal.ZERO;
soldeTotal = BigDecimal.ZERO;
@@ -179,8 +185,15 @@
//no line selected or line selected different of the current
//Test null for currentEntry cause of selection before entry with letter
if (isSelectionEmpty() || currentEntry == null || !currentEntry.equals(entryAt)){
+ if (log.isInfoEnabled()) {
+ log.info("Second");
+ }
if (currentEntry == null && currentLettring != null){
+ if (log.isInfoEnabled()) {
+ log.info("Second_A");
+ }
super.clearSelection();
+ currentLettring = null;
debitTotal = BigDecimal.ZERO;
creditTotal = BigDecimal.ZERO;
soldeTotal = BigDecimal.ZERO;
@@ -260,10 +273,4 @@
// do nothing
}
- @Override
- public void clearSelection() {
- // do nothing
- }
-
-
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-05 16:31:54 UTC (rev 3494)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-06 07:57:01 UTC (rev 3495)
@@ -184,6 +184,7 @@
}
}
view.getModelUi().resetDebitCreditBalance();
+ view.getModelUi().clearSelection();
}
/**
@@ -198,6 +199,7 @@
comboBox.setSelectedIndex(row - 1);
}
view.getModelUi().resetDebitCreditBalance();
+ view.getModelUi().clearSelection();
}
/**
@@ -213,6 +215,7 @@
comboBox.setSelectedIndex(row + 1);
}
view.getModelUi().resetDebitCreditBalance();
+ view.getModelUi().clearSelection();
}
public void setBeginDate(Date date) {
@@ -245,12 +248,6 @@
}
}
- /*public void nonConsecutiveSelection(int[] selectedRows){
- for (int row : selectedRows){
- view.getTable().addRowSelectionInterval(row, row);
- }
- }*/
-
@Override
public void notifyMethod(String serviceName, String methodeName) {
}
1
0
r3494 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering
by mallon@users.chorem.org 05 Jul '12
by mallon@users.chorem.org 05 Jul '12
05 Jul '12
Author: mallon
Date: 2012-07-05 18:31:54 +0200 (Thu, 05 Jul 2012)
New Revision: 3494
Url: http://chorem.org/repositories/revision/lima/3494
Log:
Correction du mod?\195?\168le de l'interface de lettrage pour la remise ?\195?\160 z?\195?\169ro des montants de d?\195?\169bit / cr?\195?\169dit / solde, lors de l'utilisation des filtres.
fixes #682
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 15:21:06 UTC (rev 3493)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 16:31:54 UTC (rev 3494)
@@ -28,7 +28,6 @@
protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
- /** log. */
private static final Log log = LogFactory.getLog(LetteringModelUI.class);
protected LetteringTableModel model;
@@ -49,6 +48,15 @@
this.model = model;
}
+ public void resetDebitCreditBalance(){
+ setDebit(BigDecimal.ZERO);
+ setCredit(BigDecimal.ZERO);
+ setSolde(BigDecimal.ZERO);
+ debitTotal = BigDecimal.ZERO;
+ creditTotal = BigDecimal.ZERO;
+ soldeTotal = BigDecimal.ZERO;
+ }
+
public Entry getSelectedEntry() {
return selectedEntry;
}
@@ -108,7 +116,7 @@
this.solde = solde;
firePropertyChange(SOLDE_PROPERTY, oldSolde, solde);
}
-
+
public void addPropertyChangeListener(PropertyChangeListener listener) {
pcs.addPropertyChangeListener(listener);
}
@@ -136,6 +144,8 @@
@Override
public void setSelectionInterval(int row, int column) {
+ setLettrer(false);
+ setDelettrer(false);
Entry entryAt = model.getEntryAt(row);
List<Entry> modelEntries = model.getEntries();
setSelectedEntry(entryAt);
@@ -167,9 +177,9 @@
}
}else{
//no line selected or line selected different of the current
- //Test null for currentEntry cause of selection before of entry with letter
+ //Test null for currentEntry cause of selection before entry with letter
if (isSelectionEmpty() || currentEntry == null || !currentEntry.equals(entryAt)){
- if (currentLettring != null){
+ if (currentEntry == null && currentLettring != null){
super.clearSelection();
debitTotal = BigDecimal.ZERO;
creditTotal = BigDecimal.ZERO;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-07-05 15:21:06 UTC (rev 3493)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-07-05 16:31:54 UTC (rev 3494)
@@ -59,7 +59,6 @@
/** serialVersionUID. */
private static final long serialVersionUID = 1L;
- /** log. */
private static final Log log = LogFactory.getLog(LetteringTableModel.class);
/** Transaction service. */
@@ -106,7 +105,7 @@
return null;
}
- public int getNUmberOfEntries(){
+ public int getNumberOfEntries(){
return entries.size();
}
@@ -134,10 +133,6 @@
selectedEndDate = date;
}
- public void removeLetter(int row) {
- //TODO
- }
-
@Override
public int getColumnCount() {
return 7;
@@ -289,33 +284,6 @@
fireTableDataChanged();
}
- /** to modifiy letter entry */
- /* @Override
- public void setValueAt(Object value, int row, int column) {*/
- //TODO
- /*int financialTransactionRow = 0;
- if (cacheDataList != null) {
- Object currentRow = cacheDataList.get(row);
- if (currentRow instanceof Entry) {
- Entry currentEntry = (Entry) currentRow;
- switch (column) {
- case 4:
- currentEntry.setLettering((String) value);
- break;
- }
-
- financialTransactionService.updateEntry(currentEntry);*/
-
- //update the financial transaction in entire
- /*financialTransactionRow =
- getDataList().indexOf(((Entry) currentRow).
- getFinancialTransaction());*/
- /* }
- //on recharge la liste
- fireTableRowsUpdated(financialTransactionRow, getRowCount() - 1);
- }*/
- //}
-
@Override
public void notifyMethod(String serviceName, String methodeName) {
if (serviceName.contains("FinancialTransaction") ||
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-05 15:21:06 UTC (rev 3493)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-05 16:31:54 UTC (rev 3494)
@@ -57,19 +57,12 @@
*/
public class LetteringViewHandler implements ServiceListener{
- /** log. */
private static final Log log = LogFactory.getLog(LetteringViewHandler.class);
protected LetteringView view;
protected LetteringTable table;
- /*protected LetteringTableModel tableModel;
-
- protected FiscalPeriodComboBoxModel fiscalPeriodComboBoxModel;
-
- protected FinancialPeriodComboBoxModel financialPeriodComboBoxModel;*/
-
/** Transaction service. */
protected FiscalPeriodService fiscalPeriodService;
protected FinancialPeriodService financialPeriodService;
@@ -92,50 +85,6 @@
*/
public void init() {
loadComboAndRows();
- /*LetteringModelUI modelUi = view.getModelUi();
-
- modelUi.addListSelectionListener(new ListSelectionListener(){
- List<Entry> entries = new ArrayList<Entry>();
-
- @Override
- public void valueChanged(ListSelectionEvent evt) {
-
- LetteringModelUI modelUiPropChange = (LetteringModelUI)evt.getSource();
- if (evt.getValueIsAdjusting()){
- LetteringTableModel tableModel = view.getTableModel();
- LetteringTable table = view.getTable();
- int nbEntriesModel = tableModel.getNUmberOfEntries();
-
- Entry lastEntry = tableModel.getEntryAt(evt.getLastIndex());
- int nbSelectedRowTable = table.getSelectedRows().length;
- int sizeEntries = entries.size();
-
- if (log.isInfoEnabled()) {
- log.info("Size list entries : " + sizeEntries + "\n" +
- "Nb selected row : " + nbSelectedRowTable + "\n"+
- "Nb ligne model : " + nbEntriesModel);
- }
-
- //Managing selection
- if (nbSelectedRowTable > sizeEntries || (nbSelectedRowTable==sizeEntries && nbSelectedRowTable==1)){
- entries.add(lastEntry);
- if (log.isInfoEnabled()) {
- log.info("Add entry");
- }
- }else if (nbSelectedRowTable < sizeEntries){
- entries.remove(entries.size() - 1);
- if (log.isInfoEnabled()) {
- log.info("Remove entry");
- }
- }
-
- if (log.isInfoEnabled()) {
- log.info("Size entries after update : " + entries.size());
- }
- loadCurrentSelection(modelUiPropChange, entries);
- }
- }
- });*/
}
public void loadComboAndRows(){
@@ -185,7 +134,7 @@
//Load entry with the default dates, default account 4 and with no letter
updateAllEntries(defaultDateBegFiscalPeriod, defaultDateEndCurrent, view.getAccountComboBoxModel().getSelectedItem(), view.getLetteredCheckGroup().getSelectedButton().getName());
if (log.isInfoEnabled()) {
- log.info("Nb entries model (After update all entries) : " + view.getTableModel().getNUmberOfEntries());
+ log.info("Nb entries model (After update all entries) : " + view.getTableModel().getNumberOfEntries());
}
}
@@ -231,9 +180,10 @@
view.getTableModel().updateEntries(entries, datesEntree, journalEntrees);
if (log.isInfoEnabled()) {
- log.info("Nb entries model : " + view.getTableModel().getNUmberOfEntries());
+ log.info("Nb entries model : " + view.getTableModel().getNumberOfEntries());
}
}
+ view.getModelUi().resetDebitCreditBalance();
}
/**
@@ -247,6 +197,7 @@
if (row > 0) {
comboBox.setSelectedIndex(row - 1);
}
+ view.getModelUi().resetDebitCreditBalance();
}
/**
@@ -261,6 +212,7 @@
if (row < size - 1) {
comboBox.setSelectedIndex(row + 1);
}
+ view.getModelUi().resetDebitCreditBalance();
}
public void setBeginDate(Date date) {
1
0
r3493 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/lettering resources
by mallon@users.chorem.org 05 Jul '12
by mallon@users.chorem.org 05 Jul '12
05 Jul '12
Author: mallon
Date: 2012-07-05 17:21:06 +0200 (Thu, 05 Jul 2012)
New Revision: 3493
Url: http://chorem.org/repositories/revision/lima/3493
Log:
Correction du mod?\195?\168le de l'interface de lettrage pour les calculs du d?\195?\169bit, cr?\195?\169dit et de la solde, en fonction des ?\195?\169critures s?\195?\169lectionn?\195?\169es.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
trunk/lima-swing/src/main/resources/log4j.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 13:10:00 UTC (rev 3492)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 15:21:06 UTC (rev 3493)
@@ -1,5 +1,7 @@
package org.chorem.lima.ui.lettering;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Entry;
import javax.swing.*;
@@ -25,16 +27,21 @@
private static final long serialVersionUID = 1L;
protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
-
+
+ /** log. */
+ private static final Log log = LogFactory.getLog(LetteringModelUI.class);
+
protected LetteringTableModel model;
protected Entry selectedEntry;
protected BigDecimal debit = BigDecimal.ZERO;
protected BigDecimal credit = BigDecimal.ZERO;
protected BigDecimal solde = BigDecimal.ZERO;
+ protected BigDecimal debitTotal = BigDecimal.ZERO;
+ protected BigDecimal creditTotal = BigDecimal.ZERO;
+ protected BigDecimal soldeTotal = BigDecimal.ZERO;
protected boolean lettrer;
protected boolean delettrer;
-
protected String currentLettring;
protected Entry currentEntry;
@@ -130,6 +137,7 @@
@Override
public void setSelectionInterval(int row, int column) {
Entry entryAt = model.getEntryAt(row);
+ List<Entry> modelEntries = model.getEntries();
setSelectedEntry(entryAt);
if (entryAt.getLettering() != null){
@@ -140,12 +148,14 @@
//Test not null for currentEntry cause of selection before of entry without letter
if (currentEntry != null){
super.clearSelection();
+ debitTotal = BigDecimal.ZERO;
+ creditTotal = BigDecimal.ZERO;
+ soldeTotal = BigDecimal.ZERO;
}
currentLettring = entryAt.getLettering();
super.setSelectionInterval(row, column);
//select entries with the same letter of the selected entry
- List<Entry> modelEntries = model.getEntries();
for(Entry entry : modelEntries){
if (entry.getLettering() != null && !entry.getLettering().isEmpty()){
if (entry.getLettering().equals(entryAt.getLettering())){
@@ -155,24 +165,79 @@
}
}
}
-
}else{
-
//no line selected or line selected different of the current
//Test null for currentEntry cause of selection before of entry with letter
if (isSelectionEmpty() || currentEntry == null || !currentEntry.equals(entryAt)){
- if (currentEntry == null){
+ if (currentLettring != null){
super.clearSelection();
+ debitTotal = BigDecimal.ZERO;
+ creditTotal = BigDecimal.ZERO;
+ soldeTotal = BigDecimal.ZERO;
}
currentEntry = entryAt;
super.addSelectionInterval(row, column);
- //remove entry and get precedent entry for currentEntry
+ //remove entry and get precedent entry for currentEntry
}else {
super.removeSelectionInterval(row, column);
currentEntry = model.getEntryAt(super.getMaxSelectionIndex());
}
}
+
+ /**Managing components when n rows are selected
+ * */
+ if (!isSelectionEmpty()){
+
+ boolean debitSelected = selectedEntry.getDebit();
+ BigDecimal amountSelected = selectedEntry.getAmount();
+
+ BigDecimal debitVal = debitSelected ? amountSelected : BigDecimal.ZERO;
+
+ if (log.isInfoEnabled()) {
+ log.info("debit : " + debitTotal + "\n" +
+ "credit : " + creditTotal + "\n" +
+ "solde : " + soldeTotal);
+ }
+
+ if (debitVal == BigDecimal.ZERO){
+ BigDecimal creditVal = debitSelected ? BigDecimal.ZERO : amountSelected;
+
+ if (creditVal != BigDecimal.ZERO){
+ creditTotal = creditTotal.add(creditVal);
+ soldeTotal = soldeTotal.subtract(creditVal);
+ }else{
+ creditTotal = creditTotal.add(creditVal);
+ soldeTotal = soldeTotal.add(creditVal);
+ }
+ }else{
+ debitTotal = debitTotal.add(debitVal);
+ soldeTotal = soldeTotal.add(debitVal);
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("AFTER / debit : " + debitTotal + "\n" +
+ "credit : " + creditTotal + "\n" +
+ "solde : " + soldeTotal);
+ }
+
+ setDebit(debitTotal);
+ setCredit(creditTotal);
+ setSolde(soldeTotal);
+
+ //Managing lettering buttons
+ String lettering = null;
+
+ //lettering impossible if one of entries have letter
+ lettering = entryAt.getLettering();
+ if (lettering != null && !lettering.isEmpty()){
+ setDelettrer(true);
+ }
+
+ if (solde.intValue() == 0 && !delettrer){
+ setLettrer(true);
+ }
+ }
}
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-07-05 13:10:00 UTC (rev 3492)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-07-05 15:21:06 UTC (rev 3493)
@@ -116,9 +116,6 @@
setDate(datesEntree);
setJournal(entryBooks);
fireTableDataChanged();
- if (log.isInfoEnabled()) {
- log.info("Nb entries model (In model) : " + getNUmberOfEntries());
- }
}
protected void setDate(List<Date> datesEntree){
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-05 13:10:00 UTC (rev 3492)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-05 15:21:06 UTC (rev 3493)
@@ -41,9 +41,6 @@
import org.chorem.lima.service.LimaServiceFactory;
import javax.swing.*;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -61,8 +58,7 @@
public class LetteringViewHandler implements ServiceListener{
/** log. */
- private static final Log log =
- LogFactory.getLog(LetteringViewHandler.class);
+ private static final Log log = LogFactory.getLog(LetteringViewHandler.class);
protected LetteringView view;
@@ -96,7 +92,7 @@
*/
public void init() {
loadComboAndRows();
- LetteringModelUI modelUi = view.getModelUi();
+ /*LetteringModelUI modelUi = view.getModelUi();
modelUi.addListSelectionListener(new ListSelectionListener(){
List<Entry> entries = new ArrayList<Entry>();
@@ -139,7 +135,7 @@
loadCurrentSelection(modelUiPropChange, entries);
}
}
- });
+ });*/
}
public void loadComboAndRows(){
@@ -240,82 +236,6 @@
}
}
- /**Managing components when n rows are selected
- * */
- public void loadCurrentSelection(LetteringModelUI modelUi, List<Entry> selectedEntries){
- financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class);
-
- if (selectedEntries.size() > 0){
-
- boolean enableLettring = false;
- boolean enableDelettring = false;
- BigDecimal soldeTotal = BigDecimal.ZERO;
- BigDecimal creditTotal = BigDecimal.ZERO;
- BigDecimal debitTotal = BigDecimal.ZERO;
-
- for (Entry selectedEntry : selectedEntries) {
- //Managing balance, credit and debit
- boolean debitSelected = selectedEntry.getDebit();
- BigDecimal amountSelected = selectedEntry.getAmount();
-
-
- if (log.isInfoEnabled()) {
- log.info("amountSelected : " + amountSelected);
- }
- modelUi.setDebit(debitSelected ? amountSelected : BigDecimal.ZERO);
- modelUi.setCredit(debitSelected ? BigDecimal.ZERO : amountSelected);
-
- BigDecimal debitVal = modelUi.getDebit();
- if (log.isInfoEnabled()) {
- log.info("Debit actuel : " + debitVal);
- }
- if (debitVal == BigDecimal.ZERO){
- BigDecimal creditVal = modelUi.getCredit();
- if (log.isInfoEnabled()) {
- log.info("creditVal : " + creditVal);
- }
- if (creditVal != BigDecimal.ZERO){
- creditTotal = creditTotal.add(creditVal);
- creditVal = new BigDecimal("-" + creditVal.toString());
- if (log.isInfoEnabled()) {
- log.info("creditVal neg : " + creditVal);
- }
- soldeTotal = soldeTotal.add(creditVal);
- }else{
- creditTotal = creditTotal.add(creditVal);
- soldeTotal = soldeTotal.add(creditVal);
- }
- }else{
- debitTotal = debitTotal.add(debitVal);
- soldeTotal = soldeTotal.add(debitVal);
- }
- }
-
- modelUi.setSolde(soldeTotal);
- modelUi.setCredit(creditTotal);
- modelUi.setDebit(debitTotal);
-
- //Managing lettering buttons
- String lettering = null;
-
- //lettering impossible if one of entries have letter
- for (Entry selectedEntry : selectedEntries) {
- lettering = selectedEntry.getLettering();
- if (lettering != null && !lettering.isEmpty()){
- enableDelettring= true;
- break;
- }
- }
-
- if (soldeTotal.intValue() == 0 && !enableDelettring & view.getTable().getSelectedRows().length > 1){
- enableLettring = true;
- }
-
- modelUi.setLettrer(enableLettring);
- modelUi.setDelettrer(enableDelettring);
- }
- }
-
/**
* Select previous value in combo box.
*
Modified: trunk/lima-swing/src/main/resources/log4j.properties
===================================================================
--- trunk/lima-swing/src/main/resources/log4j.properties 2012-07-05 13:10:00 UTC (rev 3492)
+++ trunk/lima-swing/src/main/resources/log4j.properties 2012-07-05 15:21:06 UTC (rev 3493)
@@ -44,4 +44,4 @@
log4j.logger.org.chorem.lima.business.accountingrules.DefaultAccountingRules=DEBUG
log4j.logger.org.chorem.lima.ui.lettering.LetteringViewHandler=DEBUG
log4j.logger.org.chorem.lima.ui.lettering.LetteringTableModel=DEBUG
-log4j.logger.org.chorem.lima.ui.lettering.LetteringTableSelectionModel=DEBUG
\ No newline at end of file
+log4j.logger.org.chorem.lima.ui.lettering.LetteringModelUi=DEBUG
\ No newline at end of file
1
0
r3492 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering
by mallon@users.chorem.org 05 Jul '12
by mallon@users.chorem.org 05 Jul '12
05 Jul '12
Author: mallon
Date: 2012-07-05 15:10:00 +0200 (Thu, 05 Jul 2012)
New Revision: 3492
Url: http://chorem.org/repositories/revision/lima/3492
Log:
Correction du mod?\195?\168le de l'interface de lettrage pour la s?\195?\169lection des entr?\195?\169es avec uniquement la souris, lorsque toutes les entr?\195?\169es sont s?\195?\169lectionn?\195?\169es.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 12:49:53 UTC (rev 3491)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 13:10:00 UTC (rev 3492)
@@ -133,8 +133,15 @@
setSelectedEntry(entryAt);
if (entryAt.getLettering() != null){
+
// no line selected or line selected different of the current
- if (isSelectionEmpty() || !currentLettring.equals(entryAt.getLettering())){
+ if (isSelectionEmpty() || currentEntry != null || !currentLettring.equals(entryAt.getLettering())){
+
+ //Test not null for currentEntry cause of selection before of entry without letter
+ if (currentEntry != null){
+ super.clearSelection();
+ }
+
currentLettring = entryAt.getLettering();
super.setSelectionInterval(row, column);
//select entries with the same letter of the selected entry
@@ -148,11 +155,18 @@
}
}
}
+
}else{
+
//no line selected or line selected different of the current
- if (isSelectionEmpty() || !currentEntry.equals(entryAt)){
+ //Test null for currentEntry cause of selection before of entry with letter
+ if (isSelectionEmpty() || currentEntry == null || !currentEntry.equals(entryAt)){
+ if (currentEntry == null){
+ super.clearSelection();
+ }
currentEntry = entryAt;
super.addSelectionInterval(row, column);
+
//remove entry and get precedent entry for currentEntry
}else {
super.removeSelectionInterval(row, column);
1
0
r3491 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering
by mallon@users.chorem.org 05 Jul '12
by mallon@users.chorem.org 05 Jul '12
05 Jul '12
Author: mallon
Date: 2012-07-05 14:49:53 +0200 (Thu, 05 Jul 2012)
New Revision: 3491
Url: http://chorem.org/repositories/revision/lima/3491
Log:
Modification du mod?\195?\168le de l'interface de lettrage pour la s?\195?\169lection des entr?\195?\169es avec uniquement la souris.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 11:56:32 UTC (rev 3490)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 12:49:53 UTC (rev 3491)
@@ -36,6 +36,7 @@
protected boolean delettrer;
protected String currentLettring;
+ protected Entry currentEntry;
public LetteringModelUI(LetteringTableModel model) {
this.model = model;
@@ -130,21 +131,33 @@
public void setSelectionInterval(int row, int column) {
Entry entryAt = model.getEntryAt(row);
setSelectedEntry(entryAt);
- //if no line selected or if line selected different of the current
- if (isSelectionEmpty() || !currentLettring.equals(entryAt.getLettering())){
- this.currentLettring = entryAt.getLettering();
- super.setSelectionInterval(row, column);
- //select entries with the same letter of the selected entry
- List<Entry> modelEntries = model.getEntries();
- for(Entry entry : modelEntries){
- if (entry.getLettering() != null && !entry.getLettering().isEmpty()){
- if (entry.getLettering().equals(entryAt.getLettering())){
- int entryToSelect = model.getIndexOfEntry(entry);
- super.addSelectionInterval(entryToSelect, entryToSelect);
+
+ if (entryAt.getLettering() != null){
+ // no line selected or line selected different of the current
+ if (isSelectionEmpty() || !currentLettring.equals(entryAt.getLettering())){
+ currentLettring = entryAt.getLettering();
+ super.setSelectionInterval(row, column);
+ //select entries with the same letter of the selected entry
+ List<Entry> modelEntries = model.getEntries();
+ for(Entry entry : modelEntries){
+ if (entry.getLettering() != null && !entry.getLettering().isEmpty()){
+ if (entry.getLettering().equals(entryAt.getLettering())){
+ int entryToSelect = model.getIndexOfEntry(entry);
+ super.addSelectionInterval(entryToSelect, entryToSelect);
+ }
}
}
}
-
+ }else{
+ //no line selected or line selected different of the current
+ if (isSelectionEmpty() || !currentEntry.equals(entryAt)){
+ currentEntry = entryAt;
+ super.addSelectionInterval(row, column);
+ //remove entry and get precedent entry for currentEntry
+ }else {
+ super.removeSelectionInterval(row, column);
+ currentEntry = model.getEntryAt(super.getMaxSelectionIndex());
+ }
}
}
1
0
r3490 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/lettering resources
by mallon@users.chorem.org 05 Jul '12
by mallon@users.chorem.org 05 Jul '12
05 Jul '12
Author: mallon
Date: 2012-07-05 13:56:32 +0200 (Thu, 05 Jul 2012)
New Revision: 3490
Url: http://chorem.org/repositories/revision/lima/3490
Log:
Modification du mod?\195?\168le de l'interface de lettrage pour la s?\195?\169lection des entr?\195?\169es ayant le m?\195?\170me lettrage que la ligne s?\195?\169lectionn?\195?\169e.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
trunk/lima-swing/src/main/resources/log4j.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-04 16:55:47 UTC (rev 3489)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-05 11:56:32 UTC (rev 3490)
@@ -6,6 +6,7 @@
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.math.BigDecimal;
+import java.util.List;
public class LetteringModelUI extends DefaultListSelectionModel{
@@ -34,6 +35,12 @@
protected boolean lettrer;
protected boolean delettrer;
+ protected String currentLettring;
+
+ public LetteringModelUI(LetteringTableModel model) {
+ this.model = model;
+ }
+
public Entry getSelectedEntry() {
return selectedEntry;
}
@@ -64,10 +71,6 @@
firePropertyChange(DELETTRER_PROPERTY, oldDelettrer, delettrer);
}
- public LetteringModelUI(LetteringTableModel model) {
- this.model = model;
- }
-
public BigDecimal getDebit() {
return debit;
}
@@ -119,15 +122,46 @@
}
@Override
+ public int getSelectionMode() {
+ return MULTIPLE_INTERVAL_SELECTION;
+ }
+
+ @Override
public void setSelectionInterval(int row, int column) {
- super.setSelectionInterval(row, column);
- setSelectedEntry(model.getEntryAt(row));
+ Entry entryAt = model.getEntryAt(row);
+ setSelectedEntry(entryAt);
+ //if no line selected or if line selected different of the current
+ if (isSelectionEmpty() || !currentLettring.equals(entryAt.getLettering())){
+ this.currentLettring = entryAt.getLettering();
+ super.setSelectionInterval(row, column);
+ //select entries with the same letter of the selected entry
+ List<Entry> modelEntries = model.getEntries();
+ for(Entry entry : modelEntries){
+ if (entry.getLettering() != null && !entry.getLettering().isEmpty()){
+ if (entry.getLettering().equals(entryAt.getLettering())){
+ int entryToSelect = model.getIndexOfEntry(entry);
+ super.addSelectionInterval(entryToSelect, entryToSelect);
+ }
+ }
+ }
+
+ }
}
@Override
- public int getSelectionMode() {
- return MULTIPLE_INTERVAL_SELECTION;
+ public void addSelectionInterval(int index0, int index1) {
+ setSelectionInterval(index0, index1);
}
+ @Override
+ public void removeSelectionInterval(int index0, int index1) {
+ // do nothing
+ }
+ @Override
+ public void clearSelection() {
+ // do nothing
+ }
+
+
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java 2012-07-04 16:55:47 UTC (rev 3489)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java 2012-07-05 11:56:32 UTC (rev 3490)
@@ -55,15 +55,11 @@
protected LetteringViewHandler handler;
- /*private Highlighter colorTransaction;
+ //protected LetteringTableModel letteringTableModel;
- private ColorHighlighter colorBalance;*/
-
- protected LetteringTableModel letteringTableModel;
-
public LetteringTable(LetteringTableModel letteringTableModel) {
super(letteringTableModel);
- this.letteringTableModel = letteringTableModel;
+ //this.letteringTableModel = letteringTableModel;
addKeyListener(this);
addMouseListener(this);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-07-04 16:55:47 UTC (rev 3489)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-07-05 11:56:32 UTC (rev 3490)
@@ -25,14 +25,6 @@
package org.chorem.lima.ui.lettering;
-import static org.nuiton.i18n.I18n._;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-import javax.swing.table.AbstractTableModel;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.ServiceListener;
@@ -42,6 +34,13 @@
import org.chorem.lima.entity.Entry;
import org.chorem.lima.service.LimaServiceFactory;
+import javax.swing.table.AbstractTableModel;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+import static org.nuiton.i18n.I18n._;
+
/**
* Basic transaction table model.
* <p/>
@@ -96,12 +95,30 @@
return entries;
}
+ public Integer getIndexOfEntry(Entry entrySearch){
+ Integer index = -1;
+ for (Entry entry : entries){
+ index++;
+ if (entrySearch == entry){
+ return index;
+ }
+ }
+ return null;
+ }
+
+ public int getNUmberOfEntries(){
+ return entries.size();
+ }
+
public void updateEntries(List<Entry> entries,List<Date> datesEntree, List<String> entryBooks) {
this.entries = entries;
setDate(datesEntree);
setJournal(entryBooks);
fireTableDataChanged();
+ if (log.isInfoEnabled()) {
+ log.info("Nb entries model (In model) : " + getNUmberOfEntries());
+ }
}
protected void setDate(List<Date> datesEntree){
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-04 16:55:47 UTC (rev 3489)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-05 11:56:32 UTC (rev 3490)
@@ -100,25 +100,33 @@
modelUi.addListSelectionListener(new ListSelectionListener(){
List<Entry> entries = new ArrayList<Entry>();
+
@Override
public void valueChanged(ListSelectionEvent evt) {
LetteringModelUI modelUiPropChange = (LetteringModelUI)evt.getSource();
if (evt.getValueIsAdjusting()){
- Entry lastEntry = view.getTableModel().getEntryAt(evt.getLastIndex());
- int nbSelectedRowModel = view.getTable().getSelectedRows().length;
+ LetteringTableModel tableModel = view.getTableModel();
+ LetteringTable table = view.getTable();
+ int nbEntriesModel = tableModel.getNUmberOfEntries();
+
+ Entry lastEntry = tableModel.getEntryAt(evt.getLastIndex());
+ int nbSelectedRowTable = table.getSelectedRows().length;
int sizeEntries = entries.size();
if (log.isInfoEnabled()) {
log.info("Size list entries : " + sizeEntries + "\n" +
- "Nb selected row : " + nbSelectedRowModel);
+ "Nb selected row : " + nbSelectedRowTable + "\n"+
+ "Nb ligne model : " + nbEntriesModel);
}
- if (nbSelectedRowModel > sizeEntries || (nbSelectedRowModel==sizeEntries && nbSelectedRowModel==1)){
+
+ //Managing selection
+ if (nbSelectedRowTable > sizeEntries || (nbSelectedRowTable==sizeEntries && nbSelectedRowTable==1)){
entries.add(lastEntry);
if (log.isInfoEnabled()) {
log.info("Add entry");
}
- }else if (nbSelectedRowModel < sizeEntries){
+ }else if (nbSelectedRowTable < sizeEntries){
entries.remove(entries.size() - 1);
if (log.isInfoEnabled()) {
log.info("Remove entry");
@@ -132,15 +140,6 @@
}
}
});
-
- /*modelUi.addPropertyChangeListener(LetteringModelUI.SELECTED_ENTRY_PROPERTY, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- LetteringModelUI modelUiPropChange = (LetteringModelUI)evt.getSource();
- Entry selectedEntry = (Entry)evt.getNewValue();
- loadCurrentSelection(modelUiPropChange, selectedEntry);
- }
- });*/
}
public void loadComboAndRows(){
@@ -189,6 +188,9 @@
//Load entry with the default dates, default account 4 and with no letter
updateAllEntries(defaultDateBegFiscalPeriod, defaultDateEndCurrent, view.getAccountComboBoxModel().getSelectedItem(), view.getLetteredCheckGroup().getSelectedButton().getName());
+ if (log.isInfoEnabled()) {
+ log.info("Nb entries model (After update all entries) : " + view.getTableModel().getNUmberOfEntries());
+ }
}
protected List<Entry> findAllEntries(Date selectedBeginDate, Date selectedEndDate, Object compte, String filtreLettre){
@@ -232,6 +234,9 @@
}
view.getTableModel().updateEntries(entries, datesEntree, journalEntrees);
+ if (log.isInfoEnabled()) {
+ log.info("Nb entries model : " + view.getTableModel().getNUmberOfEntries());
+ }
}
}
Modified: trunk/lima-swing/src/main/resources/log4j.properties
===================================================================
--- trunk/lima-swing/src/main/resources/log4j.properties 2012-07-04 16:55:47 UTC (rev 3489)
+++ trunk/lima-swing/src/main/resources/log4j.properties 2012-07-05 11:56:32 UTC (rev 3490)
@@ -43,4 +43,5 @@
log4j.logger.org.chorem.lima.ui.home=DEBUG
log4j.logger.org.chorem.lima.business.accountingrules.DefaultAccountingRules=DEBUG
log4j.logger.org.chorem.lima.ui.lettering.LetteringViewHandler=DEBUG
-log4j.logger.org.chorem.lima.ui.lettering.LetteringTableModel=DEBUG
\ No newline at end of file
+log4j.logger.org.chorem.lima.ui.lettering.LetteringTableModel=DEBUG
+log4j.logger.org.chorem.lima.ui.lettering.LetteringTableSelectionModel=DEBUG
\ No newline at end of file
1
0
r3489 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering
by mallon@users.chorem.org 04 Jul '12
by mallon@users.chorem.org 04 Jul '12
04 Jul '12
Author: mallon
Date: 2012-07-04 18:55:47 +0200 (Wed, 04 Jul 2012)
New Revision: 3489
Url: http://chorem.org/repositories/revision/lima/3489
Log:
Correction concernant la s?\195?\169lection d'une seule ligne et l'impossibilit?\195?\169 de la lettrer.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-04 16:30:39 UTC (rev 3488)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-04 16:55:47 UTC (rev 3489)
@@ -302,7 +302,7 @@
}
}
- if (soldeTotal.intValue() == 0 && !enableDelettring){
+ if (soldeTotal.intValue() == 0 && !enableDelettring & view.getTable().getSelectedRows().length > 1){
enableLettring = true;
}
1
0