OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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