OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 180 | 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
 *
182 ilm 4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
18 ilm 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
 
182 ilm 25
import java.io.File;
18 ilm 26
import java.text.DateFormat;
27
import java.text.SimpleDateFormat;
28
import java.util.Date;
29
import java.util.HashMap;
177 ilm 30
import java.util.List;
18 ilm 31
import java.util.Map;
32
 
177 ilm 33
import javax.swing.JOptionPane;
18 ilm 34
import javax.swing.JProgressBar;
35
import javax.swing.SwingUtilities;
36
 
37
public class Map2033B extends Thread {
38
    private Map<String, String> m;
142 ilm 39
    private final DateFormat format = new SimpleDateFormat("ddMMyyyy");
18 ilm 40
    private JProgressBar bar;
41
    private Date dateDeb, dateFin;
42
    SommeCompte sommeCompte;
43
 
44
    public void run() {
45
 
46
        final PdfGenerator_2033B p = new PdfGenerator_2033B();
47
 
48
        this.m = new HashMap<String, String>();
49
 
50
        SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
51
        this.m.put("NOM", rowSociete.getString("TYPE") + " " + rowSociete.getString("NOM"));
52
 
53
        // SQLRow rowExercice =
54
        // Configuration.getInstance().getBase().getTable("EXERCICE_COMMON").getRow(rowSociete.getInt("ID_EXERCICE_COMMON"));
55
        // Date dateFin = (Date) rowExercice.getObject("DATE_FIN");
56
        // Date dateDeb = (Date) rowExercice.getObject("DATE_DEB");
57
        this.m.put("CLOS1", format.format(this.dateFin));
58
        this.m.put("CLOS2", "");
59
 
60
        /*******************************************************************************************
61
         * A - RESULTAT COMPTABLE
62
         ******************************************************************************************/
63
 
64
        /*******************************************************************************************
65
         * PRODUITS D'EXPLOITATION
66
         ******************************************************************************************/
67
 
68
        /*******************************************************************************************
69
         * VENTES DE MARCHANDISES
70
         ******************************************************************************************/
71
        // 209
72
        long v209 = 0;
73
        this.m.put("PRODUIT1.0", GestionDevise.currencyToString(v209, false));
74
 
75
        // 210 -SommeSolde( 707, 707* )-SommeSolde( 7097, 7097* )
76
        long v210 = -this.sommeCompte.soldeCompte(707, 707, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(7097, 7097, true, this.dateDeb, this.dateFin);
77
        this.m.put("PRODUIT2.0", GestionDevise.currencyToString(v210, false));
78
 
79
        // 200
80
        this.m.put("PRODUIT3.0", "");
81
 
82
        /*******************************************************************************************
83
         * PRODUCTION VENDUE ---> BIEN
84
         ******************************************************************************************/
85
        // 215
86
        long v215 = 0;
87
        this.m.put("PRODUIT1.1", GestionDevise.currencyToString(v215, false));
88
 
89
        // 214 -SommeSolde( 700, 705* )-SommeSolde( 7090, 7095* )
177 ilm 90
        long v214 = -this.sommeCompte.soldeCompte(700, 705, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte("709", this.dateDeb, this.dateFin)
91
                - this.sommeCompte.soldeCompte(7090, 7095, true, this.dateDeb, this.dateFin);
92
 
18 ilm 93
        this.m.put("PRODUIT2.1", GestionDevise.currencyToString(v214, false));
94
 
95
        // 201
96
        this.m.put("PRODUIT3.1", "");
97
 
98
        /*******************************************************************************************
99
         * PRODUCTION VENDUE ---> SERVICES
100
         ******************************************************************************************/
101
        // 217
102
        long v217 = 0;
103
        this.m.put("PRODUIT1.2", GestionDevise.currencyToString(v217, false));
104
 
105
        // 218 -SommeSolde( 706, 706* )-SommeSolde( 708, 708* )-SommeSolde( 7096, 7096*
106
        // )-SommeSolde( 7098, 7099* )
107
        long v218 = -this.sommeCompte.soldeCompte(706, 706, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(708, 708, true, this.dateDeb, this.dateFin)
108
                - this.sommeCompte.soldeCompte(7096, 7096, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(7098, 7099, true, this.dateDeb, this.dateFin);
109
        this.m.put("PRODUIT2.2", GestionDevise.currencyToString(v218, false));
110
 
111
        // 202
112
        this.m.put("PRODUIT3.2", "");
113
 
114
        SwingUtilities.invokeLater(new Runnable() {
115
            public void run() {
116
 
117
                Map2033B.this.bar.setValue(10);
118
            }
119
        });
120
 
121
        /*******************************************************************************************
122
         * PRODUCTION STOCKEE
123
         ******************************************************************************************/
124
        // 222 -SommeSolde( 710, 719* )
125
        long v222 = -this.sommeCompte.soldeCompte(713, 713, true, this.dateDeb, this.dateFin);
126
        this.m.put("PRODUIT2.3", GestionDevise.currencyToString(v222, false));
127
 
128
        // 203
129
        this.m.put("PRODUIT3.3", "");
130
 
131
        /*******************************************************************************************
132
         * PRODUCTION IMMOBILISEE
133
         ******************************************************************************************/
134
        // 224 -SommeSolde( 72, 72* )
135
        long v224 = -this.sommeCompte.soldeCompte(72, 73, true, this.dateDeb, this.dateFin);
136
        this.m.put("PRODUIT2.4", GestionDevise.currencyToString(v224, false));
137
 
138
        // 204
139
        this.m.put("PRODUIT3.4", "");
140
 
141
        /*******************************************************************************************
142
         * SUBVENTION D'EXPLOITATION
143
         ******************************************************************************************/
144
        // 226 -SommeSolde( 74, 74* )
145
        long v226 = -this.sommeCompte.soldeCompte(74, 74, true, this.dateDeb, this.dateFin);
146
        this.m.put("PRODUIT2.5", GestionDevise.currencyToString(v226, false));
147
 
148
        // 205
149
        this.m.put("PRODUIT3.5", "");
150
 
151
        /*******************************************************************************************
152
         * AUTRES PRODUITS
153
         ******************************************************************************************/
154
        // 230 -SommeSolde( 73, 73* )-SommeSolde( 75, 75* )-SommeSolde( 780, 785* )-SommeSolde( 790,
155
        // 795* )
156
        long v230 = -this.sommeCompte.soldeCompte(75, 75, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(780, 785, true, this.dateDeb, this.dateFin)
157
                - this.sommeCompte.soldeCompte(790, 795, true, this.dateDeb, this.dateFin);
158
        this.m.put("PRODUIT2.6", GestionDevise.currencyToString(v230, false));
159
 
160
        // 206
161
        this.m.put("PRODUIT3.6", "");
162
 
163
        SwingUtilities.invokeLater(new Runnable() {
164
            public void run() {
165
                Map2033B.this.bar.setValue(20);
166
            }
167
        });
168
        /*******************************************************************************************
169
         * TOTAL I
170
         ******************************************************************************************/
171
        // 232 v210+v214+v218+v222+v224+v226+v230
172
        long v232 = v210 + v214 + v218 + v222 + v224 + v226 + v230;
173
        this.m.put("PRODUIT2.7", GestionDevise.currencyToString(v232, false));
174
 
175
        // 207
176
        this.m.put("PRODUIT3.7", "");
177
 
178
        /*******************************************************************************************
179
         * CHARGES D'EXPLOITATION
180
         ******************************************************************************************/
181
 
182
        /*******************************************************************************************
183
         * ACHATS DE MARCHANDISES
184
         ******************************************************************************************/
185
        // 234 SommeSolde( 607, 608* )+SommeSolde( 6097, 6097* )
186
        long v234 = this.sommeCompte.soldeCompte(607, 607, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6097, 6097, true, this.dateDeb, this.dateFin)
180 ilm 187
                + this.sommeCompte.soldeCompte(608, 608, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(6081, 6086, true, this.dateDeb, this.dateFin);
188
 
18 ilm 189
        this.m.put("CHARGES3.8", GestionDevise.currencyToString(v234, false));
190
 
191
        // 208
192
        this.m.put("CHARGES4.8", "");
193
 
194
        /*******************************************************************************************
195
         * VARIATION DE STOCK
196
         ******************************************************************************************/
197
        // 236 SommeSolde( 6037, 6039* )
198
        long v236 = this.sommeCompte.soldeCompte(6037, 6037, true, this.dateDeb, this.dateFin);
199
        this.m.put("CHARGES3.9", GestionDevise.currencyToString(v236, false));
200
 
201
        // 211
202
        this.m.put("CHARGES4.9", "");
203
 
204
        /*******************************************************************************************
205
         * ACHATS DE MATIERE PREMIERE
206
         ******************************************************************************************/
207
        // 238 SommeSolde( 600, 602* )+SommeSolde( 6090, 6092* )
208
        // S238=601+602+6091+6092
94 ilm 209
        // FIX Abaque ajout 609
210
        long v238 = this.sommeCompte.soldeCompte(601, 602, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(609, 609, true, this.dateDeb, this.dateFin)
180 ilm 211
                - this.sommeCompte.soldeCompte(6093, 6099, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6081, 6083, true, this.dateDeb, this.dateFin);
18 ilm 212
        this.m.put("CHARGES3.10", GestionDevise.currencyToString(v238, false));
213
 
214
        // 212
215
        this.m.put("CHARGES4.10", "");
216
 
217
        SwingUtilities.invokeLater(new Runnable() {
218
            public void run() {
219
                Map2033B.this.bar.setValue(40);
220
            }
221
        });
222
        /*******************************************************************************************
223
         * VARIATION DE STOCK
224
         ******************************************************************************************/
225
        // 240 SommeSolde( 6030, 6036* )
174 ilm 226
        long v240 = this.sommeCompte.soldeCompte(6031, 6036, true, this.dateDeb, this.dateFin);
18 ilm 227
        this.m.put("CHARGES3.11", GestionDevise.currencyToString(v240, false));
228
 
229
        // 213
230
        this.m.put("CHARGES4.11", "");
231
 
232
        /*******************************************************************************************
233
         * AUTRES CHARGES EXTERNES
234
         ******************************************************************************************/
235
 
236
        // S242M=6122
237
        this.m.put("CBAIL_MO12", GestionDevise.currencyToString(this.sommeCompte.sommeCompteFils("6122", this.dateDeb, this.dateFin), false));
238
 
239
        // S242I=6125
240
        this.m.put("CBAIL_IMMO12", GestionDevise.currencyToString(this.sommeCompte.sommeCompteFils("6125", this.dateDeb, this.dateFin), false));
241
 
242
        // 242 SommeSolde( 604, 606* )+SommeSolde( 6093, 6096* )+SommeSolde( 6098, 6099*
243
        // )+SommeSolde( 61, 62* )
244
        // S242=604...606+6094...6096+6098+611+6122+6125+613...619+621...629
245
        long v242 = this.sommeCompte.soldeCompte(604, 606, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6084, 6086, true, this.dateDeb, this.dateFin)
246
                + this.sommeCompte.soldeCompte(6094, 6096, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(61, 62, true, this.dateDeb, this.dateFin);
247
        this.m.put("CHARGES3.12", GestionDevise.currencyToString(v242, false));
248
 
249
        // 216
250
        this.m.put("CHARGES4.12", "");
251
 
252
        /*******************************************************************************************
253
         * IMPOTS, TAXES
254
         ******************************************************************************************/
255
        // 243
256
        this.m.put("CHARGES1.13", "");
257
 
258
        // 244 SommeSolde( 63, 63* )
259
        long v244 = this.sommeCompte.soldeCompte(63, 63, true, this.dateDeb, this.dateFin);
260
        this.m.put("CHARGES2.13", GestionDevise.currencyToString(v244, false));
261
 
262
        // 219
263
        this.m.put("CHARGES3.13", "");
264
 
265
        SwingUtilities.invokeLater(new Runnable() {
266
            public void run() {
267
                Map2033B.this.bar.setValue(50);
268
            }
269
        });
270
        /*******************************************************************************************
271
         * REMUNERATION Du PERSONNEL
272
         ******************************************************************************************/
273
        // 250 SommeSolde( 640, 644* )+SommeSolde( 648, 649* )
132 ilm 274
        long v250 = this.sommeCompte.soldeCompte(644, 644, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(648, 649, true, this.dateDeb, this.dateFin)
177 ilm 275
                + this.sommeCompte.soldeCompte(641, 641, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(642, 642, true, this.dateDeb, this.dateFin);
18 ilm 276
        this.m.put("CHARGES3.14", GestionDevise.currencyToString(v250, false));
277
 
278
        // 220
279
        this.m.put("CHARGES4.14", "");
280
 
281
        /*******************************************************************************************
282
         * CHARGES SOCIALES
283
         ******************************************************************************************/
284
        // 252 SommeSolde( 645, 647* )
94 ilm 285
        long v252 = this.sommeCompte.soldeCompte(645, 647, true, this.dateDeb, this.dateFin);
18 ilm 286
        this.m.put("CHARGES3.15", GestionDevise.currencyToString(v252, false));
287
 
288
        // 221
289
        this.m.put("CHARGES4.15", "");
290
 
291
        /*******************************************************************************************
292
         * DOTATIONS AUX AMMORTISSEMENTS
293
         ******************************************************************************************/
294
        // 254 SommeSolde( 6800, 6814* )
295
        long v254 = this.sommeCompte.soldeCompte(6811, 6812, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6816, 6817, true, this.dateDeb, this.dateFin);
296
        this.m.put("CHARGES3.16", GestionDevise.currencyToString(v254, false));
297
 
298
        // 221
299
        this.m.put("CHARGES4.16", "");
300
 
301
        SwingUtilities.invokeLater(new Runnable() {
302
            public void run() {
303
                Map2033B.this.bar.setValue(60);
304
            }
305
        });
306
        /*******************************************************************************************
307
         * DOTATIONS AUX PROVISIONS
308
         ******************************************************************************************/
309
        // 256 SommeSolde( 6815, 6859* )
310
        long v256 = this.sommeCompte.soldeCompte(6815, 6815, true, this.dateDeb, this.dateFin);
311
        this.m.put("CHARGES3.17", GestionDevise.currencyToString(v256, false));
312
 
313
        // 222
314
        this.m.put("CHARGES4.17", "");
315
 
316
        /*******************************************************************************************
317
         * AUTRES CHARGES
318
         ******************************************************************************************/
319
        // 259
320
        this.m.put("CHARGES1.18", "");
321
 
322
        // 262 SommeSolde( 65, 65* )
323
        long v262 = this.sommeCompte.soldeCompte(65, 65, true, this.dateDeb, this.dateFin);
324
        this.m.put("CHARGES2.18", GestionDevise.currencyToString(v262, false));
325
 
326
        // 228
327
        this.m.put("CHARGES3.18", "");
328
 
329
        SwingUtilities.invokeLater(new Runnable() {
330
            public void run() {
331
                Map2033B.this.bar.setValue(70);
332
            }
333
        });
334
 
335
        /*******************************************************************************************
336
         * TOTAL II
337
         ******************************************************************************************/
338
        // 264 v234+v236+v238+v240+v242+v244+v250+v252+v254+v256+v262
339
        long v264 = v234 + v236 + v238 + v240 + v242 + v244 + v250 + v252 + v254 + v256 + v262;
340
        this.m.put("PCHARGES3.19", GestionDevise.currencyToString(v264, false));
341
 
342
        // 231
343
        this.m.put("PCHARGES4.19", "");
344
 
345
        /*******************************************************************************************
346
         * RESULTAT D'EXPLOTATION
347
         ******************************************************************************************/
348
        // 270 v232-v264
349
        long v270 = v232 - v264;
350
        this.m.put("PCHARGES3.20", GestionDevise.currencyToString(v270, false));
351
 
352
        // 235
353
        this.m.put("PCHARGES4.20", "");
354
 
355
        /*******************************************************************************************
356
         * PRODUITS ET CHARGES DIVERS
357
         ******************************************************************************************/
358
 
359
        /*******************************************************************************************
360
         * PRODUITS FINANCIERS
361
         ******************************************************************************************/
362
        // 280 -SommeSolde( 760, 769* )-SommeSolde( 786, 786* )-SommeSolde( 796, 796* )
174 ilm 363
        long v280 = -this.sommeCompte.soldeCompte(760, 768, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(786, 786, true, this.dateDeb, this.dateFin)
18 ilm 364
                - this.sommeCompte.soldeCompte(796, 796, true, this.dateDeb, this.dateFin);
365
        this.m.put("PCHARGES3.21", GestionDevise.currencyToString(v280, false));
366
 
367
        // 237
368
        this.m.put("PCHARGES4.21", "");
369
 
370
        SwingUtilities.invokeLater(new Runnable() {
371
            public void run() {
372
                Map2033B.this.bar.setValue(80);
373
            }
374
        });
375
 
376
        /*******************************************************************************************
377
         * PRODUITS EXCEPTIONNELS
378
         ******************************************************************************************/
379
        // 290 -SommeSolde( 77, 77* )-SommeSolde( 787, 789* )-SommeSolde( 797, 799* )
177 ilm 380
        long v290 = -this.sommeCompte.soldeCompte(77, 77, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(787, 787, true, this.dateDeb, this.dateFin)
381
                - this.sommeCompte.soldeCompte(797, 797, true, this.dateDeb, this.dateFin);
18 ilm 382
        this.m.put("PCHARGES3.22", GestionDevise.currencyToString(v290, false));
383
 
384
        // 245
385
        this.m.put("PCHARGES4.22", "");
386
 
387
        /*******************************************************************************************
388
         * CHARGES FINANCIERES
389
         ******************************************************************************************/
390
        // 294 SommeSolde( 66, 66* )+SommeSolde( 686, 686* )
182 ilm 391
        long v294 = this.sommeCompte.soldeCompte(660, 669, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(686, 686, true, this.dateDeb, this.dateFin);
18 ilm 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 )
182 ilm 443
        long v378 = this.sommeCompte.soldeCompteDebiteur(4456, 4456, 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() {
182 ilm 511
                final File generatedFile = p.getGeneratedFile();
512
                if (generatedFile != null) {
513
                    Gestion.openPDF(generatedFile);
514
                } else {
515
                    Map2033B.this.bar.setValue(100);
516
                }
18 ilm 517
            }
518
        });
519
    }
520
 
521
    public Map2033B(JProgressBar bar, Date dateDeb, Date dateFin) {
522
        this(bar, dateDeb, dateFin, null);
523
    }
524
 
525
    public Map2033B(JProgressBar bar, Date dateDeb, Date dateFin, SQLRow rowPosteAnalytique) {
526
        this.bar = bar;
527
 
528
        if (dateDeb == null && dateFin == null) {
529
            SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
530
            SQLRow rowExercice = Configuration.getInstance().getBase().getTable("EXERCICE_COMMON").getRow(rowSociete.getInt("ID_EXERCICE_COMMON"));
531
            dateFin = (Date) rowExercice.getObject("DATE_FIN");
532
            dateDeb = (Date) rowExercice.getObject("DATE_DEB");
533
        }
534
 
535
        this.dateDeb = dateDeb;
536
        this.dateFin = dateFin;
537
        this.sommeCompte = new SommeCompte(rowPosteAnalytique);
538
    }
539
 
540
    public Map2033B(JProgressBar b) {
541
        this(b, null, null);
542
    }
543
 
544
    public void generateMap() {
545
        this.start();
546
    }
547
 
548
}