OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
80 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.order.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
 
25
import javax.swing.JTextField;
26
 
27
public class FactureFournisseurElementSQLElement extends ComptaSQLConfElement {
28
 
29
    public FactureFournisseurElementSQLElement() {
30
        super("FACTURE_FOURNISSEUR_ELEMENT", "un element de facture", "éléments de facture");
31
    }
32
 
132 ilm 33
    @Override
34
    protected String getParentFFName() {
35
        return "ID_FACTURE_FOURNISSEUR";
36
    }
37
 
80 ilm 38
    protected List<String> getListFields() {
39
        final List<String> l = new ArrayList<String>();
40
        l.add("ID_STYLE");
142 ilm 41
        l.add("ID_FACTURE_FOURNISSEUR");
80 ilm 42
        l.add("CODE");
43
        l.add("NOM");
142 ilm 44
        l.add("QTE");
45
        l.add("QTE_UNITAIRE");
80 ilm 46
        l.add("PA_HT");
142 ilm 47
        l.add("T_PA_HT");
80 ilm 48
        l.add("ID_TAXE");
142 ilm 49
        l.add("T_PA_TTC");
80 ilm 50
        l.add("POIDS");
51
        return l;
52
    }
53
 
54
    protected List<String> getComboFields() {
55
        final List<String> l = new ArrayList<String>();
56
        l.add("CODE");
57
        l.add("NOM");
58
        l.add("PA_HT");
59
        l.add("PV_HT");
60
        return l;
61
    }
62
 
63
    /*
64
     * (non-Javadoc)
65
     *
66
     * @see org.openconcerto.devis.SQLElement#getComponent()
67
     */
68
    public SQLComponent createComponent() {
69
        return new UISQLComponent(this) {
70
            public void addViews() {
71
                this.addRequiredSQLObject(new JTextField(), "NOM", "left");
72
                this.addRequiredSQLObject(new JTextField(), "CODE", "right");
73
 
74
                this.addSQLObject(new ElementComboBox(), "ID_STYLE", "left");
75
 
76
                this.addRequiredSQLObject(new DeviseField(), "PA_HT", "left");
77
                this.addSQLObject(new DeviseField(), "PV_HT", "right");
78
 
79
                this.addSQLObject(new JTextField(), "POIDS", "left");
80
                this.addSQLObject(new ElementComboBox(), "ID_TAXE", "right");
81
            }
82
        };
83
    }
84
 
85
    @Override
86
    protected String createCode() {
156 ilm 87
        return createCodeOfPackage() + "invoice.purchase.item";
80 ilm 88
    }
89
}