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.generationDoc.gestcomm;
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
25 ilm 17
import org.openconcerto.erp.generationDoc.AbstractSheetXMLWithDate;
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 AvoirClientXmlSheet extends AbstractSheetXMLWithDate {
18 ilm 23
 
25 ilm 24
    public static final String TEMPLATE_ID = "Avoir";
25
    public static final String TEMPLATE_PROPERTY_NAME = "LocationAvoir";
18 ilm 26
 
19 ilm 27
    @Override
28
    public SQLRow getRowLanguage() {
29
        SQLRow rowClient = this.row.getForeignRow("ID_CLIENT");
30
        if (rowClient.getTable().contains("ID_LANGUE")) {
31
            return rowClient.getForeignRow("ID_LANGUE");
32
        } else {
33
            return super.getRowLanguage();
34
        }
35
    }
36
 
18 ilm 37
    public AvoirClientXmlSheet(SQLRow row) {
38
        super(row);
39
        this.printer = PrinterNXProps.getInstance().getStringProperty("BonPrinter");
40
        this.elt = Configuration.getInstance().getDirectory().getElement("AVOIR_CLIENT");
182 ilm 41
        this.setPostProcess(new OptionDocProcessor());
25 ilm 42
    }
18 ilm 43
 
44
 
25 ilm 45
    @Override
46
    public String getDefaultTemplateId() {
47
        return TEMPLATE_ID;
18 ilm 48
    }
49
 
21 ilm 50
    @Override
25 ilm 51
    public String getName() {
52
        return "Avoir_" + this.row.getString("NUMERO");
21 ilm 53
    }
18 ilm 54
}