OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 132 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
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
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
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.
9
 * language governing permissions and limitations under the License.
Line 81... Line 81...
81
        this.typeStyleWhere = (this.typeWhere == null) ? false : this.typeWhere.equalsIgnoreCase("Style");
81
        this.typeStyleWhere = (this.typeWhere == null) ? false : this.typeWhere.equalsIgnoreCase("Style");
82
 
82
 
83
    }
83
    }
84
 
84
 
85
    public List<? extends SQLRowAccessor> getRows() {
85
    public List<? extends SQLRowAccessor> getRows() {
86
        SQLTable tableElt = Configuration.getInstance().getRoot().findTable(this.tableau.getAttributeValue("table"));
86
        String foreignTableName = this.tableau.getAttributeValue("table");
87
 
87
 
88
        if (tableElt != null) {
88
        SQLTable tableElt = null;
-
 
89
        if (!this.row.isEmpty()) {
-
 
90
            SQLTable tableRow = this.row.get(0).getTable();
-
 
91
            if (tableRow.getDBRoot().contains(foreignTableName)) {
-
 
92
                tableElt = tableRow.getDBRoot().getTable(foreignTableName);
-
 
93
            } else {
-
 
94
                tableElt = Configuration.getInstance().getRoot().findTable(foreignTableName);
-
 
95
            }
-
 
96
        }
89
 
97
 
90
            // // #if gestionnx
-
 
91
            // Set<SQLField> fields =
-
 
92
            // tablePourcentService.getForeignKeys(tableElt);
-
 
93
            //
-
 
94
            // if (((ComptaPropsConfiguration)
-
 
95
            // Configuration.getInstance()).customerIsPreventec() && fields !=
-
 
96
            // null && fields.size() > 0) {
-
 
97
            // SQLSelect sel = new
-
 
98
            // SQLSelect(Configuration.getInstance().getBase());
-
 
99
            //
-
 
100
            // sel.addSelectStar(tableElt);
-
 
101
            // Set<SQLField> fieldsElt =
-
 
102
            // tableElt.getForeignKeys(this.row.getTable());
-
 
103
            // Where w = new Where(fieldsElt.iterator().next(), "=",
-
 
104
            // this.row.getTable().getKey());
-
 
105
            // w = w.and(new Where(fields.iterator().next(), "=",
-
 
106
            // tableElt.getKey()));
98
        if (tableElt != null) {
107
            // w = w.and(new Where(this.row.getTable().getKey(), "=",
-
 
108
            // this.row.getID()));
-
 
109
            // sel.setWhere(w);
-
 
110
            // sel.addFieldOrder(tablePourcentService.getField("ID_VERIFICATEUR"));
-
 
111
            // sel.addFieldOrder(fields.iterator().next());
-
 
112
            // List<SQLRow> l = (List<SQLRow>)
-
 
113
            // Configuration.getInstance().getBase().getDataSource().execute(sel.asString(),
-
 
114
            // SQLRowListRSH.createFromSelect(sel, tableElt));
-
 
115
            //
-
 
116
            // // Suppression des doublons
-
 
117
            // List<SQLRow> list = new ArrayList<SQLRow>();
-
 
118
            // for (SQLRow sqlRow : l) {
-
 
119
            // if (!list.contains(sqlRow)) {
-
 
120
            // list.add(sqlRow);
-
 
121
            // }
-
 
122
            // }
-
 
123
            // return list;
-
 
124
            // }
-
 
125
            // // #endif
-
 
126
 
99
 
127
            return cache.getReferentRows(this.row, tableElt, this.tableau.getAttributeValue("groupBy"), this.tableau.getAttributeValue("orderBy"),
100
            return cache.getReferentRows(this.row, tableElt, this.tableau.getAttributeValue("groupBy"), this.tableau.getAttributeValue("orderBy"),
128
                    Boolean.valueOf(this.tableau.getAttributeValue("expandNomenclature")), this.tableau.getAttributeValue("foreignField"),
101
                    Boolean.valueOf(this.tableau.getAttributeValue("expandNomenclature")), this.tableau.getAttributeValue("foreignField"),
129
                    Boolean.valueOf(this.tableau.getAttributeValue("excludeZeroQty")));
102
                    Boolean.valueOf(this.tableau.getAttributeValue("excludeZeroQty")));
130
 
103