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 | Regard 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 14... Line 14...
14
 package org.openconcerto.erp.core.common.ui;
14
 package org.openconcerto.erp.core.common.ui;
15
 
15
 
16
import org.openconcerto.erp.core.finance.accounting.model.Currency;
16
import org.openconcerto.erp.core.finance.accounting.model.Currency;
17
import org.openconcerto.erp.core.finance.accounting.model.CurrencyConverter;
17
import org.openconcerto.erp.core.finance.accounting.model.CurrencyConverter;
18
import org.openconcerto.sql.model.SQLField;
18
import org.openconcerto.sql.model.SQLField;
19
import org.openconcerto.sql.model.SQLRowValues;
19
import org.openconcerto.sql.model.SQLRowAccessor;
20
import org.openconcerto.sql.view.list.IListe;
20
import org.openconcerto.sql.view.list.IListe;
21
import org.openconcerto.sql.view.list.ITableModel;
21
import org.openconcerto.sql.view.list.ITableModel;
22
import org.openconcerto.sql.view.list.ListSQLLine;
22
import org.openconcerto.sql.view.list.ListSQLLine;
23
import org.openconcerto.sql.view.list.SQLTableModelColumn;
23
import org.openconcerto.sql.view.list.SQLTableModelColumn;
24
import org.openconcerto.ui.DefaultGridBagConstraints;
24
import org.openconcerto.ui.DefaultGridBagConstraints;
Line 220... Line 220...
220
        Map<SQLTableModelColumn, Double> mapPourcent = new HashMap<SQLTableModelColumn, Double>();
220
        Map<SQLTableModelColumn, Double> mapPourcent = new HashMap<SQLTableModelColumn, Double>();
221
        Map<SQLTableModelColumn, Integer> mapPourcentSize = new HashMap<SQLTableModelColumn, Integer>();
221
        Map<SQLTableModelColumn, Integer> mapPourcentSize = new HashMap<SQLTableModelColumn, Integer>();
222
 
222
 
223
        for (ListSQLLine line : listLines) {
223
        for (ListSQLLine line : listLines) {
224
 
224
 
225
            final SQLRowValues rowAt = line.getRow();
225
            final SQLRowAccessor rowAt = line.getRowAccessor();
226
            final List<SQLTableModelColumn> columns = line.getColumns().getColumns();
226
            final List<SQLTableModelColumn> columns = line.getColumns().getColumns();
227
 
227
 
228
            for (final Tuple2<? extends SQLTableModelColumn, Type> field : listField) {
228
            for (final Tuple2<? extends SQLTableModelColumn, Type> field : listField) {
229
                final Type type = field.get1();
229
                final Type type = field.get1();
230
 
230
 
Line 286... Line 286...
286
                        } else {
286
                        } else {
287
                            mapTotal.put(field.get0(), n.add(ttc.multiply(av).movePointLeft(2)));
287
                            mapTotal.put(field.get0(), n.add(ttc.multiply(av).movePointLeft(2)));
288
                        }
288
                        }
289
                    }
289
                    }
290
                } else if (type != Type.MOYENNE_MARGE && type != Type.COUNT) {
290
                } else if (type != Type.MOYENNE_MARGE && type != Type.COUNT) {
-
 
291
 
-
 
292
                    // FIXME Test si la colonne existe sinon exception dans liste des articles quand
-
 
293
                    // on passe de la vue normal à virtuel
-
 
294
                    if (columns.indexOf(field.get0()) != -1) {
-
 
295
 
291
                    BigDecimal n = mapTotal.get(field.get0());
296
                        BigDecimal n = mapTotal.get(field.get0());
292
 
297
 
293
                    final Object value = getValueAt(line, field.get0(), columns);
298
                        final Object value = getValueAt(line, field.get0(), columns);
294
                    final BigDecimal n2 = BigDecimal.valueOf(((Number) value).doubleValue());
299
                        final BigDecimal n2 = BigDecimal.valueOf(((Number) value).doubleValue());
295
 
300
 
Line 314... Line 319...
314
                        }
319
                            }
315
                    }
320
                        }
316
                }
321
                    }
317
            }
322
                }
318
        }
323
            }
-
 
324
        }
319
 
325
 
320
        for (Tuple2<? extends SQLTableModelColumn, Type> field : listField) {
326
        for (Tuple2<? extends SQLTableModelColumn, Type> field : listField) {
321
            if (field.get1() == Type.MOYENNE_MARGE) {
327
            if (field.get1() == Type.MOYENNE_MARGE) {
322
 
328
 
323
                BigDecimal totalVT = mapTotal.get(listField.get(0).get0());
329
                BigDecimal totalVT = mapTotal.get(listField.get(0).get0());