OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 180 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 180 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 35... Line 35...
35
import org.openconcerto.sql.users.rights.UserRightsManager;
35
import org.openconcerto.sql.users.rights.UserRightsManager;
36
import org.openconcerto.sql.view.list.IListe;
36
import org.openconcerto.sql.view.list.IListe;
37
import org.openconcerto.ui.DefaultGridBagConstraints;
37
import org.openconcerto.ui.DefaultGridBagConstraints;
38
import org.openconcerto.ui.FontUtils;
38
import org.openconcerto.ui.FontUtils;
39
import org.openconcerto.ui.JDate;
39
import org.openconcerto.ui.JDate;
40
import org.openconcerto.ui.TitledSeparator;
40
import org.openconcerto.ui.JLabelBold;
41
import org.openconcerto.ui.warning.JLabelWarning;
41
import org.openconcerto.ui.warning.JLabelWarning;
42
import org.openconcerto.utils.text.SimpleDocumentListener;
42
import org.openconcerto.utils.text.SimpleDocumentListener;
43
 
43
 
44
import java.awt.Color;
44
import java.awt.Color;
-
 
45
import java.awt.Component;
45
import java.awt.Dimension;
46
import java.awt.Dimension;
46
import java.awt.GridBagConstraints;
47
import java.awt.GridBagConstraints;
47
import java.awt.GridBagLayout;
48
import java.awt.GridBagLayout;
48
import java.awt.Insets;
49
import java.awt.Insets;
49
import java.awt.Window;
50
import java.awt.Window;
Line 90... Line 91...
90
    private final DeviseField fieldSoldeA = new DeviseField(15);
91
    private final DeviseField fieldSoldeA = new DeviseField(15);
91
    private final DeviseField fieldEcart = new DeviseField(15);
92
    private final DeviseField fieldEcart = new DeviseField(15);
92
 
93
 
93
    private final SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
94
    private final SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
94
    private final SQLTable tableEcr = this.base.getTable("ECRITURE");
95
    private final SQLTable tableEcr = this.base.getTable("ECRITURE");
95
    private final SQLTable tableCpt = this.base.getTable("COMPTE_PCE");
-
 
96
 
96
 
97
    private final static int allEcriture = 0;
97
    private final static int allEcriture = 0;
98
    private final static int ecriturePointee = 1;
98
    private final static int ecriturePointee = 1;
99
    private final static int ecritureNotPointee = 2;
99
    private final static int ecritureNotPointee = 2;
100
 
100
 
Line 145... Line 145...
145
                    e.printStackTrace();
145
                    e.printStackTrace();
146
                }
146
                }
147
            }
147
            }
148
        }.execute();
148
        }.execute();
149
 
149
 
150
        // c.fill = GridBagConstraints.NONE;
-
 
151
        c.weightx = 1;
150
        c.weightx = 1;
152
        c.gridx++;
151
        c.gridx++;
-
 
152
        c.gridwidth = 2;
153
        c.gridwidth = GridBagConstraints.REMAINDER;
153
        c.fill = GridBagConstraints.NONE;
154
        this.add(this.selCompte, c);
154
        this.add(this.selCompte, c);
155
 
155
 
156
        // Gestion du pointage
156
        // Gestion du pointage
157
        c.insets = new Insets(2, 2, 1, 2);
157
        c.insets = new Insets(2, 2, 1, 2);
158
        TitledSeparator sepGestionPointage = new TitledSeparator("Gestion du pointage");
-
 
159
        c.fill = GridBagConstraints.HORIZONTAL;
-
 
160
        c.gridy++;
-
 
161
        c.gridx = 0;
158
        c.gridx = 0;
162
        this.add(sepGestionPointage, c);
-
 
163
 
-
 
164
        // Panel Selection du mode d'affichage des ecritures
-
 
165
 
-
 
166
        c.gridy++;
159
        c.gridy++;
167
        c.gridx = 0;
-
 
168
        c.gridwidth = 1;
160
        c.gridwidth = 1;
169
        c.gridheight = 1;
-
 
170
        c.weightx = 0;
