OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 177 | Rev 182 | Go to most recent revision | 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
 
132 ilm 16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.config.Gestion;
18
import org.openconcerto.erp.core.finance.accounting.model.SommeCompte;
19
import org.openconcerto.sql.Configuration;
177 ilm 20
import org.openconcerto.sql.model.SQLField;
132 ilm 21
import org.openconcerto.sql.model.SQLRow;
177 ilm 22
import org.openconcerto.sql.model.Where;
132 ilm 23
import org.openconcerto.utils.GestionDevise;
24
 
18 ilm 25
import java.text.DateFormat;
26
import java.text.SimpleDateFormat;
27
import java.util.Date;
28
import java.util.HashMap;
177 ilm 29
import java.util.List;
18 ilm 30
import java.util.Map;
31
 
177 ilm 32
import javax.swing.JOptionPane;
18 ilm 33
import javax.swing.JProgressBar;
34
import javax.swing.SwingUtilities;
35
 
36
public class Map2033B extends Thread {
37
    private Map<String, String> m;
142 ilm 38
    private final DateFormat format = new SimpleDateFormat("ddMMyyyy");
18 ilm 39
    private JProgressBar bar;
40
    private Date dateDeb, dateFin;
41
    SommeCompte sommeCompte;
42
 
43
    public void run() {
44
 
45
        final PdfGenerator_2033B p = new PdfGenerator_2033B();
46
 
47
        this.m = new HashMap<String, String>();
48
 
49
        SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
50
        this.m.put("NOM", rowSociete.getString("TYPE") + " " + rowSociete.getString("NOM"));
51
 
52
        // SQLRow rowExercice =
53
        // Configuration.getInstance().getBase().getTable("EXERCICE_COMMON").getRow(rowSociete.getInt("ID_EXERCICE_COMMON"));
54
        // Date dateFin = (Date) rowExercice.getObject("DATE_FIN");
55
        // Date dateDeb = (Date) rowExercice.getObject("DATE_DEB");
56
        this.m.put("CLOS1", format.format(this.dateFin));
57
        this.m.put("CLOS2", "");
58
 
59
        /*******************************************************************************************
60
         * A - RESULTAT COMPTABLE
61
         ******************************************************************************************/
62
 
63
        /*******************************************************************************************
64
         * PRODUITS D'EXPLOITATION
65
         ******************************************************************************************/
66
 
67
        /*******************************************************************************************
68
         * VENTES DE MARCHANDISES
69
         ******************************************************************************************/
70
        // 209
71
        long v209 = 0;
72
        this.m.put("PRODUIT1.0", GestionDevise.currencyToString(v209, false));
73
 
74
        // 210 -SommeSolde( 707, 707* )-SommeSolde( 7097, 7097* )
75
        long v210 = -this.sommeCompte.soldeCompte(707, 707, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(7097, 7097, true, this.dateDeb, this.dateFin);
76
        this.m.put("PRODUIT2.0", GestionDevise.currencyToString(v210, false));
77
 
78
        // 200
79
        this.m.put("PRODUIT3.0", "");
80
 
81
        /*******************************************************************************************
82
         * PRODUCTION VENDUE ---> BIEN
83
         ******************************************************************************************/
84
        // 215
85
        long v215 = 0;
86
        this.m.put("PRODUIT1.1", GestionDevise.currencyToString(v215, false));
87
 
88
        // 214 -SommeSolde( 700, 705* )-SommeSolde( 7090, 7095* )
177 ilm 89
        long v214 = -this.sommeCompte.soldeCompte(700, 705, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte("709", this.dateDeb, this.dateFin)
90
                - this.sommeCompte.soldeCompte(7090, 7095, true, this.dateDeb, this.dateFin);
91
 
18 ilm 92
        this.m.put("PRODUIT2.1", GestionDevise.currencyToString(v214, false));
93
 
94
        // 201
95
        this.m.put("PRODUIT3.1", "");
96
 
97
        /*******************************************************************************************
98
         * PRODUCTION VENDUE ---> SERVICES
99
         ******************************************************************************************/
100
        // 217
101
        long v217 = 0;
102
        this.m.put("PRODUIT1.2", GestionDevise.currencyToString(v217, false));
103
 
104
        // 218 -SommeSolde( 706, 706* )-SommeSolde( 708, 708* )-SommeSolde( 7096, 7096*
105
        // )-SommeSolde( 7098, 7099* )
106
        long v218 = -this.sommeCompte.soldeCompte(706, 706, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(708, 708, true, this.dateDeb, this.dateFin)
107
                - this.sommeCompte.soldeCompte(7096, 7096, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(7098, 7099, true, this.dateDeb, this.dateFin);
108
        this.m.put("PRODUIT2.2", GestionDevise.currencyToString(v218, false));
109
 
110
        // 202
111
        this.m.put("PRODUIT3.2", "");
112
 
113
        SwingUtilities.invokeLater(new Runnable() {
114
            public void run() {
115
 
116
                Map2033B.this.bar.setValue(10);
117
            }
118
        });
119
 
120
        /*******************************************************************************************
121
         * PRODUCTION STOCKEE
122
         ******************************************************************************************/
123
        // 222 -SommeSolde( 710, 719* )
124
        long v222 = -this.sommeCompte.soldeCompte(713, 713, true, this.dateDeb, this.dateFin);
125
        this.m.put("PRODUIT2.3", GestionDevise.currencyToString(v222, false));
126
 
127
        // 203
128
        this.m.put("PRODUIT3.3", "");
129
 
130
        /*******************************************************************************************
131
         * PRODUCTION IMMOBILISEE
132
         ******************************************************************************************/
133
        // 224 -SommeSolde( 72, 72* )
134
        long v224 = -this.sommeCompte.soldeCompte(72, 73, true, this.dateDeb, this.dateFin);
135
        this.m.put("PRODUIT2.4", GestionDevise.currencyToString(v224, false));
136
 
137
        // 204
138
        this.m.put("PRODUIT3.4", "");
139
 
140
        /*******************************************************************************************
141
         * SUBVENTION D'EXPLOITATION
142
         ******************************************************************************************/
143
        // 226 -SommeSolde( 74, 74* )
144
        long v226 = -this.sommeCompte.soldeCompte(74, 74, true, this.dateDeb, this.dateFin);
145
        this.m.put("PRODUIT2.5", GestionDevise.currencyToString(v226, false));
146
 
147
        // 205
148
        this.m.put("PRODUIT3.5", "");
149
 
150
        /*******************************************************************************************
151
         * AUTRES PRODUITS
152
         ******************************************************************************************/
153
        // 230 -SommeSolde( 73, 73* )-SommeSolde( 75, 75* )-SommeSolde( 780, 785* )-SommeSolde( 790,
154
        // 795* )
155
        long v230 = -this.sommeCompte.soldeCompte(75, 75, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(780, 785, true, this.dateDeb, this.dateFin)
156
                - this.sommeCompte.soldeCompte(790, 795, true, this.dateDeb, this.dateFin);
157
        this.m.put("PRODUIT2.6", GestionDevise.currencyToString(v230, false));
158
 
159
        // 206
160
        this.m.put("PRODUIT3.6", "");
161
 
162
        SwingUtilities.invokeLater(new Runnable() {
163
            public void run() {
164
                Map2033B.this.bar.setValue(20);
165
            }
166
        });
167
        /*******************************************************************************************
168
         * TOTAL I
169
         ******************************************************************************************/
170
        // 232 v210+v214+v218+v222+v224+v226+v230
171
        long v232 = v210 + v214 + v218 + v222 + v224 + v226 + v230;
172
        this.m.put("PRODUIT2.7", GestionDevise.currencyToString(v232, false));
173
 
174
        // 207
175
        this.m.put("PRODUIT3.7", "");
176
 
177
        /*******************************************************************************************
178
         * CHARGES D'EXPLOITATION
179
         ******************************************************************************************/
180
 
181
        /*******************************************************************************************
182
         * ACHATS DE MARCHANDISES
183
         ******************************************************************************************/
184
        // 234 SommeSolde( 607, 608* )+SommeSolde( 6097, 6097* )
185
        long v234 = this.sommeCompte.soldeCompte(607, 607, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6097, 6097, true, this.dateDeb, this.dateFin)
180 ilm 186
                + this.sommeCompte.soldeCompte(608, 608, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(6081, 6086, true, this.dateDeb, this.dateFin);
187
 
18 ilm 188
        this.m.put("CHARGES3.8", GestionDevise.currencyToString(v234, false));
189
 
190
        // 208
191
        this.m.put("CHARGES4.8", "");
192
 
193
        /*******************************************************************************************
194
         * VARIATION DE STOCK
195
         ******************************************************************************************/
196
        // 236 SommeSolde( 6037, 6039* )
197
        long v236 = this.sommeCompte.soldeCompte(6037, 6037, true, this.dateDeb, this.dateFin);
198
        this.m.put("CHARGES3.9", GestionDevise.currencyToString(v236, false));
199
 
200
        // 211
201
        this.m.put("CHARGES4.9", "");
202
 
203
        /*******************************************************************************************
204
         * ACHATS DE MATIERE PREMIERE
205
         ******************************************************************************************/
206
        // 238 SommeSolde( 600, 602* )+SommeSolde( 6090, 6092* )
207
        // S238=601+602+6091+6092
94 ilm 208
        // FIX Abaque ajout 609
209
        long v238 = this.sommeCompte.soldeCompte(601, 602, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(609, 609, true, this.dateDeb, this.dateFin)
180 ilm 210
                - this.sommeCompte.soldeCompte(6093, 6099, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6081, 6083, true, this.dateDeb, this.dateFin);
18 ilm 211
        this.m.put("CHARGES3.10", GestionDevise.currencyToString(v238, false));
212
 
213
        // 212
214
        this.m.put("CHARGES4.10", "");
215
 
216
        SwingUtilities.invokeLater(new Runnable() {
217
            public void run() {
218
                Map2033B.this.bar.setValue(40);
219
            }
220
        });
221
        /*******************************************************************************************
222
         * VARIATION DE STOCK
223
         ******************************************************************************************/
224
        // 240 SommeSolde( 6030, 6036* )
174 ilm 225
        long v240 = this.sommeCompte.soldeCompte(6031, 6036, true, this.dateDeb, this.dateFin);
18 ilm 226
        this.m.put("CHARGES3.11", GestionDevise.currencyToString(v240, false));
227
 
228
        // 213
229
        this.m.put("CHARGES4.11", "");
230
 
231
        /*******************************************************************************************
232
         * AUTRES CHARGES EXTERNES
233
         ******************************************************************************************/
234
 
235
        // S242M=6122
236
        this.m.put("CBAIL_MO12", GestionDevise.currencyToString(this.sommeCompte.sommeCompteFils("6122", this.dateDeb, this.dateFin), false));
237
 
238
        // S242I=6125
239
        this.m.put("CBAIL_IMMO12", GestionDevise.currencyToString(this.sommeCompte.sommeCompteFils("6125", this.dateDeb, this.dateFin), false));
240
 
241
        // 242 SommeSolde( 604, 606* )+SommeSolde( 6093, 6096* )+SommeSolde( 6098, 6099*
242
        // )+SommeSolde( 61, 62* )
243
        // S242=604...606+6094...6096+6098+611+6122+6125+613...619+621...629
244
        long v242 = this.sommeCompte.soldeCompte(604, 606, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6084, 6086, true, this.dateDeb, this.dateFin)
245
                + this.sommeCompte.soldeCompte(6094, 6096, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(61, 62, true, this.dateDeb, this.dateFin);
246
        this.m.put("CHARGES3.12", GestionDevise.currencyToString(v242, false));
247
 
248
        // 216
249
        this.m.put("CHARGES4.12", "");
250
 
251
        /*******************************************************************************************
252
         * IMPOTS, TAXES
253
         ******************************************************************************************/
254
        // 243
255
        this.m.put("CHARGES1.13", "");
256
 
257
        // 244 SommeSolde( 63, 63* )
258
        long v244 = this.sommeCompte.soldeCompte(63, 63, true, this.dateDeb, this.dateFin);
259
        this.m.put("CHARGES2.13", GestionDevise.currencyToString(v244, false));
260
 
261
        // 219
262
        this.m.put("CHARGES3.13", "");
263
 
264
        SwingUtilities.invokeLater(new Runnable() {
265
            public void run() {
266
                Map2033B.this.bar.setValue(50);
267
            }
268
        });
269
        /*******************************************************************************************
270
         * REMUNERATION Du PERSONNEL
271
         ******************************************************************************************/
272
        // 250 SommeSolde( 640, 644* )+SommeSolde( 648, 649* )
132 ilm 273
        long v250 = this.sommeCompte.soldeCompte(644, 644, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(648, 649, true, this.dateDeb, this.dateFin)
177 ilm 274
                + this.sommeCompte.soldeCompte(641, 641, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(642, 642, true, this.dateDeb, this.dateFin);
18 ilm 275
        this.m.put("CHARGES3.14", GestionDevise.currencyToString(v250, false));
276
 
277
        // 220
278
        this.m.put("CHARGES4.14", "");
279
 
280
        /*******************************************************************************************
281
         * CHARGES SOCIALES
282
         ******************************************************************************************/
283
        // 252 SommeSolde( 645, 647* )
94 ilm 284
        long v252 = this.sommeCompte.soldeCompte(645, 647, true, this.dateDeb, this.dateFin);
18 ilm 285
        this.m.put("CHARGES3.15", GestionDevise.currencyToString(v252, false));
286
 
287
        // 221
288
        this.m.put("CHARGES4.15", "");
289
 
290
        /*******************************************************************************************
291
         * DOTATIONS AUX AMMORTISSEMENTS
292
         ******************************************************************************************/
293
        // 254 SommeSolde( 6800, 6814* )
294
        long v254 = this.sommeCompte.soldeCompte(6811, 6812, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6816, 6817, true, this.dateDeb, this.dateFin);
295
        this.m.put("CHARGES3.16", GestionDevise.currencyToString(v254, false));
296
 
297
        // 221
298
        this.m.put("CHARGES4.16", "");
299
 
300
        SwingUtilities.invokeLater(new Runnable() {
301
            public void run() {
302
                Map2033B.this.bar.setValue(60);
303
            }
304
        });
305
        /*******************************************************************************************
306
         * DOTATIONS AUX PROVISIONS
307
         ******************************************************************************************/
308
        // 256 SommeSolde( 6815, 6859* )
309
        long v256 = this.sommeCompte.soldeCompte(6815, 6815, true, this.dateDeb, this.dateFin);
310
        this.m.put("CHARGES3.17", GestionDevise.currencyToString(v256, false));
311
 
312
        // 222
313
        this.m.put("CHARGES4.17", "");
314
 
315
        /*******************************************************************************************
316
         * AUTRES CHARGES
317
         ******************************************************************************************/
318
        // 259
319
        this.m.put("CHARGES1.18", "");
320
 
321
        // 262 SommeSolde( 65, 65* )
322
        long v262 = this.sommeCompte.soldeCompte(65, 65, true, this.dateDeb, this.dateFin);
323
        this.m.put("CHARGES2.18", GestionDevise.currencyToString(v262, false));
324
 
325
        // 228
326
        this.m.put("CHARGES3.18", "");
327
 
328
        SwingUtilities.invokeLater(new Runnable() {
329
            public void run() {
330
                Map2033B.this.bar.setValue(70);
331
            }
332
        });
333
 
334
        /*******************************************************************************************
335
         * TOTAL II
336
         ******************************************************************************************/
337
        // 264 v234+v236+v238+v240+v242+v244+v250+v252+v254+v256+v262
338
        long v264 = v234 + v236 + v238 + v240 + v242 + v244 + v250 + v252 + v254 + v256 + v262;
339
        this.m.put("PCHARGES3.19", GestionDevise.currencyToString(v264, false));
340
 
341
        // 231
342
        this.m.put("PCHARGES4.19", "");
343
 
344
        /*******************************************************************************************
345
         * RESULTAT D'EXPLOTATION
346
         ******************************************************************************************/
347
        // 270 v232-v264
348
        long v270 = v232 - v264;
349
        this.m.put("PCHARGES3.20", GestionDevise.currencyToString(v270, false));
350
 
351
        // 235
352
        this.m.put("PCHARGES4.20", "");
353
 
354
        /*******************************************************************************************
355
         * PRODUITS ET CHARGES DIVERS
356
         ******************************************************************************************/
357
 
358
        /*******************************************************************************************
359
         * PRODUITS FINANCIERS
360
         ******************************************************************************************/
361
        // 280 -SommeSolde( 760, 769* )-SommeSolde( 786, 786* )-SommeSolde( 796, 796* )
174 ilm 362
        long v280 = -this.sommeCompte.soldeCompte(760, 768, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(786, 786, true, this.dateDeb, this.dateFin)
18 ilm 363
                - this.sommeCompte.soldeCompte(796, 796, true, this.dateDeb, this.dateFin);
364
        this.m.put("PCHARGES3.21", GestionDevise.currencyToString(v280, false));
365
 
366
        // 237
367
        this.m.put("PCHARGES4.21", "");
368
 
369
        SwingUtilities.invokeLater(new Runnable() {
370
            public void run() {
371
                Map2033B.this.bar.setValue(80);
372
            }
373
        });
374
 
375
        /*******************************************************************************************
376
         * PRODUITS EXCEPTIONNELS
377
         ******************************************************************************************/
378
        // 290 -SommeSolde( 77, 77* )-SommeSolde( 787, 789* )-SommeSolde( 797, 799* )
177 ilm 379
        long v290 = -this.sommeCompte.soldeCompte(77, 77, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(787, 787, true, this.dateDeb, this.dateFin)
380
                - this.sommeCompte.soldeCompte(797, 797, true, this.dateDeb, this.dateFin);
18 ilm 381
        this.m.put("PCHARGES3.22", GestionDevise.currencyToString(v290, false));
382
 
383
        // 245
384
        this.m.put("PCHARGES4.22", "");
385
 
386
        /*******************************************************************************************
387
         * CHARGES FINANCIERES
388
         ******************************************************************************************/
389
        // 294 SommeSolde( 66, 66* )+SommeSolde( 686, 686* )
390
        long v294 = this.sommeCompte.soldeCompte(661, 661, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(686, 686, true, this.dateDeb, this.dateFin)
391
                + this.sommeCompte.soldeCompte(664, 668, true, this.dateDeb, this.dateFin);
392
        this.m.put("PCHARGES3.23", GestionDevise.currencyToString(v294, false));
393
 
394
        // 246
395
        this.m.put("PCHARGES4.23", "");
396
 
397
        /*******************************************************************************************
398
         * CHARGES EXCEPTIONNELLES
399
         ******************************************************************************************/
400
        // 300 SommeSolde( 67, 67* )+SommeSolde( 687, 689* )
401
        long v300 = this.sommeCompte.soldeCompte(67, 67, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(687, 687, true, this.dateDeb, this.dateFin);
402
        this.m.put("PCHARGES3.24", GestionDevise.currencyToString(v300, false));
403
 
404
        // 247
405
        this.m.put("PCHARGES4.24", "");
406
 
407
        SwingUtilities.invokeLater(new Runnable() {
408
            public void run() {
409
                Map2033B.this.bar.setValue(90);
410
            }
411
        });
412
        /*******************************************************************************************
413
         * IMPOTS SUR LES BENEFICES
414
         ******************************************************************************************/
415
        // 306 SommeSolde( 69, 69* )
416
        long v306 = this.sommeCompte.soldeCompte(697, 699, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(695, 695, true, this.dateDeb, this.dateFin)
417
                + this.sommeCompte.soldeCompte(689, 689, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(789, 789, true, this.dateDeb, this.dateFin);
418
        this.m.put("PCHARGES3.25", GestionDevise.currencyToString(v306, false));
419
 
420
        // 257
421
        this.m.put("PCHARGES4.25", "");
422
 
423
        /*******************************************************************************************
424
         * BENEFICE OU PERTE
425
         ******************************************************************************************/
426
        // 310 v232+v280+v290-v264-v294-v300-v306
427
        long v310 = v232 + v280 + v290 - v264 - v294 - v300 - v306;
428
        this.m.put("PCHARGES3.26", GestionDevise.currencyToString(v310, false));
429
 
430
        // 267
431
        this.m.put("PCHARGES4.26", "");
432
 
433
        /*******************************************************************************************
434
         * RESULTAT FISCAL
435
         ******************************************************************************************/
436
        // 312
437
        // 374 SommeSoldeDebit( 4457, 4457* )
149 ilm 438
        // TODO répartir les comptes débiteurs
439
        long v374 = this.sommeCompte.soldeCompteCrediteur(4457, 4457, true, this.dateDeb, this.dateFin);
18 ilm 440
        this.m.put("T1.41", GestionDevise.currencyToString(v374, false));
441
 
442
        // 378 SommeSoldeCredit( 44566 )
149 ilm 443
        long v378 = this.sommeCompte.soldeCompteDebiteur(44566, 44566, true, this.dateDeb, this.dateFin);
18 ilm 444
        this.m.put("T1.42", GestionDevise.currencyToString(v378, false));
445
 
446
        SwingUtilities.invokeLater(new Runnable() {
447
            public void run() {
448
                Map2033B.this.bar.setValue(95);
449
            }
450
        });
451
        /*******************************************************************************************
452
         * VALEURS NON CONNUES
453
         ******************************************************************************************/
454
        this.m.put("PCHARGES3.27", "");
455
        this.m.put("PCHARGES4.27", "");
456
 
457
        this.m.put("REINT3.28", "");
458
        this.m.put("REINT3.29", "");
459
        this.m.put("REINT3.30", "");
460
        this.m.put("REINT3.31", "");
461
        this.m.put("REINT1.32", "");
462
        this.m.put("REINT2.32", "");
463
        this.m.put("REINT3.32", "");
464
 
465
        this.m.put("DEDUC1.33", "");
466
        this.m.put("DEDUC2.33", "");
467
        this.m.put("DEDUC3.33", "");
468
        this.m.put("DEDUC1.34", "");
469
        this.m.put("DEDUC2.34", "");
470
        this.m.put("DEDUC3.34", "");
471
        this.m.put("DEDUC4.34", "");
472
 
473
        this.m.put("DEDUC2.35", "");
474
        this.m.put("DEDUC3.35", "");
475
        this.m.put("DEDUC4.35", "");
476
 
477
        this.m.put("RES3.36", "");
478
        this.m.put("RES4.36", "");
479
 
480
        this.m.put("DEF3.37", "");
481
        this.m.put("DEF4.38", "");
482
        this.m.put("RES3.39", "");
483
        this.m.put("RES4.39", "");
484
 
485
        this.m.put("COT1.40", "");
486
        this.m.put("COT2.40", "");
487
        this.m.put("COT3.40", "");
488
 
489
        this.m.put("T2.41", "");
490
        this.m.put("T3.41", "");
491
        this.m.put("T4.41", "");
492
        this.m.put("T2.42", "");
493
 
177 ilm 494
        final SQLField field = ComptaPropsConfiguration.getInstanceCompta().getRootSociete().getTable("COMPTE_PCE").getField("NUMERO");
495
        Where where = new Where(field, "LIKE", "6%");
496
        where = where.or(new Where(field, "LIKE", "7%"));
497
        List<String> unused = this.sommeCompte.getNonUsedCompte(where, this.dateDeb, this.dateFin);
498
        if (unused != null && !unused.isEmpty()) {
499
            JOptionPane.showMessageDialog(null, "Certains comptes n'ont pas été intégré : " + unused);
500
        }
501
 
132 ilm 502
        // final SQLField field =
503
        // ComptaPropsConfiguration.getInstanceCompta().getRootSociete().getTable("COMPTE_PCE").getField("NUMERO");
504
        // Where where = new Where(field, "LIKE", "6%");
505
        // where = where.or(new Where(field, "LIKE", "7%"));
506
        // this.sommeCompte.getNonUsedCompte(where, this.dateDeb, this.dateFin);
18 ilm 507
        p.generateFrom(this.m);
508
 
509
        SwingUtilities.invokeLater(new Runnable() {
510
            public void run() {
156 ilm 511
                Gestion.openPDF(p.getGeneratedFile());
18 ilm 512
                Map2033B.this.bar.setValue(100);
513
            }
514
        });
515
    }
516
 
517
    public Map2033B(JProgressBar bar, Date dateDeb, Date dateFin) {
518
        this(bar, dateDeb, dateFin, null);
519
    }
520
 
521
    public Map2033B(JProgressBar bar, Date dateDeb, Date dateFin, SQLRow rowPosteAnalytique) {
522
        this.bar = bar;
523
 
524
        if (dateDeb == null && dateFin == null) {
525
            SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
526
            SQLRow rowExercice = Configuration.getInstance().getBase().getTable("EXERCICE_COMMON").getRow(rowSociete.getInt("ID_EXERCICE_COMMON"));
527
            dateFin = (Date) rowExercice.getObject("DATE_FIN");
528
            dateDeb = (Date) rowExercice.getObject("DATE_DEB");
529
        }
530
 
531
        this.dateDeb = dateDeb;
532
        this.dateFin = dateFin;
533
        this.sommeCompte = new SommeCompte(rowPosteAnalytique);
534
    }
535
 
536
    public Map2033B(JProgressBar b) {
537
        this(b, null, null);
538
    }
539
 
540
    public void generateMap() {
541
        this.start();
542
    }
543
 
544
}