OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 25 | 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
 *
182 ilm 4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
18 ilm 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;
182 ilm 17
import org.openconcerto.erp.generationDoc.gestcomm.OptionDocProcessor;
18 ilm 18
import org.openconcerto.erp.preferences.PrinterNXProps;
19
import org.openconcerto.sql.Configuration;
20
import org.openconcerto.sql.model.SQLRow;
21
 
25 ilm 22
public class CommandeClientXmlSheet extends AbstractSheetXMLWithDate {
18 ilm 23
 
25 ilm 24
    public static final String TEMPLATE_ID = "CommandeClient";
25
    public static final String TEMPLATE_PROPERTY_NAME = "LocationCmdCli";
18 ilm 26
 
25 ilm 27
    // FIXME Prefs printer location
28
    public CommandeClientXmlSheet(SQLRow row) {
29
        super(row);
30
        this.printer = PrinterNXProps.getInstance().getStringProperty("cmdCliPrinter");
31
        this.elt = Configuration.getInstance().getDirectory().getElement("COMMANDE_CLIENT");
182 ilm 32
        this.setPostProcess(new OptionDocProcessor());
18 ilm 33
    }
21 ilm 34
 
19 ilm 35
    @Override
36
    public String getReference() {
37
        return this.row.getString("NOM");
38
    }
18 ilm 39
 
19 ilm 40
    @Override
41
    public SQLRow getRowLanguage() {
42
        SQLRow rowClient = this.row.getForeignRow("ID_CLIENT");
43
        if (rowClient.getTable().contains("ID_LANGUE")) {
44
            return rowClient.getForeignRow("ID_LANGUE");
45
        } else {
46
            return super.getRowLanguage();
47
        }
48
    }
49
 
25 ilm 50
    @Override
51
    public String getDefaultTemplateId() {
52
        return TEMPLATE_ID;
21 ilm 53
    }
18 ilm 54
 
21 ilm 55
    @Override
25 ilm 56
    public String getName() {
57
        return "CommandeClient_" + this.row.getString("NUMERO");
18 ilm 58
    }
59
}