161
        c.weightx = 0;
171
 
-
 
-
 
162
        c.fill = GridBagConstraints.HORIZONTAL;
172
        // Numero de releve
163
        // Numero de releve
173
        // c.anchor = GridBagConstraints.EAST;
-
 
-
 
164
 
174
        JLabel labelReleve = new JLabel("N° de relevé");
165
        final JLabel labelReleve = new JLabel("N° de relevé");
175
        labelReleve.setHorizontalAlignment(SwingConstants.RIGHT);
166
        labelReleve.setHorizontalAlignment(SwingConstants.RIGHT);
176
        this.add(labelReleve, c);
167
        this.add(labelReleve, c);
177
 
168
 
178
        this.codePointage = new JTextField(10);
169
        this.codePointage = new JTextField(10);
179
        c.gridx++;
170
        c.gridx++;
180
        c.weightx = 0;
171
        c.weightx = 0;
181
        c.fill = GridBagConstraints.NONE;
172
        c.fill = GridBagConstraints.NONE;
182
        c.anchor = GridBagConstraints.WEST;
-
 
183
        this.add(this.codePointage, c);
173
        this.add(this.codePointage, c);
184
 
174
 
185
        // Warning si aucun code rentré
175
        // Warning si aucun code rentré
186
        c.gridx++;
176
        c.gridx++;
187
        c.fill = GridBagConstraints.HORIZONTAL;
177
        c.fill = GridBagConstraints.NONE;
188
        createPanelWarning();
-
 
189
        c.gridwidth = 1;
178
        c.gridwidth = 1;
190
        c.weightx = 1;
179
        c.weightx = 0;
-
 
180
        createPanelWarning();
191
        this.add(this.warningPanel, c);
181
        this.add(this.warningPanel, c);
192
 
182
 
193
        // Date de pointage
183
        // Date de pointage
194
        // MAYBE si date invalide grisée le bouton pointer
184
        // MAYBE si date invalide grisée le bouton pointer
195
        JLabel labelDate = new JLabel("Date de pointage");
185
        JLabel labelDate = new JLabel("Date de pointage");
196
        labelDate.setHorizontalAlignment(SwingConstants.RIGHT);
186
        labelDate.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
187
        c.fill = GridBagConstraints.HORIZONTAL;
197
        c.gridx = 0;
188
        c.gridx = 0;
198
        c.gridy++;
189
        c.gridy++;
199
        c.gridwidth = 1;
190
        c.gridwidth = 1;
200
        c.weightx = 0;
191
        c.weightx = 0;
201
        this.add(labelDate, c);
192
        this.add(labelDate, c);
Line 244... Line 235...
244
        cCheck.fill = GridBagConstraints.NONE;
235
        cCheck.fill = GridBagConstraints.NONE;
245
        cCheck.weightx = 1;
236
        cCheck.weightx = 1;
246
        cCheck.gridx++;
237
        cCheck.gridx++;
247
        cCheck.gridwidth = 1;
238
        cCheck.gridwidth = 1;
248
        this.fieldEcart.setEditable(false);
239
        this.fieldEcart.setEditable(false);
-
 
240
 
249
        panelCheckValue.add(this.fieldEcart, cCheck);
241
        panelCheckValue.add(this.fieldEcart, cCheck);
250
 
242
 
251
        c.gridx++;
243
        c.gridx++;
252
        c.gridwidth = 3;
244
        c.gridwidth = 1;
253
        c.weightx = 1;
245
        c.weightx = 1;
-
 
246
        c.fill = GridBagConstraints.HORIZONTAL;
254
        this.add(panelCheckValue, c);
247
        this.add(panelCheckValue, c);
