OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 21 | Rev 73 | Go to most recent revision | 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.generationDoc.gestcomm;
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 CommandeXmlSheet extends AbstractSheetXMLWithDate {
18 ilm 22
 
25 ilm 23
    public static final String TEMPLATE_ID = "Commande";
24
    public static final String TEMPLATE_PROPERTY_NAME = "LocationCmd";
18 ilm 25
 
19 ilm 26
    @Override
27
    public SQLRow getRowLanguage() {
28
        SQLRow rowFournisseur = this.row.getForeignRow("ID_FOURNISSEUR");
29
        if (rowFournisseur.getTable().contains("ID_LANGUE")) {
30
            return rowFournisseur.getForeignRow("ID_LANGUE");
31
        } else {
32
            return super.getRowLanguage();
33
        }
34
    }
35
 
18 ilm 36
    // FIXME Prefs printer location
37
    public CommandeXmlSheet(SQLRow row) {
38
        super(row);
39
        this.printer = PrinterNXProps.getInstance().getStringProperty("CmdPrinter");
40
        this.elt = Configuration.getInstance().getDirectory().getElement("COMMANDE");
41
    }
42
 
21 ilm 43
    @Override
25 ilm 44
    public String getDefaultTemplateId() {
45
        return TEMPLATE_ID;
21 ilm 46
    }
47
 
25 ilm 48
    @Override
49
    public String getName() {
50
        return "Commande_" + row.getString("NUMERO");
18 ilm 51
    }
52
}