OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev Author Line No. Line
94 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.erp.core.sales.product.component.ProductItemGroup;
18
import org.openconcerto.sql.element.GroupSQLComponent;
19
import org.openconcerto.sql.element.SQLComponent;
132 ilm 20
import org.openconcerto.utils.ListMap;
94 ilm 21
 
22
import java.util.ArrayList;
23
import java.util.List;
24
 
25
public class ProductItemSQLElement extends ComptaSQLConfElement {
26
    public static final String ELEMENT_CODE = "sales.product.bom";
27
    public static final String TABLE_PRODUCT_ITEM = "ARTICLE_ELEMENT";
28
 
29
    public ProductItemSQLElement() {
156 ilm 30
        super(TABLE_PRODUCT_ITEM, "un élément de nomenclature", "éléments de nomenclature");
94 ilm 31
    }
32
 
33
    @Override
34
    protected String createCode() {
35
        return ELEMENT_CODE;
36
    }
37
 
38
    @Override
39
    protected List<String> getListFields() {
40
        final List<String> l = new ArrayList<String>();
41
        l.add("ID_ARTICLE");
42
        l.add("QTE_UNITAIRE");
43
        l.add("ID_UNITE_VENTE");
44
        return l;
45
    }
46
 
47
    @Override
48
    protected List<String> getComboFields() {
49
        final List<String> l = new ArrayList<String>();
50
        l.add("ID_ARTICLE");
51
        l.add("QTE_UNITAIRE");
52
        l.add("ID_UNITE_VENTE");
53
        return l;
54
    }
55
 
56
    @Override
132 ilm 57
    public ListMap<String, String> getShowAs() {
58
        return ListMap.singleton(null, getComboFields());
94 ilm 59
    }
60
 
61
    @Override
62
    public SQLComponent createComponent() {
63
        return new GroupSQLComponent(this, new ProductItemGroup());
64
    }
65
 
66
    @Override
67
    protected String getParentFFName() {
68
 
69
        return "ID_ARTICLE_PARENT";
70
    }
71
}