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 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21 Rev 25
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.generationDoc.gestcomm;
14
 package org.openconcerto.erp.generationDoc.gestcomm;
15
 
15
 
16
import org.openconcerto.erp.generationDoc.AbstractSheetXml;
16
import org.openconcerto.erp.generationDoc.AbstractSheetXMLWithDate;
17
import org.openconcerto.erp.generationDoc.SheetXml;
-
 
18
import org.openconcerto.erp.preferences.PrinterNXProps;
17
import org.openconcerto.erp.preferences.PrinterNXProps;
19
import org.openconcerto.sql.Configuration;
18
import org.openconcerto.sql.Configuration;
20
import org.openconcerto.sql.model.SQLRow;
19
import org.openconcerto.sql.model.SQLRow;
21
import org.openconcerto.utils.Tuple2;
-
 
22
 
20
 
23
import java.io.File;
-
 
24
import java.util.Calendar;
-
 
25
import java.util.Date;
21
public class CommandeXmlSheet extends AbstractSheetXMLWithDate {
26
 
22
 
27
public class CommandeXmlSheet extends AbstractSheetXml {
-
 
28
 
-
 
29
    private static final Tuple2<String, String> tuple = Tuple2.create("LocationCmd", "Commande fournisseur");
23
    public static final String TEMPLATE_ID = "Commande";
30
 
-
 
31
    public static Tuple2<String, String> getTuple2Location() {
24
    public static final String TEMPLATE_PROPERTY_NAME = "LocationCmd";
32
        return tuple;
-
 
33
    }
-
 
34
 
25
 
35
    @Override
26
    @Override
36
    public SQLRow getRowLanguage() {
27
    public SQLRow getRowLanguage() {
37
        SQLRow rowFournisseur = this.row.getForeignRow("ID_FOURNISSEUR");
28
        SQLRow rowFournisseur = this.row.getForeignRow("ID_FOURNISSEUR");
38
        if (rowFournisseur.getTable().contains("ID_LANGUE")) {
29
        if (rowFournisseur.getTable().contains("ID_LANGUE")) {
Line 45... Line 36...
45
    // FIXME Prefs printer location
36
    // FIXME Prefs printer location
46
    public CommandeXmlSheet(SQLRow row) {
37
    public CommandeXmlSheet(SQLRow row) {
47
        super(row);
38
        super(row);
48
        this.printer = PrinterNXProps.getInstance().getStringProperty("CmdPrinter");
39
        this.printer = PrinterNXProps.getInstance().getStringProperty("CmdPrinter");
49
        this.elt = Configuration.getInstance().getDirectory().getElement("COMMANDE");
40
        this.elt = Configuration.getInstance().getDirectory().getElement("COMMANDE");
50
        Calendar cal = Calendar.getInstance();
-
 
51
        cal.setTime((Date) row.getObject("DATE"));
-
 
52
        this.locationOO = SheetXml.getLocationForTuple(tuple, false) + File.separator + cal.get(Calendar.YEAR);
-
 
53
        this.locationPDF = SheetXml.getLocationForTuple(tuple, false) + File.separator + cal.get(Calendar.YEAR);
-
 
54
 
-
 
55
    }
41
    }
56
 
42
 
57
    @Override
43
    @Override
58
    public String getDefaultModele() {
44
    public String getDefaultTemplateId() {
59
 
-
 
60
        return "Commande";
45
        return TEMPLATE_ID;
61
    }
46
    }
62
 
47
 
-
 
48
    @Override
63
    public String getFileName() {
49
    public String getName() {
64
 
-
 
65
        return getValidFileName("Commande_" + row.getString("NUMERO"));
50
        return "Commande_" + row.getString("NUMERO");
66
    }
51
    }
67
}
52
}