OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 57 | Rev 156 | 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.supplychain.receipt.element;
15
 
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.erp.core.common.ui.DeviseField;
18
import org.openconcerto.sql.element.SQLComponent;
19
import org.openconcerto.sql.element.UISQLComponent;
20
import org.openconcerto.sql.sqlobject.ElementComboBox;
21
 
22
import java.util.ArrayList;
23
import java.util.List;
24
 
19 ilm 25
import javax.swing.JTextField;
18 ilm 26
 
27
public class BonReceptionElementSQLElement extends ComptaSQLConfElement {
28
 
29
    public BonReceptionElementSQLElement() {
30
        super("BON_RECEPTION_ELEMENT", "un element de bon", "éléments de bon");
31
    }
32
 
132 ilm 33
    @Override
34
    protected String getParentFFName() {
35
        return "ID_BON_RECEPTION";
36
    }
37
 
18 ilm 38
    protected List<String> getListFields() {
39
        final List<String> l = new ArrayList<String>();
40
        l.add("ID_STYLE");
41
        l.add("CODE");
42
        l.add("NOM");
43
        l.add("PA_HT");
44
        l.add("PV_HT");
45
        l.add("ID_TAXE");
46
        l.add("POIDS");
47
        return l;
48
    }
49
 
50
    protected List<String> getComboFields() {
51
        final List<String> l = new ArrayList<String>();
52
        l.add("CODE");
53
        l.add("NOM");
54
        l.add("PA_HT");
55
        l.add("PV_HT");
56
        return l;
57
    }
58
 
59
    /*
60
     * (non-Javadoc)
61
     *
62
     * @see org.openconcerto.devis.SQLElement#getComponent()
63
     */
64
    public SQLComponent createComponent() {
65
        return new UISQLComponent(this) {
66
            public void addViews() {
67
                this.addRequiredSQLObject(new JTextField(), "NOM", "left");
68
                this.addRequiredSQLObject(new JTextField(), "CODE", "right");
69
 
70
                this.addSQLObject(new ElementComboBox(), "ID_STYLE", "left");
71
 
72
                this.addRequiredSQLObject(new DeviseField(), "PA_HT", "left");
73
                this.addSQLObject(new DeviseField(), "PV_HT", "right");
74
 
75
                this.addSQLObject(new JTextField(), "POIDS", "left");
76
                this.addSQLObject(new ElementComboBox(), "ID_TAXE", "right");
77
            }
78
        };
79
    }
57 ilm 80
 
81
    @Override
82
    protected String createCode() {
83
        return createCodeFromPackage() + ".item";
84
    }
18 ilm 85
}