branch develop updated (b62c44d1 -> 10064bde)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git from b62c44d1 refs #1394 retrait de l'appel du refresh a l'initialisation de l'onglet entrées invalides. L'action refresh est déclanché pas le listener sur le combo fiscalPeriod new 5e4483e4 refs #1394 ajout d'indexes new 10064bde refs #1394 initialisation des listeners apres modification des la vue initiale 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 10064bde3b5434481b77360b2af384b185a14bd3 Author: David Cossé <cosse@codelutin.com> Date: Wed Oct 18 00:56:51 2017 +0200 refs #1394 initialisation des listeners apres modification des la vue initiale commit 5e4483e4c0fc18b4631825d0d059595c96d6502a Author: David Cossé <cosse@codelutin.com> Date: Wed Oct 18 00:54:20 2017 +0200 refs #1394 ajout d'indexes Summary of changes: ...gration1.sql => V0_8_7_0__1394_add_indexes.sql} | 11 ++++- .../ui/common/FinancialTransactionTableModel.java | 6 +-- .../FinancialTransactionViewHandler.java | 53 ++++++++++++++-------- 3 files changed, 45 insertions(+), 25 deletions(-) copy lima-callao/src/main/resources/db/migration/{V0_5_0_0__migration1.sql => V0_8_7_0__1394_add_indexes.sql} (51%) -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 5e4483e4c0fc18b4631825d0d059595c96d6502a Author: David Cossé <cosse@codelutin.com> Date: Wed Oct 18 00:54:20 2017 +0200 refs #1394 ajout d'indexes --- .../db/migration/V0_8_7_0__1394_add_indexes.sql | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lima-callao/src/main/resources/db/migration/V0_8_7_0__1394_add_indexes.sql b/lima-callao/src/main/resources/db/migration/V0_8_7_0__1394_add_indexes.sql new file mode 100644 index 00000000..fc08ad7c --- /dev/null +++ b/lima-callao/src/main/resources/db/migration/V0_8_7_0__1394_add_indexes.sql @@ -0,0 +1,31 @@ +--- +-- #%L +-- Lima :: callao +-- %% +-- Copyright (C) 2008 - 2015 CodeLutin +-- %% +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/gpl-3.0.html>. +-- #L% +--- + +CREATE INDEX idx_FinancialTransaction_transactionDate ON FINANCIALTRANSACTION (transactionDate); +CREATE INDEX idx_FinancialTransaction_transactionDateentryBook ON FINANCIALTRANSACTION (transactionDate, entryBook); +CREATE INDEX idx_FinancialPeriod_beginDate ON FINANCIALPERIOD (beginDate); +CREATE INDEX idx_FinancialPeriod_endDate ON FINANCIALPERIOD (endDate); +CREATE INDEX idx_FiscalPeriod_beginDateendDate ON FINANCIALPERIOD (beginDate,endDate); +CREATE INDEX idx_FinancialStatement_CreateDate ON FinancialStatement (topiaCreateDate); +CREATE INDEX idx_EntryBook_label ON ENTRYBOOK (label); +CREATE INDEX idx_ClosedPeriodicEntryBook_locked ON CLOSEDPERIODICENTRYBOOK (locked); +CREATE INDEX idx_Account_label ON ACCOUNT (label); \ No newline at end of file -- 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 develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 10064bde3b5434481b77360b2af384b185a14bd3 Author: David Cossé <cosse@codelutin.com> Date: Wed Oct 18 00:56:51 2017 +0200 refs #1394 initialisation des listeners apres modification des la vue initiale --- .../ui/common/FinancialTransactionTableModel.java | 6 +-- .../FinancialTransactionViewHandler.java | 53 ++++++++++++++-------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java b/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java index 5ef4ded1..859cbf95 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java @@ -130,11 +130,7 @@ public class FinancialTransactionTableModel extends TableModelWithGroup<Entry> i protected LinkedHashMap<String, List<Entry>> getEntriesByVoucherByDate(List<Entry> orderedEntries) { LinkedHashMap<String, List<Entry>> orderedEntriesByVoucher = new LinkedHashMap<>(); for (Entry orderedEntry : orderedEntries) { - List<Entry> entriesForVoucher = orderedEntriesByVoucher.get(orderedEntry.getVoucher()); - if (entriesForVoucher == null) { - entriesForVoucher = Lists.newArrayList(); - orderedEntriesByVoucher.put(orderedEntry.getVoucher(), entriesForVoucher); - } + List<Entry> entriesForVoucher = orderedEntriesByVoucher.computeIfAbsent(orderedEntry.getVoucher(), k -> Lists.newArrayList()); entriesForVoucher.add(orderedEntry); } return orderedEntriesByVoucher; diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java index 5bc1f20d..1b73eaed 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java @@ -22,7 +22,6 @@ package org.chorem.lima.ui.financialtransaction; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import jaxx.runtime.SwingUtil; import org.apache.commons.lang.StringUtils; @@ -121,10 +120,12 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo * Init all combo box in view. */ public void init() { - MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + // fiscal periods List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriods(); + view.getFiscalPeriodComboBoxModel().setObjects(fiscalPeriods); + if (log.isDebugEnabled()) { log.debug(String.format("Loaded %d fiscal periods", fiscalPeriods.size())); } @@ -143,13 +144,27 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo view.getEntryBookComboBoxModel().setSelectedItem(allEntryBooks.get(0)); } - FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); - tableModel.addTableModelListener(this); + initializationComplete = true; + updateFinancialTransactions(); + computePeriodStatusText(); + + setAddEntryAllowed(); + + addListeners(); + + } + + protected void addListeners() { FinancialTransactionTable table = view.getFinancialTransactionTable(); table.getColumnModel().addColumnModelListener(this); SwingUtil.fixTableColumnWidth(table, 0, 40); + FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); + tableModel.addTableModelListener(this); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + tableModel.addTableModelListener(e -> { boolean mustRecompute = e.getType() == TableModelEvent.DELETE @@ -163,12 +178,6 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo } }); - - initializationComplete = true; - updateFinancialTransactions(); - computePeriodStatusText(); - - setAddEntryAllowed(); } protected void initShortCuts() { @@ -350,21 +359,28 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo * and entry book. */ public void updateFinancialTransactions() { - if (initializationComplete) { + if (view.getEntryBookComboBoxModel().getSelectedItem() != null && + view.getFiscalPeriodComboBoxModel().getSelectedItem() != null && + view.getFinancialPeriodComboBox().getSelectedItem() != null && + initializationComplete) { + FinancialPeriod financialPeriod = (FinancialPeriod) view.getFinancialPeriodComboBox().getSelectedItem(); EntryBook entryBook = (EntryBook) view.getEntryBookComboBox().getSelectedItem(); - List<FinancialTransaction> transactions = Lists.newArrayList(); - if (entryBook != null && financialPeriod != null) { - transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod, entryBook); - } + List<FinancialTransaction> transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod, entryBook); + FinancialTransactionTable table = view.getFinancialTransactionTable(); FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); table.exit(); + tableModel.setTransactions(transactions); boolean isLock = isTableLock(financialPeriod, entryBook); - table.setEditable(!isLock); + + if (table.isEditable() == isLock) { + table.setEditable(!isLock); + } + } } @@ -677,8 +693,9 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo entry.setDescription(defaultDescription); String defaultAccount; - //Actual (2012) tva percentage : 19,6% - BigDecimal tvaPercentAdd = new BigDecimal(0.196); + //TODO dcosse pas de valeur en dur + //Actual (2017) tva percentage : 20% + BigDecimal tvaPercentAdd = new BigDecimal(0.2); BigDecimal tvaTax = null; //Calculation of tva tax only if first entry is a sale -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm