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
83 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.common.element;
15
 
16
import org.openconcerto.sql.element.SQLComponent;
17
import org.openconcerto.sql.element.UISQLComponent;
144 ilm 18
import org.openconcerto.sql.request.ComboSQLRequest;
19
import org.openconcerto.sql.request.ComboSQLRequest.KeepMode;
83 ilm 20
import org.openconcerto.utils.ProductInfo;
21
 
22
import java.util.ArrayList;
144 ilm 23
import java.util.Arrays;
83 ilm 24
import java.util.List;
25
 
26
public class BanqueSQLElement extends ComptaSQLConfElement {
27
 
28
    public static final String TABLENAME = ProductInfo.getInstance().getName().equals("OpenConcerto") ? "BANQUE" : "BANQUE_POLE_PRODUIT";
29
 
30
    public BanqueSQLElement() {
31
        super(TABLENAME, "une banque", "banques");
32
    }
33
 
34
    @Override
144 ilm 35
    protected void _initComboRequest(ComboSQLRequest req) {
36
        super._initComboRequest(req);
37
        req.addForeignToGraphToFetch("ID_JOURNAL", Arrays.asList("ID", "CODE", "NOM"));
38
        req.keepRows(KeepMode.GRAPH);
39
    }
40
 
41
    @Override
83 ilm 42
    protected List<String> getComboFields() {
43
        List<String> list = new ArrayList<String>();
44
        list.add("CODE");
45
        list.add("NOM");
46
        return list;
47
    }
48
 
49
    @Override
50
    protected List<String> getListFields() {
51
        List<String> list = new ArrayList<String>();
52
        list.add("CODE");
53
        list.add("NOM");
54
 
55
        list.add("ID_JOURNAL");
56
        list.add("ID_COMPTE_PCE");
57
        return list;
58
    }
59
 
60
    public SQLComponent createComponent() {
61
        return new UISQLComponent(this, 2) {
62
            public void addViews() {
63
                this.addView("CODE");
64
                this.addView("NOM");
65
                this.addView("NUMERO_RUE");
66
                this.addView("VOIE");
67
                this.addView("RUE");
68
                this.addView("VILLE");
69
                this.addView("BIC");
70
                this.addView("IBAN");
71
                this.addView("AFFACTURAGE");
72
                this.addView("ID_JOURNAL");
73
                this.addView("ID_COMPTE_PCE");
74
                this.addView("INFOS");
75
 
76
            }
77
        };
78
    }
79
}