255
        this.fieldSoldeA.getDocument().addDocumentListener(new SimpleDocumentListener() {
248
        this.fieldSoldeA.getDocument().addDocumentListener(new SimpleDocumentListener() {
256
 
249
 
257
            @Override
250
            @Override
258
            public void update(DocumentEvent e) {
251
            public void update(DocumentEvent e) {
Line 266... Line 259...
266
            public void update(DocumentEvent e) {
259
            public void update(DocumentEvent e) {
267
                PointagePanel.this.model.updateTotauxCompte(PointagePanel.this.fieldSoldeD, PointagePanel.this.fieldSoldeA, PointagePanel.this.fieldEcart);
260
                PointagePanel.this.model.updateTotauxCompte(PointagePanel.this.fieldSoldeD, PointagePanel.this.fieldSoldeA, PointagePanel.this.fieldEcart);
268
            }
261
            }
269
        });
262
        });
270
 
263
 
271
        TitledSeparator sepPeriode = new TitledSeparator("Filtre ");
264
        JLabelBold sepPeriode = new JLabelBold("Liste des écritures");
272
        c.gridy++;
265
        c.gridy++;
273
        c.gridx = 0;
266
        c.gridx = 0;
274
        c.anchor = GridBagConstraints.WEST;
267
        c.anchor = GridBagConstraints.WEST;
275
        c.gridwidth = GridBagConstraints.REMAINDER;
268
        c.gridwidth = 3;
276
        c.fill = GridBagConstraints.HORIZONTAL;
269
        c.fill = GridBagConstraints.HORIZONTAL;
277
        this.add(sepPeriode, c);
270
        this.add(sepPeriode, c);
278
 
271
 
279
        JPanel panelSelectEcritures = createPanelSelectionEcritures();
272
        JPanel panelSelectEcritures = createPanelSelectionEcritures();
280
        c.gridy++;
273
        c.gridy++;
281
        c.weightx = 0;
274
        c.weightx = 0;
282
        c.gridwidth = 1;
275
        c.gridwidth = 1;
283
        c.gridx = 0;
276
        c.gridx = 0;
284
        final JLabel labelEcr = new JLabel("Ecritures");
277
        final JLabel labelEcr = new JLabel("Etats");
285
        labelEcr.setHorizontalAlignment(SwingConstants.RIGHT);
278
        labelEcr.setHorizontalAlignment(SwingConstants.RIGHT);
286
        this.add(labelEcr, c);
279
        this.add(labelEcr, c);
287
        c.gridx++;
280
        c.gridx++;
288
        c.fill = GridBagConstraints.NONE;
281
        c.fill = GridBagConstraints.NONE;
289
        c.gridwidth = GridBagConstraints.REMAINDER;
282
        c.gridwidth = 2;
290
        c.weightx = 1;
283
        c.weightx = 1;
291
        this.add(panelSelectEcritures, c);
284
        this.add(panelSelectEcritures, c);
292
        c.fill = GridBagConstraints.HORIZONTAL;
285
        c.fill = GridBagConstraints.HORIZONTAL;
293
 
286
 
294
        c.gridy++;
287
        c.gridy++;
Line 324... Line 317...
324
 
317
 
325
        panelPeriode.add(this.dateFin);
318
        panelPeriode.add(this.dateFin);
326
 
319
 
327
        c.weightx = 1;
320
        c.weightx = 1;
328
        c.fill = GridBagConstraints.NONE;
321
        c.fill = GridBagConstraints.NONE;
329
        c.gridwidth = GridBagConstraints.REMAINDER;
322
        c.gridwidth = 2;
330
        this.add(panelPeriode, c);
323
        this.add(panelPeriode, c);
331
 
324
 
332
        TitledSeparator sepEcriture = new TitledSeparator("Ecritures ");
-
 
333
        c.gridy++;
-
 
334
        c.gridx = 0;
-
 
335
        c.gridwidth = GridBagConstraints.REMAINDER;
-
 
336
        c.fill = GridBagConstraints.HORIZONTAL;
-
 
337
        this.add(sepEcriture, c);
-
 
338
 
-
 
339
        // Liste des ecritures
325
        // Liste des ecritures
340
        final EcritureSQLElement ecritureElem = directory.getElement(EcritureSQLElement.class);
326
        final EcritureSQLElement ecritureElem = directory.getElement(EcritureSQLElement.class);
341
        this.ecriturePanel = new ListPanelEcritures(ecritureElem, new IListe(ecritureElem.createPointageTableSource()));
327
        this.ecriturePanel = new ListPanelEcritures(ecritureElem, new IListe(ecritureElem.createPointageTableSource()));
342
        this.ecriturePanel.setShowReadOnlyFrameOnDoubleClick(false);
328
        this.ecriturePanel.setShowReadOnlyFrameOnDoubleClick(false);
343
        c.gridx = 0;
329
        c.gridx = 0;
344
        c.gridy++;
330
        c.gridy++;
345
        c.weighty = 1;
331
        c.weighty = 1;
346
        c.weightx = 1;
332
        c.weightx = 1;
347
        c.fill = GridBagConstraints.BOTH;
333
        c.fill = GridBagConstraints.BOTH;
348
        c.gridwidth = GridBagConstraints.REMAINDER;
334
        c.gridwidth = 3;
349
        this.ecriturePanel.getListe().setPreferredSize(new Dimension(this.ecriturePanel.getListe().getPreferredSize().width, 200));
335
        this.ecriturePanel.getListe().setPreferredSize(new Dimension(this.ecriturePanel.getListe().getPreferredSize().width, 200));
350
        this.add(this.ecriturePanel, c);
336
        this.add(this.ecriturePanel, c);
351
 
337
 
352
        // JTable Totaux
-
 
353
        c.gridy++;
338
        c.gridy++;
354
        c.gridx = 0;
-
 
355
        c.weighty = 0;
339
        c.weighty = 0;
356
        c.weightx = 1;
-
 
357
        c.fill = GridBagConstraints.BOTH;
-
 
358
        c.gridwidth = 4;
-
 
359
        c.gridheight = 3;
-
 
360
        this.model = new PointageModel(this.selCompte.getSelectedId(), this);
-
 
361
        JTable table = new JTable(this.model);
-
 
362
        table.setRowHeight(FontUtils.getPreferredRowHeight(table));
-
 
363
        // AlternateTableCellRenderer.setAllColumns(table);
-
 
364
        final DeviseNiceTableCellRenderer cellRenderer = new DeviseNiceTableCellRenderer();
-
 
365
        for (int i = 0; i < table.getColumnCount(); i++) {
-
 
366
            // if (table.getColumnClass(i) == Long.class || table.getColumnClass(i) ==
-
 
367
            // BigInteger.class) {
-
 
368
 
-
 
369
            table.getColumnModel().getColumn(i).setCellRenderer(cellRenderer);
-
 
370
            // }else{
-
 
371
            //
-
 
372
            // }
-
 
373
        }
-
 
374
        JScrollPane sPane = new JScrollPane(table);
-
 
375
 
-
 
376
        // TODO Gerer la taille des colonnes
-
 
377
        Dimension d = new Dimension(table.getPreferredSize().width, table.getPreferredSize().height + table.getTableHeader().getPreferredSize().height + 4);
-
 
378
        sPane.setPreferredSize(d);
-
 
379
        this.add(sPane, c);
-
 
380
 
-
 
381
        // Legende
-
 
382
        c.gridx += 4;
-
 
383
        c.gridwidth = 1;
-
 
384
        c.anchor = GridBagConstraints.WEST;
-
 
385
        c.fill = GridBagConstraints.NONE;
-
 
386
        c.weightx = 0;
-
 
387
        this.add(createPanelLegende(), c);
340
        this.add(createBottomPanel(), c);
388
 
-
 
389
        // Validation des ecritures pointées
-
 
390
        this.boxValidEcriture = new JCheckBox("Valider les écritures pointées");
-
 
391
        c.gridx++;
-
 
392
        c.gridheight = 1;
-
 
393
        c.gridwidth = GridBagConstraints.REMAINDER;
-
 
394
        this.add(this.boxValidEcriture, c);
-
 
395
 
-
 
396
        // Bouton Pointer
-
 
397
        c.anchor = GridBagConstraints.SOUTHEAST;
-
 
398
        this.buttonPointer = new JButton("Pointer");
-
 
399
        c.gridwidth = 1;
-
 
400
        c.gridheight = 1;
-
 
401
        c.weightx = 0;
-
 
402
        c.gridx = 5;
-
 
403
        c.gridy++;
-
 
404
        c.fill = GridBagConstraints.NONE;
-
 
405
 
-
 
406
        this.add(this.buttonPointer, c);
-
 
407
 
-
 
408
        // Bouton Depointer
-
 
409
        JButton buttonDepointer = new JButton("Dépointer");
-
 
410
        c.gridx++;
-
 
411
        c.weightx = 0;
-
 
412
        this.add(buttonDepointer, c);
-
 
413
 
-
 
414
        c.gridwidth = GridBagConstraints.REMAINDER;
-
 
415
        c.gridheight = 1;
-
 
416
        c.weightx = 0;
-
 
417
        c.gridx = 5;
-
 
418
        c.gridy++;
-
 
419
        c.fill = GridBagConstraints.NONE;
-
 
420
        c.anchor = GridBagConstraints.EAST;
-
 
421
        JButton buttonClose = new JButton("Fermer");
-
 
422
        buttonClose.addActionListener(new ActionListener() {
-
 
423
 
-
 
424
            @Override
-
 
425
            public void actionPerformed(ActionEvent e) {
-
 
426
                ((Window) SwingUtilities.getRoot(PointagePanel.this)).dispose();
-
 
427
            }
-
 
428
        });
-
 
429
        this.add(buttonClose, c);
-
 
430
        this.buttonPointer.addActionListener(new ActionListener() {
-
 
431
            public void actionPerformed(ActionEvent e) {
-
 
432
 
-
 
433
                int[] rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().getSelectedRows();
-
 
434
 
-
 
435
                for (int i = 0; i < rowIndex.length; i++) {
-
 
436
                    System.err.println("Action pointage sur " + i);
-
 
437
                    actionPointage(rowIndex[i]);
-
 
438
                }
-
 
439
            }
-
 
440
        });
-
 
441
 
-
 
442
        buttonDepointer.addActionListener(new ActionListener() {
-
 
443
            public void actionPerformed(ActionEvent e) {
-
 
444
 
-
 
445
                int[] rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().getSelectedRows();
-
 
446
 
-
 
447
                for (int i = 0; i < rowIndex.length; i++) {
-
 
448
                    System.err.println("Action depointage sur " + i);
-
 
449
                    actionDepointage(rowIndex[i]);
-
 
450
                }
-
 
451
            }
-
 
452
        });
-
 
453
 
341
 
454
        // Changement de compte
342
        // Changement de compte
455
        this.selCompte.addValueListener(new PropertyChangeListener() {
343
        this.selCompte.addModelListener("wantedID", new PropertyChangeListener() {
456
            public void propertyChange(PropertyChangeEvent evt) {
344
            public void propertyChange(PropertyChangeEvent evt) {
457
 
345
 
458
                changeListRequest();
346
                changeListRequest();
459
            };
347
            };
460
        });
348
        });
Line 528... Line 416...
528
        changeListRequest();
416
        changeListRequest();
529
        this.warningPanel.setVisible((this.codePointage.getText().trim().length() == 0));
417
        this.warningPanel.setVisible((this.codePointage.getText().trim().length() == 0));
530
        this.buttonPointer.setEnabled((this.codePointage.getText().trim().length() != 0));
418
        this.buttonPointer.setEnabled((this.codePointage.getText().trim().length() != 0));
531
    }
419
    }
