OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 83 | 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.stock.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;
132 ilm 20
import org.openconcerto.utils.ListMap;
18 ilm 21
 
22
import java.awt.GridBagConstraints;
23
import java.awt.GridBagLayout;
24
import java.util.ArrayList;
25
import java.util.List;
26
 
27
import javax.swing.JLabel;
28
import javax.swing.JTextField;
29
 
30
public class StockSQLElement extends ComptaSQLConfElement {
31
 
32
    public StockSQLElement() {
33
        super("STOCK", "un stock", "stocks");
34
    }
35
 
36
    protected List<String> getListFields() {
37
        final List<String> l = new ArrayList<String>();
38
        l.add("QTE_REEL");
39
        // l.add("QTE_TH");
40
        return l;
41
    }
42
 
43
    protected List<String> getComboFields() {
44
        final List<String> l = new ArrayList<String>();
45
        l.add("QTE_REEL");
46
        // l.add("QTE_TH");
47
        return l;
48
    }
49
 
83 ilm 50
    @Override
132 ilm 51
    public boolean isPrivate() {
52
        return true;
83 ilm 53
    }
54
 
132 ilm 55
    @Override
56
    public ListMap<String, String> getShowAs() {
57
        return ListMap.singleton(null, "QTE_TH", "QTE_REEL", "QTE_LIV_ATTENTE", "QTE_RECEPT_ATTENTE");
58
    }
59
 
18 ilm 60
    /*
61
     * (non-Javadoc)
62
     *
63
     * @see org.openconcerto.devis.SQLElement#getComponent()
64
     */
65
    public SQLComponent createComponent() {
66
 
67
        return new BaseSQLComponent(this) {
68
 
69
            private JTextField textQteReel;
70
 
71
            // , textQteTh;
72
 
73
            public void addViews() {
74
                this.setLayout(new GridBagLayout());
75
                final GridBagConstraints c = new DefaultGridBagConstraints();
76
 
77
                // Qté Réelle
78
                JLabel labelQteR = new JLabel(getLabelFor("QTE_REEL"));
79
                this.add(labelQteR, c);
80
 
81
                c.gridx++;
82
                this.textQteReel = new JTextField(6);
83
                this.add(this.textQteReel, c);
84
 
85
                // Qté Théorique
86
                // c.gridy++;
87
                // c.gridx = 0;
88
                // JLabel labelQteTh = new JLabel(getLabelFor("QTE_TH"));
89
                // this.add(labelQteTh, c);
90
                //
91
                // c.gridx++;
92
                // this.textQteTh = new JTextField(6, false);
93
                // this.add(this.textQteTh, c);
94
 
95
                this.addSQLObject(this.textQteReel, "QTE_REEL");
96
                // this.addSQLObject(this.textQteTh, "QTE_TH");
97
            }
98
        };
99
    }
100
}