OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 156
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.finance.accounting.ui;
14
 package org.openconcerto.erp.core.finance.accounting.ui;
15
 
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
-
 
17
import org.openconcerto.erp.core.common.ui.IListFilterDatePanel;
-
 
18
import org.openconcerto.erp.core.common.ui.IListTotalPanel;
16
import org.openconcerto.erp.core.common.ui.IListTotalPanel;
19
import org.openconcerto.sql.Configuration;
17
import org.openconcerto.erp.utils.TM;
20
import org.openconcerto.sql.element.SQLElement;
18
import org.openconcerto.sql.element.SQLElement;
21
import org.openconcerto.sql.model.SQLField;
19
import org.openconcerto.sql.model.SQLField;
22
import org.openconcerto.sql.model.SQLRow;
20
import org.openconcerto.sql.model.SQLRow;
23
import org.openconcerto.sql.model.SQLRowValues;
21
import org.openconcerto.sql.model.SQLRowValues;
24
import org.openconcerto.sql.model.SQLSelect;
22
import org.openconcerto.sql.model.SQLSelect;
Line 34... Line 32...
34
import java.awt.GridBagConstraints;
32
import java.awt.GridBagConstraints;
35
import java.awt.GridBagLayout;
33
import java.awt.GridBagLayout;
36
import java.awt.Window;
34
import java.awt.Window;
37
import java.awt.event.ActionEvent;
35
import java.awt.event.ActionEvent;
38
import java.awt.event.ActionListener;
36
import java.awt.event.ActionListener;
-
 
37
import java.awt.event.HierarchyEvent;
-
 
38
import java.awt.event.HierarchyListener;
39
import java.beans.PropertyChangeEvent;
39
import java.beans.PropertyChangeEvent;
40
import java.beans.PropertyChangeListener;
40
import java.beans.PropertyChangeListener;
41
import java.util.ArrayList;
41
import java.util.ArrayList;
42
import java.util.Date;
42
import java.util.Date;
43
import java.util.List;
43
import java.util.List;
44
 
44
 
45
import javax.swing.BorderFactory;
-
 
46
import javax.swing.JButton;
45
import javax.swing.JButton;
47
import javax.swing.JCheckBox;
46
import javax.swing.JCheckBox;
48
import javax.swing.JLabel;
47
import javax.swing.JLabel;
49
import javax.swing.JPanel;
48
import javax.swing.JPanel;
50
import javax.swing.JSpinner;
49
import javax.swing.JSpinner;
51
import javax.swing.JSplitPane;
50
import javax.swing.JSplitPane;
-
 
51
import javax.swing.JTextField;
52
import javax.swing.SwingUtilities;
52
import javax.swing.SwingUtilities;
53
import javax.swing.event.ChangeEvent;
53
import javax.swing.event.ChangeEvent;
54
import javax.swing.event.ChangeListener;
54
import javax.swing.event.ChangeListener;
55
import javax.swing.event.TableModelEvent;
55
import javax.swing.event.TableModelEvent;
56
import javax.swing.event.TableModelListener;
56
import javax.swing.event.TableModelListener;
Line 79... Line 79...
79
            public SQLSelect transformChecked(SQLSelect input) {
79
            public SQLSelect transformChecked(SQLSelect input) {
80
                input.setWhere(Where.FALSE);
80
                input.setWhere(Where.FALSE);
81
                return input;
81
                return input;
82
            }
82
            }
83
        });
83
        });
-
 
84
        this.addHierarchyListener(new HierarchyListener() {
-
 
85
            public void hierarchyChanged(HierarchyEvent e) {
-
 
86
                if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0)
-
 
87
                    if (isDisplayable()) {
-
 
88
                        listeEcr.addIListeActions(ecrElt.getRowActions());
-
 
89
 
-
 
90
                    } else {
-
 
91
                        listeEcr.removeIListeActions(ecrElt.getRowActions());
-
 
92
                    }
-
 
93
            }
-
 
94
        });
84
        GridBagConstraints cListe = new DefaultGridBagConstraints();
95
        GridBagConstraints cListe = new DefaultGridBagConstraints();
85
        cListe.fill = GridBagConstraints.BOTH;
96
        cListe.fill = GridBagConstraints.BOTH;
86
        cListe.gridwidth = 1;
97
        cListe.gridwidth = 1;
87
        cListe.weightx = 1;
98
        cListe.weightx = 1;
88
        cListe.weighty = 1;
99
        cListe.weighty = 1;
Line 155... Line 166...
155
        defaultRowVals.put("DEBIT", 0L);
166
        defaultRowVals.put("DEBIT", 0L);
156
        defaultRowVals.put("CREDIT", 0L);
167
        defaultRowVals.put("CREDIT", 0L);
157
 
168
 
158
        final JCheckBox boxAutoInsert = new JCheckBox("Insertion automatique");
169
        final JCheckBox boxAutoInsert = new JCheckBox("Insertion automatique");
159
 
170
 
-
 
171
        JPanel panelBottom = new JPanel(new GridBagLayout());
-
 
172
        GridBagConstraints cB = new DefaultGridBagConstraints();
-
 
173
 
-
 
174
        panelBottom.add(new JLabel(TM.tr("accounting.editing.piece.label")), cB);
-
 
175
        cB.gridx++;
-
 
176
        final JTextField textPiece = new JTextField();
-
 
177
        panelBottom.add(textPiece, cB);
-
 
178
 
160
        final SaisieJournalItemTable table = new SaisieJournalItemTable(defaultRowVals, boxAutoInsert);
179
        final SaisieJournalItemTable table = new SaisieJournalItemTable(defaultRowVals, boxAutoInsert, textPiece);
161
        table.setPanel(this);
180
        table.setPanel(this);
162
 
181
 
-
 
182
        cB.gridwidth = GridBagConstraints.REMAINDER;
-
 
183
        cB.weightx = 1;
-
 
184
        cB.weighty = 1;
-
 
185
        cB.fill = GridBagConstraints.BOTH;
-
 
186
        cB.gridy++;
-
 
187
        cB.gridx = 0;
-
 
188
        panelBottom.add(table, cB);
163
        split.setBottomComponent(table);
189
        split.setBottomComponent(panelBottom);
164
 
190
 
165
        this.add(split, c);
191
        this.add(split, c);
166
 
192
 
167
        c.weightx = 0;
193
        c.weightx = 0;
168
        c.weighty = 0;
194
        c.weighty = 0;
Line 199... Line 225...
199
        this.add(footerPanel, c);
225
        this.add(footerPanel, c);
200
        buttonAdd.addActionListener(new ActionListener() {
226
        buttonAdd.addActionListener(new ActionListener() {
201
 
227
 
202
            @Override
228
            @Override
203
            public void actionPerformed(ActionEvent e) {
229
            public void actionPerformed(ActionEvent e) {
204
                table.createSaisie(defaultRowVals);
230
                table.createSaisie(defaultRowVals, textPiece);
205
            }
231
            }
206
        });
232
        });
207
        buttonClose.addActionListener(new ActionListener() {
233
        buttonClose.addActionListener(new ActionListener() {
208
 
234
 
209
            @Override
235
            @Override