532
 
420
 
-
 
421
    private Component createBottomPanel() {
-
 
422
        JPanel p = new JPanel();
-
 
423
        GridBagConstraints c = new DefaultGridBagConstraints();
-
 
424
        p.setLayout(new GridBagLayout());
-
 
425
        // JTable Totaux
-
 
426
        c.weighty = 1;
-
 
427
        c.weightx = 1;
-
 
428
        c.gridheight = 3;
-
 
429
        c.fill = GridBagConstraints.BOTH;
-
 
430
 
-
 
431
        this.model = new PointageModel(this.selCompte.getSelectedId(), this);
-
 
432
        JTable table = new JTable(this.model);
-
 
433
        table.setRowHeight(FontUtils.getPreferredRowHeight(table));
-
 
434
        final DeviseNiceTableCellRenderer cellRenderer = new DeviseNiceTableCellRenderer();
-
 
435
        for (int i = 0; i < table.getColumnCount(); i++) {
-
 
436
            table.getColumnModel().getColumn(i).setCellRenderer(cellRenderer);
-
 
437
        }
-
 
438
        JScrollPane sPane = new JScrollPane(table);
-
 
439
 
-
 
440
        // TODO Gerer la taille des colonnes
-
 
441
        Dimension d = new Dimension(table.getPreferredSize().width, table.getPreferredSize().height + table.getTableHeader().getPreferredSize().height + 4);
-
 
442
        sPane.setPreferredSize(d);
-
 
443
        p.add(sPane, c);
-
 
444
 
-
 
445
        // Legende
-
 
446
        c.gridx++;
-
 
447
        c.anchor = GridBagConstraints.WEST;
-
 
448
        c.fill = GridBagConstraints.NONE;
-
 
449
        c.weightx = 0;
-
 
450
        p.add(createPanelLegende(), c);
-
 
451
 
-
 
452
        // Validation des ecritures pointées
-
 
453
        this.boxValidEcriture = new JCheckBox("Valider les écritures pointées");
-
 
454
        c.gridx++;
-
 
455
        c.gridheight = 1;
-
 
456
        c.gridwidth = 2;
-
 
457
        p.add(this.boxValidEcriture, c);
-
 
458
 
-
 
459
        // Bouton Pointer
-
 
460
        c.anchor = GridBagConstraints.SOUTHEAST;
-
 
461
        this.buttonPointer = new JButton("Pointer");
-
 
462
        c.gridwidth = 1;
-
 
463
 
-
 
464
        c.gridy++;
-
 
465
        c.fill = GridBagConstraints.NONE;
-
 
466
 
-
 
467
        p.add(this.buttonPointer, c);
-
 
468
 
-
 
469
        // Bouton Depointer
-
 
470
        JButton buttonDepointer = new JButton("Dépointer");
-
 
471
        c.gridx++;
-
 
472
        p.add(buttonDepointer, c);
-
 
473
 
-
 
474
        c.gridy++;
-
 
475
        c.fill = GridBagConstraints.NONE;
-
 
476
        c.anchor = GridBagConstraints.EAST;
-
 
477
        JButton buttonClose = new JButton("Fermer");
-
 
478
        buttonClose.addActionListener(new ActionListener() {
-
 
479
 
-
 
480
            @Override
-
 
481
            public void actionPerformed(ActionEvent e) {
-
 
482
                ((Window) SwingUtilities.getRoot(PointagePanel.this)).dispose();
-
 
483
            }
-
 
484
        });
-
 
485
        p.add(buttonClose, c);
-
 
486
        this.buttonPointer.addActionListener(new ActionListener() {
-
 
487
            public void actionPerformed(ActionEvent e) {
-
 
488
 
-
 
489
                int[] rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().getSelectedRows();
-
 
490
 
-
 
491
                for (int i = 0; i < rowIndex.length; i++) {
-
 
492
                    actionPointage(rowIndex[i]);
-
 
493
                }
-
 
494
            }
-
 
495
        });
-
 
496
 
-
 
497
        buttonDepointer.addActionListener(new ActionListener() {
-
 
498
            public void actionPerformed(ActionEvent e) {
-
 
499
 
-
 
500
                int[] rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().getSelectedRows();
-
 
501
 
-
 
502
                for (int i = 0; i < rowIndex.length; i++) {
-
 
503
                    actionDepointage(rowIndex[i]);
-
 
504
                }
-
 
505
            }
-
 
506
        });
-
 
507
 
-
 
508
        return p;
-
 
509
    }
