OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | 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.finance.accounting.report;
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.preferences.TemplateNXProps;
18
import org.openconcerto.sql.Configuration;
19
import org.openconcerto.sql.model.SQLRow;
20
 
21
public class PdfGenerator_2033B extends PdfGenerator {
22
    public PdfGenerator_2033B() {
23
        super("2033B.pdf", "result_2033B.pdf", TemplateNXProps.getInstance().getStringProperty("Location2033BPDF"));
24
        setTemplateOffset(0, 0);
25
        setOffset(0, 0);
26
        setMargin(32, 32);
27
 
28
    }
29
 
30
    public void generate() {
31
        setFontRoman(8);
32
 
33
        SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
34
        addText("NOM", rowSociete.getString("TYPE") + " " + rowSociete.getString("NOM"), 228, 827);
35
        setFontRoman(12);
36
 
37
        addSplittedText("CLOS1", "08202006", 412, 809, 9.7);
38
        addSplittedText("CLOS2", "08202006", 502, 809, 9.7);
39
 
40
        // Copyright
41
        setFontRoman(9);
42
        String cc = "Document généré par le logiciel Bloc, (c) Front Software 2006";
43
        addText("", cc, getWidth() - 2, 460, 90);
44
 
45
        setFontRoman(10);
46
        long t = 143785123456L;
47
        int yy = 0;
48
        int y = 786;
49
        for (; y > 740; y -= 18) {
50
 
51
            addTextRight("PRODUIT1." + yy, insertCurrencySpaces("" + t), 400, y);
52
            addTextRight("PRODUIT2." + yy, insertCurrencySpaces("" + t), 491, y);
53
            addTextRight("PRODUIT3." + yy, insertCurrencySpaces("" + t), 580, y);
54
            yy++;
55
        }
56
        for (; y > 650; y -= 18) {
57
 
58
            addTextRight("PRODUIT2." + yy, insertCurrencySpaces("" + t), 491, y);
59
            addTextRight("PRODUIT3." + yy, insertCurrencySpaces("" + t), 580, y);
60
            yy++;
61
        }
62
 
63
        for (int i = 0; i < 5; i++) {
64
            addTextRight("CHARGES3." + yy, insertCurrencySpaces("" + t), 491, y);
65
            addTextRight("CHARGES4." + yy, insertCurrencySpaces("" + t), 608 - 28, y);
66
            yy++;
67
            y -= 18;
68
        }
69
        y += 18;
70
        t = t / 100;
71
        yy--;
72
        addTextRight("CBAIL_MO" + yy, insertCurrencySpaces("" + t), 280, y + 1);
73
        addTextRight("CBAIL_IMMO" + yy, insertCurrencySpaces("" + t), 396, y + 1);
74
        yy++;
75
        y -= 18;
76
        //
77
 
78
        addTextRight("CHARGES1." + yy, insertCurrencySpaces("" + t), 392, y);
79
        addTextRight("CHARGES2." + yy, insertCurrencySpaces("" + t), 491, y);
80
        addTextRight("CHARGES3." + yy, insertCurrencySpaces("" + t), 580, y);
81
        yy++;
82
        y -= 18;
83
        // Remuneration du personnel
84
        for (int i = 0; i < 4; i++) {
85
            addTextRight("CHARGES3." + yy, insertCurrencySpaces("" + t), 491, y);
86
            addTextRight("CHARGES4." + yy, insertCurrencySpaces("" + t), 608 - 28, y);
87
            yy++;
88
            y -= 18;
89
        }
90
        //
91
        addTextRight("CHARGES1." + yy, insertCurrencySpaces("" + t), 392, y);
92
        addTextRight("CHARGES2." + yy, insertCurrencySpaces("" + t), 491, y);
93
        addTextRight("CHARGES3." + yy, insertCurrencySpaces("" + t), 580, y);
94
        yy++;
95
        y -= 18;
96
        //
97
        for (int i = 0; i < 9; i++) {
98
            addTextRight("PCHARGES3." + yy, insertCurrencySpaces("" + t), 491, y);
99
            addTextRight("PCHARGES4." + yy, insertCurrencySpaces("" + t), 580, y);
100
            yy++;
101
            y -= 18;
102
        }
103
 
104
        for (int i = 0; i < 4; i++) {
105
            addTextRight("REINT3." + yy, insertCurrencySpaces("" + t), 491, y);
106
            yy++;
107
            y -= 18;
108
        }
109
        //
110
        t = t / 100;
111
        addTextRight("REINT1." + yy, insertCurrencySpaces("" + t), 220, y);
112
        addTextRight("REINT2." + yy, insertCurrencySpaces("" + t), 401, y);
113
        addTextRight("REINT3." + yy, insertCurrencySpaces("" + t), 491, y);
114
        yy++;
115
        y -= 18;
116
        for (int i = 0; i < 2; i++) {
117
            addTextRight("DEDUC1." + yy, insertCurrencySpaces("" + t), 148, y);
118
            addTextRight("DEDUC2." + yy, insertCurrencySpaces("" + t), 275, y);
119
            addTextRight("DEDUC3." + yy, insertCurrencySpaces("" + t), 401, y);
120
 
121
            yy++;
122
            y -= 18;
123
        }
124
        yy--;
125
        addTextRight("DEDUC4." + yy, insertCurrencySpaces("" + t), 580, y + 25);
126
        yy++;
127
        //
128
 
129
        addTextRight("DEDUC2." + yy, insertCurrencySpaces("" + t), 237, y);
130
        addTextRight("DEDUC3." + yy, insertCurrencySpaces("" + t), 392, y);
131
        addTextRight("DEDUC4." + yy, insertCurrencySpaces("" + t), 580, y);
132
 
133
        yy++;
134
        y -= 18;
135
        //
136
        addTextRight("RES3." + yy, insertCurrencySpaces("" + t), 491, y);
137
        addTextRight("RES4." + yy, insertCurrencySpaces("" + t), 580, y);
138
        yy++;
139
        y -= 18;
140
        //
141
        addTextRight("DEF3." + yy, insertCurrencySpaces("" + t), 491, y);
142
        yy++;
143
        y -= 18;
144
        //
145
        addTextRight("DEF4." + yy, insertCurrencySpaces("" + t), 580, y);
146
        yy++;
147
        y -= 18;
148
        //
149
        addTextRight("RES3." + yy, insertCurrencySpaces("" + t), 491, y);
150
        addTextRight("RES4." + yy, insertCurrencySpaces("" + t), 580, y);
151
        yy++;
152
        y -= 18;
153
        //
154
        addTextRight("COT1." + yy, insertCurrencySpaces("" + t), 195, y);
155
        addTextRight("COT2." + yy, insertCurrencySpaces("" + t), 401, y);
156
        addSplittedText("COT3." + yy, "876543", 514, y, 11.5);
157
 
158
        yy++;
159
        y -= 18;
160
        //
161
        addTextRight("T1." + yy, insertCurrencySpaces("" + t), 242, y);
162
        addSplittedText("T2." + yy, "88", 333, y, 14.4);
163
        addSplittedText("T3." + yy, "88", 406, y, 10);
164
        addSplittedText("T4." + yy, "88", 464, y, 10);
165
        yy++;
166
        y -= 18;
167
        //
168
        addTextRight("T1." + yy, insertCurrencySpaces("" + t), 242, y);
169
        addTextRight("T2." + yy, insertCurrencySpaces("" + t), 461, y);
170
 
171
    }
172
 
173
}