OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 151 | Rev 174 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 151 Rev 156
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 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.
10
 * 
10
 * 
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.supplychain.order.element;
14
 package org.openconcerto.erp.core.supplychain.order.element;
15
 
15
 
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.erp.core.edm.AttachmentAction;
17
import org.openconcerto.erp.core.edm.AttachmentAction;
18
import org.openconcerto.erp.core.supplychain.order.component.FactureFournisseurSQLComponent;
18
import org.openconcerto.erp.core.supplychain.order.component.FactureFournisseurSQLComponent;
19
import org.openconcerto.erp.generationDoc.gestcomm.FactureFournisseurXmlSheet;
19
import org.openconcerto.erp.generationDoc.gestcomm.FactureFournisseurXmlSheet;
20
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
20
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
21
import org.openconcerto.sql.element.SQLComponent;
21
import org.openconcerto.sql.element.SQLComponent;
22
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
22
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
23
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
23
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
24
import org.openconcerto.utils.ListMap;
24
import org.openconcerto.utils.ListMap;
25
 
25
 
26
import java.util.ArrayList;
26
import java.util.ArrayList;
-
 
27
import java.util.HashSet;
27
import java.util.List;
28
import java.util.List;
-
 
29
import java.util.Set;
28
 
30
 
29
public class FactureFournisseurSQLElement extends ComptaSQLConfElement {
31
public class FactureFournisseurSQLElement extends ComptaSQLConfElement {
30
 
32
 
31
    public FactureFournisseurSQLElement() {
33
    public FactureFournisseurSQLElement() {
32
        super("FACTURE_FOURNISSEUR", "une facture fournisseur", "factures fournisseur");
34
        super("FACTURE_FOURNISSEUR", "une facture fournisseur", "factures fournisseur");
33
        MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(FactureFournisseurXmlSheet.class);
35
        MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(FactureFournisseurXmlSheet.class);
34
        mouseSheetXmlListeListener.setGenerateHeader(true);
36
        mouseSheetXmlListeListener.setGenerateHeader(true);
35
        mouseSheetXmlListeListener.setShowHeader(true);
37
        mouseSheetXmlListeListener.setShowHeader(true);
36
        getRowActions().addAll(mouseSheetXmlListeListener.getRowActions());
38
        getRowActions().addAll(mouseSheetXmlListeListener.getRowActions());
37
        if (getTable().contains("ATTACHMENTS")) {
39
        if (getTable().contains("ATTACHMENTS")) {
38
            PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
40
            PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
39
            actionAttachment.setPredicate(IListeEvent.getSingleSelectionPredicate());
41
            actionAttachment.setPredicate(IListeEvent.getSingleSelectionPredicate());
40
            getRowActions().add(actionAttachment);
42
            getRowActions().add(actionAttachment);
41
        }
43
        }
42
    }
44
    }
43
 
45
 
-
 
46
    @Override
-
 
47
    public Set<String> getReadOnlyFields() {
-
 
48
        Set<String> s = new HashSet<>();
-
 
49
        s.add("NET_A_PAYER");
-
 
50
        return s;
-
 
51
    }
-
 
52
 
44
    protected List<String> getListFields() {
53
    protected List<String> getListFields() {
45
        final List<String> l = new ArrayList<String>();
54
        final List<String> l = new ArrayList<String>();
46
        l.add("NUMERO");
55
        l.add("NUMERO");
47
        l.add("NOM");
56
        l.add("NOM");
48
        l.add("DATE");
57
        l.add("DATE");
49
        l.add("ID_FOURNISSEUR");
58
        l.add("ID_FOURNISSEUR");
50
        l.add("T_HT");
59
        l.add("T_HT");
51
        l.add("T_TTC");
60
        l.add("T_TTC");
52
        l.add("INFOS");
61
        l.add("INFOS");
53
        return l;
62
        return l;
54
    }
63
    }
55
 
64
 
56
    @Override
65
    @Override
57
    public ListMap<String, String> getShowAs() {
66
    public ListMap<String, String> getShowAs() {
58
        ListMap<String, String> map = new ListMap<String, String>();
67
        ListMap<String, String> map = new ListMap<String, String>();
59
        map.putCollection(null, "NUMERO", "DATE");
68
        map.putCollection(null, "NUMERO", "DATE");
60
        return map;
69
        return map;
61
    }
70
    }
62
 
71
 
63
    protected List<String> getComboFields() {
72
    protected List<String> getComboFields() {
64
        final List<String> l = new ArrayList<String>();
73
        final List<String> l = new ArrayList<String>();
65
        l.add("NUMERO");
74
        l.add("NUMERO");
66
        l.add("NOM");
75
        l.add("NOM");
67
        l.add("DATE");
76
        l.add("DATE");
68
        return l;
77
        return l;
69
    }
78
    }
70
 
79
 
71
    /*
80
    /*
72
     * (non-Javadoc)
81
     * (non-Javadoc)
73
     * 
82
     * 
74
     * @see org.openconcerto.devis.SQLElement#getComponent()
83
     * @see org.openconcerto.devis.SQLElement#getComponent()
75
     */
84
     */
76
    public SQLComponent createComponent() {
85
    public SQLComponent createComponent() {
77
        return new FactureFournisseurSQLComponent();
86
        return new FactureFournisseurSQLComponent();
78
    }
87
    }
79
 
88
 
80
    @Override
89
    @Override
81
    protected String createCode() {
90
    protected String createCode() {
82
        return createCodeFromPackage() + ".invoice.purchase";
91
        return createCodeOfPackage() + ".invoice.purchase";
83
    }
92
    }
84
}
93
}