OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 180 | 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 20... Line 20...
20
import org.openconcerto.erp.generationDoc.gestcomm.FactureFournisseurXmlSheet;
20
import org.openconcerto.erp.generationDoc.gestcomm.FactureFournisseurXmlSheet;
21
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
21
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
22
import org.openconcerto.sql.element.SQLComponent;
22
import org.openconcerto.sql.element.SQLComponent;
23
import org.openconcerto.sql.model.FieldPath;
23
import org.openconcerto.sql.model.FieldPath;
24
import org.openconcerto.sql.model.SQLRowAccessor;
24
import org.openconcerto.sql.model.SQLRowAccessor;
-
 
25
import org.openconcerto.sql.model.SQLRowValues;
25
import org.openconcerto.sql.model.SQLTable;
26
import org.openconcerto.sql.model.SQLTable;
26
import org.openconcerto.sql.model.graph.Path;
27
import org.openconcerto.sql.model.graph.Path;
27
import org.openconcerto.sql.view.EditFrame;
28
import org.openconcerto.sql.view.EditFrame;
28
import org.openconcerto.sql.view.EditPanel;
29
import org.openconcerto.sql.view.EditPanel;
29
import org.openconcerto.sql.view.list.BaseSQLTableModelColumn;
30
import org.openconcerto.sql.view.list.BaseSQLTableModelColumn;
30
import org.openconcerto.sql.view.list.IListe;
31
import org.openconcerto.sql.view.list.IListe;
31
import org.openconcerto.sql.view.list.RowAction;
32
import org.openconcerto.sql.view.list.RowAction;
32
import org.openconcerto.sql.view.list.SQLTableModelSource;
33
import org.openconcerto.sql.view.list.SQLTableModelSource;
33
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
34
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
34
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
35
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
-
 
36
import org.openconcerto.sql.view.list.action.ListEvent;
35
import org.openconcerto.ui.table.PercentTableCellRenderer;
37
import org.openconcerto.ui.table.PercentTableCellRenderer;
36
import org.openconcerto.utils.CollectionUtils;
38
import org.openconcerto.utils.CollectionUtils;
37
import org.openconcerto.utils.DecimalUtils;
39
import org.openconcerto.utils.DecimalUtils;
38
import org.openconcerto.utils.ListMap;
40
import org.openconcerto.utils.ListMap;
39
 
41
 
Line 50... Line 52...
50
 
52
 
51
public class FactureFournisseurSQLElement extends ComptaSQLConfElement {
53
public class FactureFournisseurSQLElement extends ComptaSQLConfElement {
52
 
54
 
53
    public FactureFournisseurSQLElement() {
55
    public FactureFournisseurSQLElement() {
54
        super("FACTURE_FOURNISSEUR", "une facture fournisseur", "factures fournisseur");
56
        super("FACTURE_FOURNISSEUR", "une facture fournisseur", "factures fournisseur");
55
        MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(FactureFournisseurXmlSheet.class);
57
        MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(this, FactureFournisseurXmlSheet.class);
56
        mouseSheetXmlListeListener.setGenerateHeader(true);
58
        mouseSheetXmlListeListener.setGenerateHeader(true);
57
        mouseSheetXmlListeListener.setShowHeader(true);
59
        mouseSheetXmlListeListener.setShowHeader(true);
58
        getRowActions().addAll(mouseSheetXmlListeListener.getRowActions());
60
        getRowActions().addAll(mouseSheetXmlListeListener.getRowActions());
59
        if (getTable().contains("ATTACHMENTS")) {
61
        if (getTable().contains("ATTACHMENTS")) {
60
            PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
62
            PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
Line 68... Line 70...
68
 
70
 
69
                ((FactureFournisseurSQLComponent) editFrame.getSQLComponent()).loadFactureExistante(IListe.get(e).getSelectedId());
71
                ((FactureFournisseurSQLComponent) editFrame.getSQLComponent()).loadFactureExistante(IListe.get(e).getSelectedId());
70
                editFrame.setVisible(true);
72
                editFrame.setVisible(true);
71
            }
73
            }
72
        }, true, "supplychain.invoice.clone") {
74
        }, true, "supplychain.invoice.clone") {
73
            public boolean enabledFor(IListeEvent evt) {
75
            public boolean enabledFor(List<SQLRowValues> l) {
74
                List<? extends SQLRowAccessor> l = evt.getSelectedRows();
-
 
75
                return (l != null && l.size() == 1);
76
                return (l != null && l.size() == 1);
76
            }
77
            }
77
        };
78
        };
78
        getRowActions().add(actionClone);
79
        getRowActions().add(actionClone);
79
        final SQLTable tableNum = getTable().getTable("NUMEROTATION_AUTO");
80
        final SQLTable tableNum = getTable().getTable("NUMEROTATION_AUTO");