OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 19 | Go to most recent revision | Details | 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.shipment.report;
15
 
16
import org.openconcerto.erp.generationDoc.AbstractSheetXml;
17
import org.openconcerto.erp.generationDoc.SheetXml;
18
import org.openconcerto.erp.preferences.PrinterNXProps;
19
import org.openconcerto.sql.Configuration;
20
import org.openconcerto.sql.model.SQLRow;
21
import org.openconcerto.utils.Tuple2;
22
 
23
import java.io.File;
24
import java.util.Calendar;
25
import java.util.Date;
26
 
27
public class BonLivraisonXmlSheet extends AbstractSheetXml {
28
 
29
    private static final Tuple2<String, String> tuple = Tuple2.create("LocationBon", "Bon de livraison");
30
 
31
    public static Tuple2<String, String> getTuple2Location() {
32
        return tuple;
33
    }
34
 
35
    public BonLivraisonXmlSheet(SQLRow row) {
36
        super(row);
37
        this.printer = PrinterNXProps.getInstance().getStringProperty("BonPrinter");
38
        this.elt = Configuration.getInstance().getDirectory().getElement("BON_DE_LIVRAISON");
39
        Calendar cal = Calendar.getInstance();
40
        cal.setTime((Date) row.getObject("DATE"));
41
        this.locationOO = SheetXml.getLocationForTuple(tuple, false) + File.separator + cal.get(Calendar.YEAR);
42
        this.locationPDF = SheetXml.getLocationForTuple(tuple, true) + File.separator + cal.get(Calendar.YEAR);
43
        this.modele = "BonLivraison";
44
    }
45
 
46
    public String getFileName() {
47
        return getValidFileName("BonLivraison_" + this.row.getString("NUMERO"));
48
    }
49
}