-
 
510
 
533
    /* Menu clic Droit */
511
    /* Menu clic Droit */
534
    private void actionMenuDroit(final MouseEvent mE) {
512
    private void actionMenuDroit(final MouseEvent mE) {
535
        JPopupMenu menu = new JPopupMenu();
513
        JPopupMenu menu = new JPopupMenu();
536
 
514
 
537
        menu.add(new AbstractAction("Voir la source") {
515
        menu.add(new AbstractAction("Voir la source") {
538
            public void actionPerformed(ActionEvent e) {
516
            public void actionPerformed(ActionEvent e) {
539
 
-
 
540
                int rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().rowAtPoint(mE.getPoint());
517
                int rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().rowAtPoint(mE.getPoint());
541
                int id = PointagePanel.this.ecriturePanel.getListe().idFromIndex(rowIndex);
518
                int id = PointagePanel.this.ecriturePanel.getListe().idFromIndex(rowIndex);
542
 
519
 
543
                SQLTable ecriture = PointagePanel.this.base.getTable("ECRITURE");
520
                SQLTable ecriture = PointagePanel.this.base.getTable("ECRITURE");
544
                SQLRow rowEcr = ecriture.getRow(id);
521
                SQLRow rowEcr = ecriture.getRow(id);
Line 548... Line 525...
548
        });
525
        });
549
 
526
 
550
        if (this.codePointage.getText().trim().length() != 0) {
527
        if (this.codePointage.getText().trim().length() != 0) {
551
            menu.add(new AbstractAction("Pointer") {
528
            menu.add(new AbstractAction("Pointer") {
552
                public void actionPerformed(ActionEvent e) {
529
                public void actionPerformed(ActionEvent e) {
553
 
-
 
554
                    int rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().rowAtPoint(mE.getPoint());
530
                    int rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().rowAtPoint(mE.getPoint());
555
                    actionPointage(rowIndex);
531
                    actionPointage(rowIndex);
556
                }
532
                }
557
            });
533
            });
558
        }
534
        }
559
 
535
 
560
        menu.add(new AbstractAction("Dépointer") {
536
        menu.add(new AbstractAction("Dépointer") {
561
            public void actionPerformed(ActionEvent e) {
537
            public void actionPerformed(ActionEvent e) {
562
 
-
 
563
                int rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().rowAtPoint(mE.getPoint());
538
                int rowIndex = PointagePanel.this.ecriturePanel.getListe().getJTable().rowAtPoint(mE.getPoint());
564
                actionDepointage(rowIndex);
539
                actionDepointage(rowIndex);
565
            }
540
            }
566
        });
541
        });
567
 
542
 
Line 635... Line 610...
635
        }
610
        }
636
        this.model.updateTotauxCompte(PointagePanel.this.fieldSoldeD, PointagePanel.this.fieldSoldeA, PointagePanel.this.fieldEcart);
611
        this.model.updateTotauxCompte(PointagePanel.this.fieldSoldeD, PointagePanel.this.fieldSoldeA, PointagePanel.this.fieldEcart);
637
    }
612
    }
