OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 61 | 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.sales.quote.element;
15
 
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.sql.element.SQLComponent;
18
import org.openconcerto.sql.element.UISQLComponent;
132 ilm 19
import org.openconcerto.utils.ListMap;
18 ilm 20
 
21
import java.util.ArrayList;
22
import java.util.List;
23
 
19 ilm 24
import javax.swing.JTextField;
25
 
18 ilm 26
public class EtatDevisSQLElement extends ComptaSQLConfElement {
27
 
28
    public static final int REFUSE = 3;
29
    public static final int ACCEPTE = 4;
30
    public static final int EN_ATTENTE = 2;
61 ilm 31
    public static final int EN_COURS = 5;
18 ilm 32
 
33
    public EtatDevisSQLElement() {
34
        super("ETAT_DEVIS", "un état de devis", "états de devis");
35
    }
36
 
37
    protected List<String> getListFields() {
38
        final List<String> l = new ArrayList<String>();
39
        l.add("NOM");
40
        return l;
41
    }
42
 
43
    protected List<String> getComboFields() {
44
        final List<String> l = new ArrayList<String>();
45
        l.add("NOM");
46
        return l;
47
    }
48
 
49
    @Override
132 ilm 50
    public ListMap<String, String> getShowAs() {
51
        return ListMap.singleton(null, "NOM");
18 ilm 52
    }
53
 
54
    /*
55
     * (non-Javadoc)
56
     *
57
     * @see org.openconcerto.devis.SQLElement#getComponent()
58
     */
59
    public SQLComponent createComponent() {
60
        return new UISQLComponent(this) {
61
            public void addViews() {
62
                this.addRequiredSQLObject(new JTextField(), "NOM", "left");
63
            }
64
        };
65
    }
57 ilm 66
 
67
    @Override
68
    protected String createCode() {
69
        return createCodeFromPackage() + ".state";
70
    }
18 ilm 71
}