OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 19 | Rev 65 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19 Rev 25
Line 13... Line 13...
13
 
13
 
14
 package org.openconcerto.erp.generationDoc.gestcomm;
14
 package org.openconcerto.erp.generationDoc.gestcomm;
15
 
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.generationDoc.AbstractJOOReportsSheet;
17
import org.openconcerto.erp.generationDoc.AbstractJOOReportsSheet;
18
import org.openconcerto.erp.generationDoc.AbstractSheetXml;
-
 
19
import org.openconcerto.sql.Configuration;
18
import org.openconcerto.sql.Configuration;
20
import org.openconcerto.sql.element.SQLElement;
19
import org.openconcerto.sql.element.SQLElement;
21
import org.openconcerto.sql.model.SQLRow;
20
import org.openconcerto.sql.model.SQLRow;
22
import org.openconcerto.sql.model.SQLTable;
21
import org.openconcerto.sql.model.SQLTable;
23
import org.openconcerto.utils.Tuple2;
-
 
24
 
22
 
25
import java.util.Date;
23
import java.util.Date;
26
import java.util.HashMap;
24
import java.util.HashMap;
27
import java.util.List;
25
import java.util.List;
28
import java.util.Map;
26
import java.util.Map;
29
 
27
 
30
public class CourrierClientSheet extends AbstractJOOReportsSheet {
28
public class CourrierClientSheet extends AbstractJOOReportsSheet {
31
 
29
 
32
    private SQLRow rowCourrier;
30
    private SQLRow rowCourrier;
33
 
31
 
34
    private static final Tuple2<String, String> tuple = Tuple2.create("LocationCourrier", "Courrier");
32
    public static final String TEMPLATE_ID = "Courrier";
35
 
-
 
36
    public static Tuple2<String, String> getTuple2Location() {
33
    public static final String TEMPLATE_PROPERTY_NAME = "LocationCourrier";
37
        return tuple;
-
 
38
    }
-
 
39
 
34
 
40
    public CourrierClientSheet(SQLRow row) {
35
    public CourrierClientSheet(SQLRow row) {
41
        super();
36
        super();
42
        this.rowCourrier = row;
37
        this.rowCourrier = row;
43
        Date d = (Date) this.rowCourrier.getObject("DATE");
38
        Date d = (Date) this.rowCourrier.getObject("DATE");
44
        String year = yearFormat.format(d);
39
        String year = yearFormat.format(d);
45
        init(year, "Courrier.odt", "CourrierPrinter", tuple);
40
        init(year, "Courrier.odt", "CourrierPrinter");
46
    }
41
    }
47
 
42
 
48
    /**
43
    /**
49
     * @return une Map contenant les valeurs à remplacer dans la template
44
     * @return une Map contenant les valeurs à remplacer dans la template
50
     */
45
     */
51
    protected Map createMap() {
46
    protected Map<String, Object> createMap() {
52
 
47
 
53
        Map<String, Object> m = new HashMap<String, Object>();
48
        Map<String, Object> m = new HashMap<String, Object>();
54
 
49
 
55
        SQLElement elt = Configuration.getInstance().getDirectory().getElement("MODELE_COURRIER_CLIENT");
50
        SQLElement elt = Configuration.getInstance().getDirectory().getElement("MODELE_COURRIER_CLIENT");
56
        SQLRow rowModele = elt.getTable().getRow(this.rowCourrier.getInt("ID_MODELE_COURRIER_CLIENT"));
51
        SQLRow rowModele = elt.getTable().getRow(this.rowCourrier.getInt("ID_MODELE_COURRIER_CLIENT"));
Line 82... Line 77...
82
        }
77
        }
83
        return m;
78
        return m;
84
    }
79
    }
85
 
80
 
86
    public String getFileName() {
81
    public String getFileName() {
87
        String fileName = "Courrier_" + AbstractSheetXml.getValidFileName(this.rowCourrier.getString("NUMERO"));
82
        return "Courrier_" + this.rowCourrier.getString("NUMERO");
88
        return fileName;
-
 
89
    }
83
    }
90
 
84
 
91
}
85
}