638
 
613
 
639
    public ListPanelEcritures getEcriturePanel() {
614
    public ListPanelEcritures getEcriturePanel() {
640
        return ecriturePanel;
615
        return this.ecriturePanel;
641
    }
616
    }
642
 
617
 
643
    // Pointe la ligne passée en parametre
618
    // Pointe la ligne passée en parametre
644
    private void actionDepointage(int rowIndex) {
619
    private void actionDepointage(int rowIndex) {
645
 
620
 
Line 666... Line 641...
666
    /*
641
    /*
667
     * MaJ de la requete pour remplir la IListe en fonction du compte sélectionner et du mode de
642
     * MaJ de la requete pour remplir la IListe en fonction du compte sélectionner et du mode de
668
     * sélection
643
     * sélection
669
     */
644
     */
670
    private void changeListRequest() {
645
    private void changeListRequest() {
671
        Object idCpt = this.selCompte.getSelectedId();
646
        Object idCpt = this.selCompte.getWantedID();
672
 
647
 
673
        // filtre de selection
648
        // filtre de selection
674
 
649
 
675
        Where w = new Where(this.tableEcr.getField("ID_COMPTE_PCE"), "=", idCpt);
650
        Where w = new Where(this.tableEcr.getField("ID_COMPTE_PCE"), "=", idCpt);
676
 
651