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.order.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 CommandeClientXmlSheet extends AbstractSheetXMLWithDate {
18 ilm 22
 
25 ilm 23
    public static final String TEMPLATE_ID = "CommandeClient";
24
    public static final String TEMPLATE_PROPERTY_NAME = "LocationCmdCli";
18 ilm 25
 
25 ilm 26
    // FIXME Prefs printer location
27
    public CommandeClientXmlSheet(SQLRow row) {
28
        super(row);
29
        this.printer = PrinterNXProps.getInstance().getStringProperty("cmdCliPrinter");
30
        this.elt = Configuration.getInstance().getDirectory().getElement("COMMANDE_CLIENT");
18 ilm 31
 
32
    }
21 ilm 33
 
19 ilm 34
    @Override
35
    public String getReference() {
36
        return this.row.getString("NOM");
37
    }
18 ilm 38
 
19 ilm 39
    @Override
40
    public SQLRow getRowLanguage() {
41
        SQLRow rowClient = this.row.getForeignRow("ID_CLIENT");
42
        if (rowClient.getTable().contains("ID_LANGUE")) {
43
            return rowClient.getForeignRow("ID_LANGUE");
44
        } else {
45
            return super.getRowLanguage();
46
        }
47
    }
48
 
25 ilm 49
    @Override
50
    public String getDefaultTemplateId() {
51
        return TEMPLATE_ID;
21 ilm 52
    }
18 ilm 53
 
21 ilm 54
    @Override
25 ilm 55
    public String getName() {
56
        return "CommandeClient_" + this.row.getString("NUMERO");
18 ilm 57
    }
58
}