OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev Author Line No. Line
18 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.quote.report;
15
 
25 ilm 16
import org.openconcerto.erp.generationDoc.AbstractSheetXMLWithDate;
18 ilm 17
import org.openconcerto.erp.preferences.PrinterNXProps;
18
import org.openconcerto.sql.Configuration;
19
import org.openconcerto.sql.model.SQLRow;
20
 
25 ilm 21
public class DevisXmlSheet extends AbstractSheetXMLWithDate {
18 ilm 22
 
25 ilm 23
    public static final String TEMPLATE_ID = "Devis";
24
    public static final String TEMPLATE_PROPERTY_NAME = "LocationDevis";
18 ilm 25
 
19 ilm 26
    @Override
27
    public String getReference() {
28
        return this.row.getString("OBJET");
29
    }
30
 
31
    @Override
32
    public SQLRow getRowLanguage() {
33
        SQLRow rowClient = this.row.getForeignRow("ID_CLIENT");
34
        if (rowClient.getTable().contains("ID_LANGUE")) {
35
            return rowClient.getForeignRow("ID_LANGUE");
36
        } else {
37
            return super.getRowLanguage();
38
        }
39
    }
40
 
18 ilm 41
    public DevisXmlSheet(SQLRow row) {
42
        super(row);
43
        this.printer = PrinterNXProps.getInstance().getStringProperty("DevisPrinter");
44
        this.elt = Configuration.getInstance().getDirectory().getElement("DEVIS");
25 ilm 45
 
18 ilm 46
    }
47
 
21 ilm 48
    @Override
25 ilm 49
    public String getDefaultTemplateId() {
50
        return TEMPLATE_ID;
21 ilm 51
    }
52
 
25 ilm 53
    @Override
54
    public String getName() {
55
        return "Devis_" + this.row.getString("NUMERO");
18 ilm 56
    }
57
}