OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
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
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.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.core.humanresources.employe.element;
15
 
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.sql.element.SQLComponent;
132 ilm 18
import org.openconcerto.utils.ListMap;
18 ilm 19
 
20
import java.util.ArrayList;
21
import java.util.List;
22
 
23
public class CommercialSQLElement extends ComptaSQLConfElement {
24
 
25
    public CommercialSQLElement() {
156 ilm 26
        super("COMMERCIAL");
18 ilm 27
    }
28
 
29
    public CommercialSQLElement(String tableName, String singular, String plural) {
30
        super(tableName, singular, plural);
31
    }
32
 
33
    protected List<String> getListFields() {
34
        final List<String> l = new ArrayList<String>();
35
        l.add("NOM");
36
        l.add("PRENOM");
37
        l.add("FONCTION");
38
        l.add("TEL_STANDARD");
39
        l.add("TEL_DIRECT");
156 ilm 40
        if (getTable().contains("ID_POLE_PRODUIT")) {
41
            l.add("ID_POLE_PRODUIT");
42
        }
18 ilm 43
        return l;
44
    }
45
 
46
    protected List<String> getComboFields() {
47
        final List<String> l = new ArrayList<String>();
132 ilm 48
        l.add("PRENOM");
18 ilm 49
        l.add("NOM");
50
        l.add("FONCTION");
51
        return l;
52
    }
53
 
28 ilm 54
    @Override
132 ilm 55
    public ListMap<String, String> getShowAs() {
56
        final ListMap<String, String> res = new ListMap<String, String>();
57
        res.putCollection(null, "NOM");
28 ilm 58
        return res;
59
    }
60
 
18 ilm 61
    /*
62
     * (non-Javadoc)
63
     *
64
     * @see org.openconcerto.devis.SQLElement#getComponent()
65
     */
66
    public SQLComponent createComponent() {
61 ilm 67
        return new CommercialSQLComponent(this);
18 ilm 68
    }
57 ilm 69
 
70
    @Override
71
    protected String createCode() {
156 ilm 72
        return this.createCodeOfPackage() + ".salesman";
57 ilm 73
    }
18 ilm 74
}