OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev Author Line No. Line
19 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.product.element;
15
 
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.sql.element.BaseSQLComponent;
18
import org.openconcerto.sql.element.SQLComponent;
19
import org.openconcerto.ui.DefaultGridBagConstraints;
20
 
21
import java.awt.GridBagConstraints;
22
import java.awt.GridBagLayout;
23
import java.util.ArrayList;
24
import java.util.List;
25
 
26
import javax.swing.JLabel;
67 ilm 27
import javax.swing.JTextField;
19 ilm 28
 
29
public class ArticleTarifSQLElement extends ComptaSQLConfElement {
30
 
31
    public ArticleTarifSQLElement() {
32
        super("ARTICLE_TARIF", "un tarif d'article", "tarifs d'article");
33
    }
34
 
35
    protected List<String> getListFields() {
36
        final List<String> l = new ArrayList<String>();
83 ilm 37
        l.add("PV_TTC");
19 ilm 38
        return l;
39
    }
40
 
41
    protected List<String> getComboFields() {
42
        final List<String> l = new ArrayList<String>();
83 ilm 43
        l.add("PV_TTC");
19 ilm 44
        return l;
45
    }
46
 
90 ilm 47
    @Override
48
    protected String getParentFFName() {
49
        return "ID_ARTICLE";
50
    }
51
 
19 ilm 52
    public SQLComponent createComponent() {
53
        return new BaseSQLComponent(this) {
54
 
55
            public void addViews() {
56
                this.setLayout(new GridBagLayout());
57
                final GridBagConstraints c = new DefaultGridBagConstraints();
58
 
59
                // Nom
83 ilm 60
                JLabel labelNom = new JLabel("PV_TTC");
67 ilm 61
                JTextField textNom = new JTextField();
19 ilm 62
 
63
                this.add(labelNom, c);
64
                c.gridx++;
65
                this.add(textNom, c);
66
 
83 ilm 67
                this.addRequiredSQLObject(textNom, "PV_TTC");
19 ilm 68
 
69
            }
70
        };
71
    }
57 ilm 72
 
73
    @Override
74
    protected String createCode() {
156 ilm 75
        return createCodeOfPackage() + ".price";
57 ilm 76
    }
19 ilm 77
}