OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | 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
 *
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)
186
                + this.sommeCompte.soldeCompte(6087, 6087, true, this.dateDeb, this.dateFin);
187
        this.m.put("CHARGES3.8", GestionDevise.currencyToString(v234, false));
188
 
189
        // 208
190
        this.m.put("CHARGES4.8", "");
191
 
192
        /*******************************************************************************************
193
         * VARIATION DE STOCK
194
         ******************************************************************************************/
195
        // 236 SommeSolde( 6037, 6039* )
196
        long v236 = this.sommeCompte.soldeCompte(6037, 6037, true, this.dateDeb, this.dateFin);
197
        this.m.put("CHARGES3.9", GestionDevise.currencyToString(v236, false));
198
 
199
        // 211
200
        this.m.put("CHARGES4.9", "");
201
 
202
        /*******************************************************************************************
203
         * ACHATS DE MATIERE PREMIERE
204
         ******************************************************************************************/
205
        // 238 SommeSolde( 600, 602* )+SommeSolde( 6090, 6092* )
206
        // S238=601+602+6091+6092
94 ilm 207
        // FIX Abaque ajout 609
208
        long v238 = this.sommeCompte.soldeCompte(601, 602, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(609, 609, true, this.dateDeb, this.dateFin)
209
                - this.sommeCompte.soldeCompte(6093, 6099, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6081, 6082, true, this.dateDeb, this.dateFin);
18 ilm 210
        this.m.put("CHARGES3.10", GestionDevise.currencyToString(v238, false));
211
 
212
        // 212
213
        this.m.put("CHARGES4.10", "");
214
 
215
        SwingUtilities.invokeLater(new Runnable() {
216
            public void run() {
217
                Map2033B.this.bar.setValue(40);
218
            }
219
        });
220
        /*******************************************************************************************
221
         * VARIATION DE STOCK
222
         ******************************************************************************************/
223
        // 240 SommeSolde( 6030, 6036* )
174 ilm 224
        long v240 = this.sommeCompte.soldeCompte(6031, 6036, true, this.dateDeb, this.dateFin);
18 ilm 225
        this.m.put("CHARGES3.11", GestionDevise.currencyToString(v240, false));
226
 
227
        // 213
228
        this.m.put("CHARGES4.11", "");
229
 
230
        /*******************************************************************************************
231
         * AUTRES CHARGES EXTERNES
232
         ******************************************************************************************/
233
 
234
        // S242M=6122
235
        this.m.put("CBAIL_MO12", GestionDevise.currencyToString(this.sommeCompte.sommeCompteFils("6122", this.dateDeb, this.dateFin), false));
236
 
237
        // S242I=6125
238
        this.m.put("CBAIL_IMMO12", GestionDevise.currencyToString(this.sommeCompte.sommeCompteFils("6125", this.dateDeb, this.dateFin), false));
239
 
240
        // 242 SommeSolde( 604, 606* )+SommeSolde( 6093, 6096* )+SommeSolde( 6098, 6099*
241
        // )+SommeSolde( 61, 62* )
242
        // S242=604...606+6094...6096+6098+611+6122+6125+613...619+621...629
243
        long v242 = this.sommeCompte.soldeCompte(604, 606, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6084, 6086, true, this.dateDeb, this.dateFin)
244
                + this.sommeCompte.soldeCompte(6094, 6096, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(61, 62, true, this.dateDeb, this.dateFin);
245
        this.m.put("CHARGES3.12", GestionDevise.currencyToString(v242, false));
246
 
247
        // 216
248
        this.m.put("CHARGES4.12", "");
249
 
250
        /*******************************************************************************************
251
         * IMPOTS, TAXES
252
         ******************************************************************************************/
253
        // 243
254
        this.m.put("CHARGES1.13", "");
255
 
256
        // 244 SommeSolde( 63, 63* )
257
        long v244 = this.sommeCompte.soldeCompte(63, 63, true, this.dateDeb, this.dateFin);
258
        this.m.put("CHARGES2.13", GestionDevise.currencyToString(v244, false));
259
 
260
        // 219
261
        this.m.put("CHARGES3.13", "");
262
 
263
        SwingUtilities.invokeLater(new Runnable() {
264
            public void run() {
265
                Map2033B.this.bar.setValue(50);
266
            }
267
        });
268
        /*******************************************************************************************
269
         * REMUNERATION Du PERSONNEL
270
         ******************************************************************************************/
271
        // 250 SommeSolde( 640, 644* )+SommeSolde( 648, 649* )
132 ilm 272
        long v250 = this.sommeCompte.soldeCompte(644, 644, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(648, 649, true, this.dateDeb, this.dateFin)
177 ilm 273
                + this.sommeCompte.soldeCompte(641, 641, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(642, 642, true, this.dateDeb, this.dateFin);
18 ilm 274
        this.m.put("CHARGES3.14", GestionDevise.currencyToString(v250, false));
275
 
276
        // 220
277
        this.m.put("CHARGES4.14", "");
278
 
279
        /*******************************************************************************************
280
         * CHARGES SOCIALES
281
         ******************************************************************************************/
282
        // 252 SommeSolde( 645, 647* )
94 ilm 283
        long v252 = this.sommeCompte.soldeCompte(645, 647, true, this.dateDeb, this.dateFin);
18 ilm 284
        this.m.put("CHARGES3.15", GestionDevise.currencyToString(v252, false));
285
 
286
        // 221
287
        this.m.put("CHARGES4.15", "");
288
 
289
        /*******************************************************************************************
290
         * DOTATIONS AUX AMMORTISSEMENTS
291
         ******************************************************************************************/
292
        // 254 SommeSolde( 6800, 6814* )
293
        long v254 = this.sommeCompte.soldeCompte(6811, 6812, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(6816, 6817, true, this.dateDeb, this.dateFin);
294
        this.m.put("CHARGES3.16", GestionDevise.currencyToString(v254, false));
295
 
296
        // 221
297
        this.m.put("CHARGES4.16", "");
298
 
299
        SwingUtilities.invokeLater(new Runnable() {
300
            public void run() {
301
                Map2033B.this.bar.setValue(60);
302
            }
303
        });
304
        /*******************************************************************************************
305
         * DOTATIONS AUX PROVISIONS
306
         ******************************************************************************************/
307
        // 256 SommeSolde( 6815, 6859* )
308
        long v256 = this.sommeCompte.soldeCompte(6815, 6815, true, this.dateDeb, this.dateFin);
309
        this.m.put("CHARGES3.17", GestionDevise.currencyToString(v256, false));
310
 
311
        // 222
312
        this.m.put("CHARGES4.17", "");
313
 
314
        /*******************************************************************************************
315
         * AUTRES CHARGES
316
         ******************************************************************************************/
317
        // 259
318
        this.m.put("CHARGES1.18", "");
319
 
320
        // 262 SommeSolde( 65, 65* )
321
        long v262 = this.sommeCompte.soldeCompte(65, 65, true, this.dateDeb, this.dateFin);
322
        this.m.put("CHARGES2.18", GestionDevise.currencyToString(v262, false));
323
 
324
        // 228
325
        this.m.put("CHARGES3.18", "");
326
 
327
        SwingUtilities.invokeLater(new Runnable() {
328
            public void run() {
329
                Map2033B.this.bar.setValue(70);
330
            }
331
        });
332
 
333
        /*******************************************************************************************
334
         * TOTAL II
335
         ******************************************************************************************/
336
        // 264 v234+v236+v238+v240+v242+v244+v250+v252+v254+v256+v262
337
        long v264 = v234 + v236 + v238 + v240 + v242 + v244 + v250 + v252 + v254 + v256 + v262;
338
        this.m.put("PCHARGES3.19", GestionDevise.currencyToString(v264, false));
339
 
340
        // 231
341
        this.m.put("PCHARGES4.19", "");
342
 
343
        /*******************************************************************************************
344
         * RESULTAT D'EXPLOTATION
345
         ******************************************************************************************/
346
        // 270 v232-v264
347
        long v270 = v232 - v264;
348
        this.m.put("PCHARGES3.20", GestionDevise.currencyToString(v270, false));
349
 
350
        // 235
351
        this.m.put("PCHARGES4.20", "");
352
 
353
        /*******************************************************************************************
354
         * PRODUITS ET CHARGES DIVERS
355
         ******************************************************************************************/
356
 
357
        /*******************************************************************************************
358
         * PRODUITS FINANCIERS
359
         ******************************************************************************************/
360
        // 280 -SommeSolde( 760, 769* )-SommeSolde( 786, 786* )-SommeSolde( 796, 796* )
174 ilm 361
        long v280 = -this.sommeCompte.soldeCompte(760, 768, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(786, 786, true, this.dateDeb, this.dateFin)
18 ilm 362
                - this.sommeCompte.soldeCompte(796, 796, true, this.dateDeb, this.dateFin);
363
        this.m.put("PCHARGES3.21", GestionDevise.currencyToString(v280, false));
364
 
365
        // 237
366
        this.m.put("PCHARGES4.21", "");
367
 
368
        SwingUtilities.invokeLater(new Runnable() {
369
            public void run() {
370
                Map2033B.this.bar.setValue(80);
371
            }
372
        });
373
 
374
        /*******************************************************************************************
375
         * PRODUITS EXCEPTIONNELS
376
         ******************************************************************************************/
377
        // 290 -SommeSolde( 77, 77* )-SommeSolde( 787, 789* )-SommeSolde( 797, 799* )
177 ilm 378
        long v290 = -this.sommeCompte.soldeCompte(77, 77, true, this.dateDeb, this.dateFin) - this.sommeCompte.soldeCompte(787, 787, true, this.dateDeb, this.dateFin)
379
                - this.sommeCompte.soldeCompte(797, 797, true, this.dateDeb, this.dateFin);
18 ilm 380
        this.m.put("PCHARGES3.22", GestionDevise.currencyToString(v290, false));
381
 
382
        // 245
383
        this.m.put("PCHARGES4.22", "");
384
 
385
        /*******************************************************************************************
386
         * CHARGES FINANCIERES
387
         ******************************************************************************************/
388
        // 294 SommeSolde( 66, 66* )+SommeSolde( 686, 686* )
389
        long v294 = this.sommeCompte.soldeCompte(661, 661, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(686, 686, true, this.dateDeb, this.dateFin)
390
                + this.sommeCompte.soldeCompte(664, 668, true, this.dateDeb, this.dateFin);
391
        this.m.put("PCHARGES3.23", GestionDevise.currencyToString(v294, false));
392
 
393
        // 246
394
        this.m.put("PCHARGES4.23", "");
395
 
396
        /*******************************************************************************************
397
         * CHARGES EXCEPTIONNELLES
398
         ******************************************************************************************/
399
        // 300 SommeSolde( 67, 67* )+SommeSolde( 687, 689* )
400
        long v300 = this.sommeCompte.soldeCompte(67, 67, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(687, 687, true, this.dateDeb, this.dateFin);
401
        this.m.put("PCHARGES3.24", GestionDevise.currencyToString(v300, false));
402
 
403
        // 247
404
        this.m.put("PCHARGES4.24", "");
405
 
406
        SwingUtilities.invokeLater(new Runnable() {
407
            public void run() {
408
                Map2033B.this.bar.setValue(90);
409
            }
410
        });
411
        /*******************************************************************************************
412
         * IMPOTS SUR LES BENEFICES
413
         ******************************************************************************************/
414
        // 306 SommeSolde( 69, 69* )
415
        long v306 = this.sommeCompte.soldeCompte(697, 699, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(695, 695, true, this.dateDeb, this.dateFin)
416
                + this.sommeCompte.soldeCompte(689, 689, true, this.dateDeb, this.dateFin) + this.sommeCompte.soldeCompte(789, 789, true, this.dateDeb, this.dateFin);
417
        this.m.put("PCHARGES3.25", GestionDevise.currencyToString(v306, false));
418
 
419
        // 257
420
        this.m.put("PCHARGES4.25", "");
421
 
422
        /*******************************************************************************************
423
         * BENEFICE OU PERTE
424
         ******************************************************************************************/
425
        // 310 v232+v280+v290-v264-v294-v300-v306
426
        long v310 = v232 + v280 + v290 - v264 - v294 - v300 - v306;
427
        this.m.put("PCHARGES3.26", GestionDevise.currencyToString(v310, false));
428
 
429
        // 267
430
        this.m.put("PCHARGES4.26", "");
431
 
432
        /*******************************************************************************************
433
         * RESULTAT FISCAL
434
         ******************************************************************************************/
435
        // 312
436
        // 374 SommeSoldeDebit( 4457, 4457* )
149 ilm 437
        // TODO répartir les comptes débiteurs
438
        long v374 = this.sommeCompte.soldeCompteCrediteur(4457, 4457, true, this.dateDeb, this.dateFin);
18 ilm 439
        this.m.put("T1.41", GestionDevise.currencyToString(v374, false));
440
 
441
        // 378 SommeSoldeCredit( 44566 )
149 ilm 442
        long v378 = this.sommeCompte.soldeCompteDebiteur(44566, 44566, true, this.dateDeb, this.dateFin);
18 ilm 443
        this.m.put("T1.42", GestionDevise.currencyToString(v378, false));
444
 
445
        SwingUtilities.invokeLater(new Runnable() {
446
            public void run() {
447
                Map2033B.this.bar.setValue(95);
448
            }
449
        });
450
        /*******************************************************************************************
451
         * VALEURS NON CONNUES
452
         ******************************************************************************************/
453
        this.m.put("PCHARGES3.27", "");
454
        this.m.put("PCHARGES4.27", "");
455
 
456
        this.m.put("REINT3.28", "");
457
        this.m.put("REINT3.29", "");
458
        this.m.put("REINT3.30", "");
459
        this.m.put("REINT3.31", "");
460
        this.m.put("REINT1.32", "");
461
        this.m.put("REINT2.32", "");
462
        this.m.put("REINT3.32", "");
463
 
464
        this.m.put("DEDUC1.33", "");
465
        this.m.put("DEDUC2.33", "");
466
        this.m.put("DEDUC3.33", "");
467
        this.m.put("DEDUC1.34", "");
468
        this.m.put("DEDUC2.34", "");
469
        this.m.put("DEDUC3.34", "");
470
        this.m.put("DEDUC4.34", "");
471
 
472
        this.m.put("DEDUC2.35", "");
473
        this.m.put("DEDUC3.35", "");
474
        this.m.put("DEDUC4.35", "");
475
 
476
        this.m.put("RES3.36", "");
477
        this.m.put("RES4.36", "");
478
 
479
        this.m.put("DEF3.37", "");
480
        this.m.put("DEF4.38", "");
481
        this.m.put("RES3.39", "");
482
        this.m.put("RES4.39", "");
483
 
484
        this.m.put("COT1.40", "");
485
        this.m.put("COT2.40", "");
486
        this.m.put("COT3.40", "");
487
 
488
        this.m.put("T2.41", "");
489
        this.m.put("T3.41", "");
490
        this.m.put("T4.41", "");
491
        this.m.put("T2.42", "");
492
 
177 ilm 493
        final SQLField field = ComptaPropsConfiguration.getInstanceCompta().getRootSociete().getTable("COMPTE_PCE").getField("NUMERO");
494
        Where where = new Where(field, "LIKE", "6%");
495
        where = where.or(new Where(field, "LIKE", "7%"));
496
        List<String> unused = this.sommeCompte.getNonUsedCompte(where, this.dateDeb, this.dateFin);
497
        if (unused != null && !unused.isEmpty()) {
498
            JOptionPane.showMessageDialog(null, "Certains comptes n'ont pas été intégré : " + unused);
499
        }
500
 
132 ilm 501
        // final SQLField field =
502
        // ComptaPropsConfiguration.getInstanceCompta().getRootSociete().getTable("COMPTE_PCE").getField("NUMERO");
503
        // Where where = new Where(field, "LIKE", "6%");
504
        // where = where.or(new Where(field, "LIKE", "7%"));
505
        // this.sommeCompte.getNonUsedCompte(where, this.dateDeb, this.dateFin);
18 ilm 506
        p.generateFrom(this.m);
507
 
508
        SwingUtilities.invokeLater(new Runnable() {
509
            public void run() {
156 ilm 510
                Gestion.openPDF(p.getGeneratedFile());
18 ilm 511
                Map2033B.this.bar.setValue(100);
512
            }
513
        });
514
    }
515
 
516
    public Map2033B(JProgressBar bar, Date dateDeb, Date dateFin) {
517
        this(bar, dateDeb, dateFin, null);
518
    }
519
 
520
    public Map2033B(JProgressBar bar, Date dateDeb, Date dateFin, SQLRow rowPosteAnalytique) {
521
        this.bar = bar;
522
 
523
        if (dateDeb == null && dateFin == null) {
524
            SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
525
            SQLRow rowExercice = Configuration.getInstance().getBase().getTable("EXERCICE_COMMON").getRow(rowSociete.getInt("ID_EXERCICE_COMMON"));
526
            dateFin = (Date) rowExercice.getObject("DATE_FIN");
527
            dateDeb = (Date) rowExercice.getObject("DATE_DEB");
528
        }
529
 
530
        this.dateDeb = dateDeb;
531
        this.dateFin = dateFin;
532
        this.sommeCompte = new SommeCompte(rowPosteAnalytique);
533
    }
534
 
535
    public Map2033B(JProgressBar b) {
536
        this(b, null, null);
537
    }
538
 
539
    public void generateMap() {
540
        this.start();
541
    }
542
 
543
}