OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 177 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 30... Line 30...
30
import org.openconcerto.ui.PanelFrame;
30
import org.openconcerto.ui.PanelFrame;
31
import org.openconcerto.utils.ExceptionHandler;
31
import org.openconcerto.utils.ExceptionHandler;
32
 
32
 
33
import java.awt.event.ActionEvent;
33
import java.awt.event.ActionEvent;
34
import java.util.ArrayList;
34
import java.util.ArrayList;
-
 
35
import java.util.Collections;
35
import java.util.Date;
36
import java.util.Date;
36
import java.util.List;
37
import java.util.List;
37
 
38
 
38
import javax.swing.AbstractAction;
39
import javax.swing.AbstractAction;
39
import javax.swing.JComponent;
40
import javax.swing.JComponent;
Line 47... Line 48...
47
        {
48
        {
48
            PredicateRowAction action = new PredicateRowAction(new AbstractAction("Créer un état de stock") {
49
            PredicateRowAction action = new PredicateRowAction(new AbstractAction("Créer un état de stock") {
49
 
50
 
50
                @Override
51
                @Override
51
                public void actionPerformed(ActionEvent e) {
52
                public void actionPerformed(ActionEvent e) {
52
                    EtatStockSnapshotCreator creator = new EtatStockSnapshotCreator(getTable().getTable("DEPOT_STOCK").getRow(DepotStockSQLElement.DEFAULT_ID), new Date(), getTable().getDBRoot());
53
                    PanelFrame frame = new PanelFrame(new EtatStockCreationPanel(getDirectory().getElement(DepotStockSQLElement.class)), "Création état de stock");
53
                    creator.create();
54
                    FrameUtil.showPacked(frame);
54
                }
55
                }
55
            }, true);
56
            }, true);
56
            action.setPredicate(IListeEvent.createSelectionCountPredicate(0, Integer.MAX_VALUE));
57
            action.setPredicate(IListeEvent.createSelectionCountPredicate(0, Integer.MAX_VALUE));
57
            getRowActions().add(action);
58
            getRowActions().add(action);
58
        }
59
        }
Line 77... Line 78...
77
                @Override
78
                @Override
78
                public void actionPerformed(ActionEvent e) {
79
                public void actionPerformed(ActionEvent e) {
79
                    EtatStockInventaireXmlSheet sheet = new EtatStockInventaireXmlSheet(IListe.get(e).getSelectedRow().asRow());
80
                    EtatStockInventaireXmlSheet sheet = new EtatStockInventaireXmlSheet(IListe.get(e).getSelectedRow().asRow());
80
                    try {
81
                    try {
81
                        sheet.createDocument();
82
                        sheet.createDocument();
82
                        sheet.showPrintAndExport(true, false, false, false, false);
83
                        sheet.showPrintAndExport(true, false, false, false, false, Collections.emptyList());
83
                    } catch (Exception e1) {
84
                    } catch (Exception e1) {
84
                        ExceptionHandler.handle("Erreur lors de la création de l'inventaire", e1);
85
                        ExceptionHandler.handle("Erreur lors de la création de l'inventaire", e1);
85
                    }
86
                    }
86
                }
87
                }
87
            }, true);
88
            }, true);
Line 95... Line 96...
95
                public void actionPerformed(ActionEvent e) {
96
                public void actionPerformed(ActionEvent e) {
96
                    PanelFrame frame = new PanelFrame(new ImportInventairePanel(getDirectory().getElement(DepotStockSQLElement.class)), "Import inventaire");
97
                    PanelFrame frame = new PanelFrame(new ImportInventairePanel(getDirectory().getElement(DepotStockSQLElement.class)), "Import inventaire");
97
                    FrameUtil.showPacked(frame);
98
                    FrameUtil.showPacked(frame);
98
                }
99
                }
99
            }, true);
100
            }, true);
100
            action.setPredicate(IListeEvent.getSingleSelectionPredicate());
101
            action.setPredicate(IListeEvent.createSelectionCountPredicate(0, Integer.MAX_VALUE));
101
            getRowActions().add(action);
102
            getRowActions().add(action);
102
        }
103
        }
103
    }
104
    }
104
 
105
 
105
    @Override
106
    @Override