OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 180 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 180 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 127... Line 127...
127
        final String k = this.elt.getAttributeValue("removeBreakLine");
127
        final String k = this.elt.getAttributeValue("removeBreakLine");
128
        boolean rmBreakLines = (k == null) ? false : k.equalsIgnoreCase("true");
128
        boolean rmBreakLines = (k == null) ? false : k.equalsIgnoreCase("true");
129
        if (rmBreakLines) {
129
        if (rmBreakLines) {
130
            res = (res == null ? res : res.toString().replaceAll("\n", ","));
130
            res = (res == null ? res : res.toString().replaceAll("\n", ","));
131
        }
131
        }
-
 
132
        final String brk = this.elt.getAttributeValue("replaceWithBreakLine");
-
 
133
        if (brk != null && brk.trim().length() > 0) {
-
 
134
            res = (res == null ? res : res.toString().replaceAll(brk, "\n"));
-
 
135
        }
132
        return res;
136
        return res;
133
    }
137
    }
134
 
138
 
135
    private Object getFromSQLFunction(SQLField field, String function) {
139
    private Object getFromSQLFunction(SQLField field, String function) {
136
        SQLSelect sel = new SQLSelect();
140
        SQLSelect sel = new SQLSelect();
Line 143... Line 147...
143
 
147
 
144
    public DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
148
    public DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
145
 
149
 
146
    protected String getStringProposition(SQLRowAccessor rowProp) {
150
    protected String getStringProposition(SQLRowAccessor rowProp) {
147
 
151
 
-
 
152
        if (rowProp.getTable().getName().equalsIgnoreCase("AFFAIRE")) {
-
 
153
            final SQLRowAccessor nonEmptyForeignProp = rowProp.getNonEmptyForeign("ID_PROPOSITION");
-
 
154
            String result = "";
-
 
155
            if (rowProp.getString("NUMERO_PROPOSITION").trim().length() > 0) {
-
 
156
                return "Notre proposition " + rowProp.getString("NUMERO_PROPOSITION");
-
 
157
            }
-
 
158
            if (nonEmptyForeignProp != null && !nonEmptyForeignProp.isUndefined()) {
-
 
159
                if (result.length() == 0) {
-
 
160
                    result = "Notre proposition " + nonEmptyForeignProp.getString("NUMERO_PROPOSITION");
-
 
161
                }
-
 
162
                result += " du " + format.format(rowProp.getObject("DATE"));
-
 
163
            }
-
 
164
            return result;
-
 
165
        } else {
-
 
166
 
148
        return "Notre proposition " + rowProp.getString("NUMERO") + " du " + format.format(rowProp.getObject("DATE"));
167
            return "Notre proposition " + rowProp.getString("NUMERO") + " du " + format.format(rowProp.getObject("DATE"));
-
 
168
        }
149
    }
169
    }
150
 
170
 
151
 
171
 
152
    public Double getTotalHTTable(SQLRowAccessor rowFact) {
172
    public Double getTotalHTTable(SQLRowAccessor rowFact) {
153
 
173
 
Line 213... Line 233...
213
    }
233
    }
214
 
234
 
215
    public boolean isImage() {
235
    public boolean isImage() {
216
        return this.elt.getAttributeValue("type").equalsIgnoreCase("image");
236
        return this.elt.getAttributeValue("type").equalsIgnoreCase("image");
217
    }
237
    }
-
 
238
 
-
 
239
    public SQLElement getSQLElement() {
-
 
240
        return this.sqlElt;
-
 
241
    }
218
}
242
}