OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 144 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
 /*
14
 /*
15
 * Créé le 26 sept. 2012
15
 * Créé le 26 sept. 2012
16
 */
16
 */
17
package org.openconcerto.erp.core.supplychain.order.element;
17
package org.openconcerto.erp.core.supplychain.order.element;
18
 
18
 
19
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
19
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
20
import org.openconcerto.erp.core.common.ui.IColorChooser;
20
import org.openconcerto.erp.core.common.ui.IColorChooser;
21
import org.openconcerto.sql.element.SQLComponent;
21
import org.openconcerto.sql.element.SQLComponent;
22
import org.openconcerto.sql.element.UISQLComponent;
22
import org.openconcerto.sql.element.UISQLComponent;
23
import org.openconcerto.utils.ListMap;
23
import org.openconcerto.utils.ListMap;
24
 
24
 
25
import java.util.ArrayList;
25
import java.util.ArrayList;
26
import java.util.List;
26
import java.util.List;
27
 
27
 
28
import javax.swing.JTextField;
28
import javax.swing.JTextField;
29
 
29
 
30
public class EtatDemandeAchatItemSQLElement extends ComptaSQLConfElement {
30
public class EtatDemandeAchatItemSQLElement extends ComptaSQLConfElement {
31
 
31
 
32
    public static final int EN_ATTENTE = 2;
32
    public static final int EN_ATTENTE = 2;
33
    public static final int DEMANDE = 3;
33
    public static final int DEMANDE = 3;
34
    public static final int COMMANDE = 4;
34
    public static final int COMMANDE = 4;
35
    public static final int RECPETION = 5;
35
    public static final int RECPETION = 5;
36
    public static final int RECPETION_PARTIEL = 6;
36
    public static final int RECPETION_PARTIEL = 6;
37
    public static final int A_RELANCER = 7;
37
    public static final int A_RELANCER = 7;
38
 
38
 
39
    public EtatDemandeAchatItemSQLElement() {
39
    public EtatDemandeAchatItemSQLElement() {
40
        super("ETAT_DEMANDE_ACHAT_ELEMENT", "un état de demande d'achat", "états de demande d'achat");
40
        super("ETAT_DEMANDE_ACHAT_ELEMENT", "un état de demande d'achat", "états de demande d'achat");
41
    }
41
    }
42
 
42
 
43
    protected List<String> getListFields() {
43
    protected List<String> getListFields() {
44
        final List<String> l = new ArrayList<String>();
44
        final List<String> l = new ArrayList<String>();
45
        l.add("NOM");
45
        l.add("NOM");
46
        return l;
46
        return l;
47
    }
47
    }
48
 
48
 
49
    protected List<String> getComboFields() {
49
    protected List<String> getComboFields() {
50
        final List<String> l = new ArrayList<String>();
50
        final List<String> l = new ArrayList<String>();
51
        l.add("NOM");
51
        l.add("NOM");
52
        return l;
52
        return l;
53
    }
53
    }
54
 
54
 
55
    @Override
55
    @Override
56
    public ListMap<String, String> getShowAs() {
56
    public ListMap<String, String> getShowAs() {
57
        final ListMap<String, String> res = new ListMap<String, String>();
57
        final ListMap<String, String> res = new ListMap<String, String>();
58
        res.add(null, "NOM");
58
        res.add(null, "NOM");
59
        return res;
59
        return res;
60
    }
60
    }
61
 
61
 
62
    /*
62
    /*
63
     * (non-Javadoc)
63
     * (non-Javadoc)
64
     * 
64
     * 
65
     * @see org.openconcerto.devis.SQLElement#getComponent()
65
     * @see org.openconcerto.devis.SQLElement#getComponent()
66
     */
66
     */
67
    public SQLComponent createComponent() {
67
    public SQLComponent createComponent() {
68
        return new UISQLComponent(this) {
68
        return new UISQLComponent(this) {
69
            public void addViews() {
69
            public void addViews() {
70
                this.addRequiredSQLObject(new JTextField(), "NOM", "left");
70
                this.addRequiredSQLObject(new JTextField(), "NOM", "left");
71
                this.addRequiredSQLObject(new IColorChooser(), "COLOR", "right");
71
                this.addRequiredSQLObject(new IColorChooser(), "COLOR", "right");
72
            }
72
            }
73
        };
73
        };
74
    }
74
    }
75
 
75
 
76
    @Override
76
    @Override
77
    protected String createCode() {
77
    protected String createCode() {
78
        return createCodeFromPackage() + ".achat.state";
78
        return createCodeOfPackage() + ".achat.state";
79
    }
79
    }
80
 
80
 
81
}
81
}