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
 
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;
18 ilm 21
import org.openconcerto.sql.model.SQLRow;
177 ilm 22
import org.openconcerto.sql.model.Where;
18 ilm 23
import org.openconcerto.utils.GestionDevise;
24
 
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 Map2033A extends Thread {
37
 
156 ilm 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 dateDebut, dateFin;
42
    SommeCompte sommeCompte;
43
 
142 ilm 44
    // Debugger un bilan non réparti
45
    // Faire le bilan mois par mois pour retrouver à partir de quel date le bilan est déséquilibré,
46
    // puis comparer les balances J J-1 pour trouver les différences ( ou le grand livre)
47
    // --> Utiliser Check Bilan ACtion pour retrouver les mouvements qui ne sont pas bien réparti
48
    // entre actif et passif
49
 
18 ilm 50
    // TODO if value = 0.0 ne pas mettre -0.0
51
 
52
    public void run() {
53
 
54
        PdfGenerator_2033A p = new PdfGenerator_2033A();
156 ilm 55
        this.m = new HashMap();
18 ilm 56
 
57
        SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
58
        this.m.put("NOM", rowSociete.getString("TYPE") + " " + rowSociete.getString("NOM"));
59
        SQLRow rowAdresse = Configuration.getInstance().getBase().getTable("ADRESSE_COMMON").getRow(rowSociete.getInt("ID_ADRESSE_COMMON"));
60
 
73 ilm 61
        String ville = rowAdresse.getString("VILLE");
18 ilm 62
        final Object cedex = rowAdresse.getObject("CEDEX");
63
        final boolean hasCedex = rowAdresse.getBoolean("HAS_CEDEX");
64
 
65
        if (hasCedex) {
66
            ville += " CEDEX";
67
            if (cedex != null && cedex.toString().trim().length() > 0) {
68
                ville += " " + cedex.toString().trim();
69
            }
70
        }
73 ilm 71
        this.m.put("ADRESSE", rowAdresse.getString("RUE") + ", " + rowAdresse.getString("CODE_POSTAL") + " " + ville);
18 ilm 72
        this.m.put("SIRET", rowSociete.getString("NUM_SIRET"));
73
        this.m.put("APE", rowSociete.getString("NUM_APE"));
74
        this.m.put("DUREE1", "");
75
        this.m.put("DUREE2", "");
76
        SQLRow rowExercice = Configuration.getInstance().getBase().getTable("EXERCICE_COMMON").getRow(rowSociete.getInt("ID_EXERCICE_COMMON"));
77
        // Date dateFin = (Date) rowExercice.getObject("DATE_FIN");
78
        // Date dateDebut = (Date) rowExercice.getObject("DATE_DEB");
79
        this.m.put("CLOS1", format.format(this.dateFin));
80
        this.m.put("CLOS2", "");
81
 
82
        /*******************************************************************************************
83
         * ACTIF
84
         ******************************************************************************************/
85
 
86
        /*******************************************************************************************
87
         * IMMO INCORPORELLES --> FONDS COMMERCIAL
88
         ******************************************************************************************/
89
        // 010 SOMME(206, 207*)
90
        // Racine = "206-207"
91
        // S010=206+207
92
        long v010 = this.sommeCompte.soldeCompte(206, 207, true, this.dateDebut, this.dateFin);
93
        this.m.put("ACTIF1.0", GestionDevise.currencyToString(v010, false));
94
 
95
        // 012 -SOMME (2806,2807*) - SOMME(2906,2907*)
96
        // "2807, 2900, 2906-2907"
97
        // S012=-2807-2906-2907
98
        long v012 = -this.sommeCompte.sommeCompteFils("2807", this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(2906, 2907, true, this.dateDebut, this.dateFin);
99
        this.m.put("ACTIF2.0", GestionDevise.currencyToString(v012, false));
100
 
101
        // 011 010-012
102
        long v011 = v010 - v012;
103
        this.m.put("ACTIF3.0", GestionDevise.currencyToString(v011, false));
104
 
105
        // N-1 013 (N-1)010-(N-1)012
106
        this.m.put("ACTIF4.0", "");
107
 
108
        SwingUtilities.invokeLater(new Runnable() {
109
            public void run() {
110
                Map2033A.this.bar.setValue(10);
111
            }
112
        });
113
        /*******************************************************************************************
114
         * IMMO INCORPORELLES --> AUTRES
115
         ******************************************************************************************/
19 ilm 116
        // 014 SommeSolde(109) + SommeSolde( 200, 205* )+SommeSolde( 208, 209*
117
        // )+SommeSolde( 237,
18 ilm 118
        // 237* )
119
        // Racine = "109, 201, 203, 205, 208, 237"
120
        // S014=201...205+208+237+232
94 ilm 121
        // Fix Abaque 208 - 2087
142 ilm 122
        long v014 = this.sommeCompte.soldeCompteDebiteur(109, 109, true, this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("201", this.dateDebut, this.dateFin)
18 ilm 123
                + this.sommeCompte.sommeCompteFils("203", this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("232", this.dateDebut, this.dateFin)
177 ilm 124
                + this.sommeCompte.sommeCompteFils("234", this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("205", this.dateDebut, this.dateFin)
125
                + this.sommeCompte.soldeCompte(208, 208, true, this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(2087, 2087, true, this.dateDebut, this.dateFin)
126
                + this.sommeCompte.sommeCompteFils("237", this.dateDebut, this.dateFin);
18 ilm 127
        this.m.put("ACTIF1.1", GestionDevise.currencyToString(v014, false));
128
 
129
        // 016 -SommeSolde( 280, 280* ) - SommeSolde(2905) - SommeSolde (2908)
130
        // RacineDap = "2800, 2801, 2803, 2805, 2808, 2908, 2905"
131
        // S016=-2801-2803-2805-2905-2808-2908-2932
80 ilm 132
        // remove 26/11/13 present en case "012" - this.sommeCompte.sommeCompteFils("2807",
133
        // this.dateDebut, this.dateFin)
18 ilm 134
        long v016 = -this.sommeCompte.sommeCompteFils("2801", this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("2803", this.dateDebut, this.dateFin)
80 ilm 135
                - this.sommeCompte.sommeCompteFils("2805", this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("2808", this.dateDebut, this.dateFin)
136
                - this.sommeCompte.sommeCompteFils("2905", this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("2906", this.dateDebut, this.dateFin)
137
                - this.sommeCompte.sommeCompteFils("2907", this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("2908", this.dateDebut, this.dateFin)
138
                - this.sommeCompte.sommeCompteFils("2932", this.dateDebut, this.dateFin);
18 ilm 139
 
140
        this.m.put("ACTIF2.1", GestionDevise.currencyToString(v016, false));
141
 
142
        // 015 014-016
143
        long v015 = v014 - v016;
144
        this.m.put("ACTIF3.1", GestionDevise.currencyToString(v015, false));
145
 
146
        // 017 014-016
147
        this.m.put("ACTIF4.1", "");
148
 
149
        /*******************************************************************************************
150
         * IMMO CORPORELLES
151
         ******************************************************************************************/
152
        // 028 SommeSolde( 210, 236* )+SommeSolde( 238, 259* )
153
        // Racine = "210-215, 218, 230-231, 238"
154
        // S028=211...215+218+22+231+238
155
        long v028 = this.sommeCompte.soldeCompte(211, 215, true, this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("218", this.dateDebut, this.dateFin)
177 ilm 156
                + this.sommeCompte.sommeCompteFils("231", this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("238", this.dateDebut, this.dateFin)
157
                + this.sommeCompte.soldeCompte(24, 24, true, this.dateDebut, this.dateFin);
18 ilm 158
        this.m.put("ACTIF1.2", GestionDevise.currencyToString(v028, false));
159
 
160
        // 030 -SommeSolde( 281, 289* )-SommeSolde( 290, 295* )
161
        // RacineDap = "2810-2815, 2818, 2930-2931, 291"
162
        // S030=-2811-2812-2911-2813-2814-2815-2818-282-292-2931
83 ilm 163
        long v030 = -(this.sommeCompte.soldeCompte(2810, 2815, true, this.dateDebut, this.dateFin)) - this.sommeCompte.sommeCompteFils("2818", this.dateDebut, this.dateFin)
18 ilm 164
                - (this.sommeCompte.soldeCompte(2931, 2931, true, this.dateDebut, this.dateFin)) - this.sommeCompte.sommeCompteFils("2911", this.dateDebut, this.dateFin);
165
        this.m.put("ACTIF2.2", GestionDevise.currencyToString(v030, false));
166
 
167
        // 027 028-030
168
        long v027 = v028 - v030;
169
        this.m.put("ACTIF3.2", GestionDevise.currencyToString(v027, false));
170
 
171
        // 029 (N-1) 028-030
172
        this.m.put("ACTIF4.2", "");
173
 
174
        SwingUtilities.invokeLater(new Runnable() {
175
            public void run() {
176
                Map2033A.this.bar.setValue(20);
177
            }
178
        });
179
 
180
        /*******************************************************************************************
181
         * IMMO FINANCIERES
182
         ******************************************************************************************/
183
        // 040 SommeSolde( 260, 268* )+SommeSolde( 270, 278* )
19 ilm 184
        // Racine = "260D, 261, 266-268, 270-272, 274-275, 2760-2761, 27680,
185
        // 27682, 27684-27685,
18 ilm 186
        // 27688, 277"
187
        // S040=261+266...268+271+272+27682+274+27684+275+2761+27685+27688
188
        long v040 = this.sommeCompte.sommeCompteFils("261", this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompte(266, 268, true, this.dateDebut, this.dateFin)
189
                + this.sommeCompte.soldeCompte(271, 275, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompte(2761, 2761, true, this.dateDebut, this.dateFin)
190
                + this.sommeCompte.sommeCompteFils("27682", this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompte(27684, 27685, true, this.dateDebut, this.dateFin)
191
                + this.sommeCompte.sommeCompteFils("27688", this.dateDebut, this.dateFin);
192
 
193
        this.m.put("ACTIF1.3", GestionDevise.currencyToString(v040, false));
194
 
195
        // 042 -SommeSolde( 296, 299* )
196
        // RacineDap = "2960-2961, 2966-2968, 2970-2972, 2975-2976"
197
        // S042=-2961-2966-2967-2968-2971-2972-2974-2975-2976
198
        long v042 = -(this.sommeCompte.soldeCompte(2961, 2961, true, this.dateDebut, this.dateFin)) - (this.sommeCompte.soldeCompte(2966, 2968, true, this.dateDebut, this.dateFin))
199
                - (this.sommeCompte.soldeCompte(2971, 2976, true, this.dateDebut, this.dateFin));
200
        this.m.put("ACTIF2.3", GestionDevise.currencyToString(v042, false));
201
 
202
        // 041 040-042
203
        long v041 = v040 - v042;
204
        this.m.put("ACTIF3.3", GestionDevise.currencyToString(v041, false));
205
 
206
        // 043 40-042
207
        this.m.put("ACTIF4.3", "");
208
 
209
        SwingUtilities.invokeLater(new Runnable() {
210
            public void run() {
211
                Map2033A.this.bar.setValue(30);
212
            }
213
        });
214
        /*******************************************************************************************
215
         * TOTAL I
216
         ******************************************************************************************/
217
        // 044 010+014+028+040
218
        // S044:=S010+S014+S028+S040
219
        long v044 = v010 + v014 + v028 + v040;
220
        this.m.put("ACTIF1.4", GestionDevise.currencyToString(v044, false));
221
 
222
        // 048 012+016+030+042
223
        // S048:=S012+S016+S030+S042
224
        long v048 = v012 + v016 + v030 + v042;
225
        this.m.put("ACTIF2.4", GestionDevise.currencyToString(v048, false));
226
 
227
        // 045 011+015+027+041
228
        long v045 = v011 + v015 + v027 + v041;
229
        this.m.put("ACTIF3.4", GestionDevise.currencyToString(v045, false));
230
 
231
        // 049
232
        this.m.put("ACTIF4.4", "");
233
 
234
        SwingUtilities.invokeLater(new Runnable() {
235
            public void run() {
236
                Map2033A.this.bar.setValue(40);
237
            }
238
        });
239
        /*******************************************************************************************
240
         * STOCK --> MATIERE PREMIERE
241
         ******************************************************************************************/
242
        // 050 SommeSolde( 30, 36* )
243
        // Racine = "31-36, 38"
244
        // S050=31...36
94 ilm 245
        long v050 = this.sommeCompte.soldeCompte(30, 35, true, this.dateDebut, this.dateFin);
18 ilm 246
        this.m.put("ACTIF1.5", GestionDevise.currencyToString(v050, false));
247
 
248
        // 052 -SommeSolde( 390, 396*)
249
        // RacineDap = "390-395"
250
        // S052=-391...396
251
        long v052 = -(this.sommeCompte.soldeCompte(391, 395, true, this.dateDebut, this.dateFin));
252
        this.m.put("ACTIF2.5", GestionDevise.currencyToString(v052, false));
253
 
254
        // 051 050-052
255
        long v051 = v050 - v052;
256
        this.m.put("ACTIF3.5", GestionDevise.currencyToString(v051, false));
257
 
258
        // 053
259
        this.m.put("ACTIF4.5", "");
260
 
261
        /*******************************************************************************************
262
         * STOCK --> MARCHANDISE
263
         ******************************************************************************************/
264
        // 060 SommeSolde( 37, 38* )
265
        // Racine = "37"
266
        // S060=37
267
        long v060 = this.sommeCompte.soldeCompte(37, 37, true, this.dateDebut, this.dateFin);
268
        this.m.put("ACTIF1.6", GestionDevise.currencyToString(v060, false));
269
 
270
        // 062 -SommeSolde( 397, 399* )
271
        // RacineDap = "397"
272
        // S062=-397
273
        long v062 = -(this.sommeCompte.soldeCompte(397, 397, true, this.dateDebut, this.dateFin));
274
        this.m.put("ACTIF2.6", GestionDevise.currencyToString(v062, false));
275
 
276
        // 061 060-062
277
        long v061 = v060 - v062;
278
        this.m.put("ACTIF3.6", GestionDevise.currencyToString(v061, false));
279
 
280
        // 063 060 - 062
281
        this.m.put("ACTIF4.6", "");
282
 
283
        /*******************************************************************************************
284
         * Avances et acomptes
285
         ******************************************************************************************/
286
        // 064 SommeSolde( 4090, 4095* )
287
        // Racine = "4091"
288
        // S064=4091
289
        long v064 = this.sommeCompte.soldeCompte(4091, 4091, true, this.dateDebut, this.dateFin);
290
        this.m.put("ACTIF1.7", GestionDevise.currencyToString(v064, false));
291
 
292
        // 066
293
        long v066 = 0;
294
        this.m.put("ACTIF2.7", "");
295
 
296
        // 065
83 ilm 297
        long v065 = v064;
18 ilm 298
        this.m.put("ACTIF3.7", GestionDevise.currencyToString(v064, false));
299
 
300
        // 067
301
        long v067 = 0;
302
        this.m.put("ACTIF4.7", "");
303
 
304
        SwingUtilities.invokeLater(new Runnable() {
305
            public void run() {
306
                Map2033A.this.bar.setValue(50);
307
            }
308
        });
309
        /*******************************************************************************************
310
         * CREANCES ---> Clients
311
         ******************************************************************************************/
312
        // 068 SommeSoldeDebit( 410, 418* )
313
        // Racine = "410-411, 413, 416-418"
314
        // S068=41(D)...411+41A(D)...41Z+413(D)+416(D)...418
144 ilm 315
        long v068 = this.sommeCompte.soldeCompteDebiteur(410, 411, true, this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("413", this.dateDebut, this.dateFin)
18 ilm 316
                + this.sommeCompte.soldeCompteDebiteur(416, 418, true, this.dateDebut, this.dateFin);
317
        this.m.put("ACTIF1.8", GestionDevise.currencyToString(v068, false));
318
 
319
        // 070 -SommeSolde(490, 494*)
320
        // RacineDap = "490, 491"
321
        // S070=-491
322
        long v070 = -this.sommeCompte.soldeCompte(491, 491, true, this.dateDebut, this.dateFin);
323
        this.m.put("ACTIF2.8", GestionDevise.currencyToString(v070, false));
324
 
325
        // 069
326
        long v069 = v068 - v070;
327
        this.m.put("ACTIF3.8", GestionDevise.currencyToString(v069, false));
328
 
329
        // 071
330
        this.m.put("ACTIF4.8", "");
331
 
332
        /*******************************************************************************************
333
         * CREANCES ---> AUTRES
334
         ******************************************************************************************/
19 ilm 335
        // 072 SommeSoldeDebit( 400, 408* )+SommeSolde(4096, 4099*)+SommeSolde(
336
        // 425, 425* )
337
        // +SommeSolde( 4287, 4299* )+SommeSoldeDebit(430,
338
        // 453*)+SommeSoldeDebit( 455, 459* )
339
        // +SommeSolde( 460, 463* )+SommeSolde( 465, 466* )+SommeSoldeDebit(
340
        // 467, 467* )
341
        // +SommeSolde( 4687, 4699* )+SommeSoldeDebit( 470, 476*
342
        // )+SommeSoldeDebit( 478, 479* )
18 ilm 343
        // +SommeSolde( 480, 485* )
344
        // Racine = "4090, 4096-4098, 420d, 425, 4280d, 4287,
345
        // 430d, 4380d, 4387, 440d, 441, 443d-444d, 4450d, 4456, 44580d,
19 ilm 346
        // 44581-44583, 44586, 4480d, 4487, 450d, 451d, 455d, 4560d-4564d,
347
        // 4566d-4567d, 458d, 462,
18 ilm 348
        // 465, 467d, 4680d, 4687, 471d-475d, 478d"
349
        // S072=4096(D)+4097(D)+4098(D)+40(D)...401+40A(D)...40Z+42(D)..47
83 ilm 350
        long v072 = this.sommeCompte.soldeCompteDebiteur(4455, 4455, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteDebiteur(421, 421, true, this.dateDebut, this.dateFin)
351
                + this.sommeCompte.soldeCompteDebiteur(400, 408, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompte(4096, 4098, true, this.dateDebut, this.dateFin)
18 ilm 352
                + this.sommeCompte.sommeCompteFils("425", this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("4287", this.dateDebut, this.dateFin)
151 ilm 353
                + this.sommeCompte.soldeCompteDebiteur(43, 43, true, this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("441", this.dateDebut, this.dateFin)
354
                + this.sommeCompte.soldeCompteDebiteur(443, 445, true, this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("4487", this.dateDebut, this.dateFin)
18 ilm 355
                + this.sommeCompte.soldeCompteDebiteur(451, 451, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteDebiteur(455, 455, true, this.dateDebut, this.dateFin)
356
                + this.sommeCompte.soldeCompteDebiteur(4560, 4561, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteDebiteur(4563, 4569, true, this.dateDebut, this.dateFin)
151 ilm 357
                + this.sommeCompte.soldeCompteDebiteur(458, 458, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteDebiteur(46, 46, true, this.dateDebut, this.dateFin)
358
                + this.sommeCompte.soldeCompteDebiteur(478, 478, true, this.dateDebut, this.dateFin);
18 ilm 359
        this.m.put("ACTIF1.9", GestionDevise.currencyToString(v072, false));
360
 
361
        // 074 -SommeSolde( 495, 499 )
362
        // RacineDap = "495-496"
363
        // S074=-495(D)-496(D)
364
        long v074 = -(this.sommeCompte.soldeCompte(495, 496, true, this.dateDebut, this.dateFin));
365
        this.m.put("ACTIF2.9", GestionDevise.currencyToString(v074, false));
366
 
367
        // 073
368
        long v073 = v072 - v074;
369
        this.m.put("ACTIF3.9", GestionDevise.currencyToString(v073, false));
370
 
371
        // 075
372
        this.m.put("ACTIF4.9", "");
373
 
374
        /*******************************************************************************************
375
         * VALEURS IMMOBILIERES
376
         ******************************************************************************************/
377
        // 080 SommeSolde( 500, 508* )
378
        // Racine = "500d, 501-508"
379
        // S080=50...508
380
        long v080 = this.sommeCompte.soldeCompte(500, 508, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompte(52, 52, true, this.dateDebut, this.dateFin);
381
        this.m.put("ACTIF1.10", GestionDevise.currencyToString(v080, false));
382
 
383
        // 082 -SommeSolde( 59, 59* )
384
        // RacineDap = "59"
385
        // S082=-59
386
        long v082 = -this.sommeCompte.sommeCompteFils("59", this.dateDebut, this.dateFin);
387
        this.m.put("ACTIF2.10", GestionDevise.currencyToString(v082, false));
388
 
389
        // 081
390
        long v081 = v080 - v082;
391
        this.m.put("ACTIF3.10", GestionDevise.currencyToString(v081, false));
392
 
393
        // 083
394
        this.m.put("ACTIF4.10", "");
395
 
396
        /*******************************************************************************************
397
         * DISPONIBILITE
398
         ******************************************************************************************/
399
        // 084 SommeSolde( 510, 511* )+SommeSoldeDebit( 512, 514* )
400
        // + SommeSolde( 52, 58* )
19 ilm 401
        // +SommeSolde( 515, 516* )+SommeSoldeDebit( 517, 517* )+SommeSolde(
402
        // 5187, 5189* )
18 ilm 403
        // Racine = "510d-512d, 514d-517d, 5180d, 5187, 54"
404
        // 'Caisse
405
        // Racine = "53"
406
        // S084=511+512(D)...517+5187+54+58(D)+53
407
        long v084 = this.sommeCompte.soldeCompteDebiteur(510, 517, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteDebiteur(5180, 5185, true, this.dateDebut, this.dateFin)
408
                + this.sommeCompte.soldeCompteDebiteur(5187, 5189, true, this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("54", this.dateDebut, this.dateFin)
83 ilm 409
                + this.sommeCompte.sommeCompteFils("53", this.dateDebut, this.dateFin) + this.sommeCompte.sommeCompteFils("58", this.dateDebut, this.dateFin);
18 ilm 410
 
411
        this.m.put("ACTIF1.11", GestionDevise.currencyToString(v084, false));
412
 
413
        // 086
414
        this.m.put("ACTIF2.11", "");
415
 
416
        // 085
417
        long v085 = v084;
418
        this.m.put("ACTIF3.11", GestionDevise.currencyToString(v085, false));
419
 
420
        // 087
421
        this.m.put("ACTIF4.11", "");
422
 
423
        SwingUtilities.invokeLater(new Runnable() {
424
            public void run() {
425
                Map2033A.this.bar.setValue(60);
426
            }
427
        });
428
 
429
        /*******************************************************************************************
430
         * CHARGES CONSTATEES D'AVANCE
431
         ******************************************************************************************/
432
        // 092 SommeSolde( 486, 486* )
433
        // Racine = "169, 470d, 476, 480d, 481, 486"
434
        // S092=486
435
        // long v092 = this.sommeCompte.sommeCompteFils("486") +
436
        // this.sommeCompte.sommeCompteFils("481") +
19 ilm 437
        // this.sommeCompte.sommeCompteFils("476") +
438
        // this.sommeCompte.sommeCompteFils("169")
18 ilm 439
        // + this.sommeCompte.soldeCompteDebiteur(470, 470, true) +
440
        // this.sommeCompte.soldeCompteDebiteur(480,
441
        // 480, true);
442
        long v092 = this.sommeCompte.sommeCompteFils("486", this.dateDebut, this.dateFin);
443
        this.m.put("ACTIF1.12", GestionDevise.currencyToString(v092, false));
444
 
445
        // 094
446
        long v094 = 0;
447
        this.m.put("ACTIF2.12", "");
448
 
449
        // 093
450
        long v093 = v092 - v094;
451
        this.m.put("ACTIF3.12", GestionDevise.currencyToString(v093, false));
452
 
453
        // 095
454
        this.m.put("ACTIF4.12", "");
455
 
456
        /*******************************************************************************************
457
         * TOTAL II
458
         ******************************************************************************************/
459
        // 096 050+060+064+068+072+080+084+092
460
        long v096 = v050 + v060 + v064 + v068 + v072 + v080 + v084 + v092;
461
        this.m.put("ACTIF1.13", GestionDevise.currencyToString(v096, false));
462
 
463
        // 098 052+062+066+070+074+082+086+094
464
        long v098 = v052 + v062 + v070 + v074 + v082 + v094;
465
        this.m.put("ACTIF2.13", GestionDevise.currencyToString(v098, false));
466
 
467
        // 097 051+061+065+069+073+081+085+093
83 ilm 468
        long v097 = v051 + v061 + +v065 + v069 + v073 + v081 + v085 + v093;
18 ilm 469
        this.m.put("ACTIF3.13", GestionDevise.currencyToString(v097, false));
470
 
471
        // 099
472
        this.m.put("ACTIF4.13", "");
473
 
474
        /*******************************************************************************************
475
         * TOTAL GENERAL
476
         ******************************************************************************************/
477
        // 110 044+096
478
        long v110 = v044 + v096;
479
        this.m.put("ACTIF1.14", GestionDevise.currencyToString(v110, false));
480
 
481
        // 112
482
        long v112 = v048 + v098;
483
        this.m.put("ACTIF2.14", GestionDevise.currencyToString(v112, false));
484
 
485
        // 111
486
        long v111 = v045 + v097;
487
        this.m.put("ACTIF3.14", GestionDevise.currencyToString(v111, false));
488
 
489
        // 113
490
        this.m.put("ACTIF4.14", "");
491
 
492
        SwingUtilities.invokeLater(new Runnable() {
493
            public void run() {
494
                Map2033A.this.bar.setValue(70);
495
            }
496
        });
497
        /*******************************************************************************************
498
         * PASSIF
499
         ******************************************************************************************/
500
 
501
        /*******************************************************************************************
502
         * CAPITAL SOCIAL
503
         ******************************************************************************************/
504
 
505
        // 120 -SommeSolde( 100, 103* )-SommeSolde( 108, 109* )
506
        // Racine = "101, 104, 108"
507
        // S120=-10...101-108-104
174 ilm 508
        long v120 = -this.sommeCompte.sommeCompteFils("101", this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("102", this.dateDebut, this.dateFin)
509
                - this.sommeCompte.sommeCompteFils("103", this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("108", this.dateDebut, this.dateFin)
510
                - this.sommeCompte.sommeCompteFils("104", this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(109, 109, true, this.dateDebut, this.dateFin);
18 ilm 511
        this.m.put("PASSIF3.15", GestionDevise.currencyToString(v120, false));
512
 
513
        // 121
514
        this.m.put("PASSIF4.15", "");
515
 
516
        /*******************************************************************************************
517
         * ECARTS DE REEVAL
518
         ******************************************************************************************/
519
        // 124 -SommeSolde( 105, 105* )
520
        // Racine = "105"
521
        // S124=-105
522
        long v124 = -this.sommeCompte.sommeCompteFils("105", this.dateDebut, this.dateFin);
523
        this.m.put("PASSIF3.16", GestionDevise.currencyToString(v124, false));
524
 
525
        // 125
526
        this.m.put("PASSIF4.16", "");
527
 
528
        /*******************************************************************************************
529
         * RESERVE LEGALE
530
         ******************************************************************************************/
531
        // 126 -SommeSolde( 1060, 1061* )
532
        // Racine = "1061"
533
        // S126=-1061
534
        long v126 = -(this.sommeCompte.soldeCompte(1061, 1061, true, this.dateDebut, this.dateFin));
535
        this.m.put("PASSIF3.17", GestionDevise.currencyToString(v126, false));
536
 
537
        // 127
538
        this.m.put("PASSIF4.17", "");
539
 
540
        /*******************************************************************************************
541
         * RESERVE REGLEMENTEES
542
         ******************************************************************************************/
543
        // 129
544
        // 130 -SommeSolde( 1062 )-SommeSolde( 1064, 1067 )
545
        // Racine = "1062, 1064"
546
        // S130=-1063-1062-1064
547
        long v130 = -this.sommeCompte.soldeCompte(1062, 1062, true, this.dateDebut, this.dateFin) - (this.sommeCompte.soldeCompte(1064, 1064, true, this.dateDebut, this.dateFin));
548
        this.m.put("PASSIF3.18", GestionDevise.currencyToString(v130, false));
549
 
550
        // 128 N-1: +R130
551
        this.m.put("PASSIF4.18", "");
552
 
553
        /*******************************************************************************************
554
         * AUTRES RESERVES
555
         ******************************************************************************************/
556
        // 131
19 ilm 557
        // 132 -SommeSolde( 104, 104* )-SommeSolde( 1063, 1063* )-SommeSolde(
558
        // 1068, 1079* )
18 ilm 559
        // Racine = "1060, 1063, 1068"
560
        // S132=-1068
561
        long v132 = -this.sommeCompte.sommeCompteFils("1063", this.dateDebut, this.dateFin) - (this.sommeCompte.soldeCompte(1068, 1068, true, this.dateDebut, this.dateFin));
562
        this.m.put("PASSIF3.19", GestionDevise.currencyToString(v132, false));
563
 
564
        // 133 N-1: +R132
565
        this.m.put("PASSIF4.19", "");
566
 
567
        /*******************************************************************************************
568
         * REPORT A NOUVEAUX
569
         ******************************************************************************************/
570
        // 134 -SommeSolde( 11, 11* )
571
        // Racine = "11"
572
        // S134=-11
573
        long v134 = -this.sommeCompte.sommeCompteFils("11", this.dateDebut, this.dateFin);
574
        this.m.put("PASSIF3.20", GestionDevise.currencyToString(v134, false));
575
 
576
        // 135 -N-1: +R134
577
        this.m.put("PASSIF4.20", "");
578
 
579
        /*******************************************************************************************
580
         * RESULTAT DE L'EXCERCICE
581
         ******************************************************************************************/
582
        // 136 -SommeSolde( 7 )-SommeSolde( 6 )
583
        // Racine = "12, 6"
584
        // S136=-6-7
585
        // Racine1 = "7"
19 ilm 586
        // long v136 = -this.sommeCompte.sommeCompteFils("12", dateDebut,
587
        // dateFin);
177 ilm 588
        long v136 = -this.sommeCompte.sommeCompteFils("12", this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("7", this.dateDebut, this.dateFin)
589
                - this.sommeCompte.sommeCompteFils("6", this.dateDebut, this.dateFin);
590
 
18 ilm 591
        this.m.put("PASSIF3.21", GestionDevise.currencyToString(v136, false));
592
 
593
        // 137 -N-1: +R136
594
        this.m.put("PASSIF4.21", "");
595
 
596
        /*******************************************************************************************
597
         * PROVISIONS REGLEMENTEES
598
         ******************************************************************************************/
599
        // 140 -SommeSolde( 13, 14* )
600
        // Racine = "13, 14"
601
        // S140=-13-14
602
        long v140 = -this.sommeCompte.soldeCompte(13, 14, true, this.dateDebut, this.dateFin);
603
        this.m.put("PASSIF3.22", GestionDevise.currencyToString(v140, false));
604
 
605
        // 138 -N-1: +R140
606
        this.m.put("PASSIF4.22", "");
607
 
608
        /*******************************************************************************************
609
         * TOTAL I
610
         ******************************************************************************************/
611
        // 142 R120+R124+R126+R130+R132+R134+R136+R140
612
        long v142 = v120 + v124 + v126 + v130 + v132 + v134 + v136 + v140;
613
        this.m.put("PASSIF3.23", GestionDevise.currencyToString(v142, false));
614
 
615
        // 141
616
        this.m.put("PASSIF4.23", "");
617
 
618
        /*******************************************************************************************
619
         * PROVISIONS POUR RISQUE ET CHARGE (TOTAL II)
620
         ******************************************************************************************/
621
        // 154 -SommeSolde( 15, 15* )
622
        // Racine = "150-151, 153, 155-158"
623
        // S154:=-151-153-155...158
624
        long v154 = -this.sommeCompte.sommeCompteFils("15", this.dateDebut, this.dateFin);
625
        this.m.put("PASSIF3.24", GestionDevise.currencyToString(v154, false));
626
 
627
        // 150
628
        this.m.put("PASSIF4.24", "");
629
 
630
        SwingUtilities.invokeLater(new Runnable() {
631
            public void run() {
632
                Map2033A.this.bar.setValue(80);
633
            }
634
        });
635
 
636
        /*******************************************************************************************
637
         * EMPRUNTS ET DETTES ASSIMILEES
638
         ******************************************************************************************/
19 ilm 639
        // 156 -SommeSolde( 160, 199 )+SommeSoldeCredit( 512, 514
640
        // )+SommeSoldeCredit( 517
18 ilm 641
        // )-SommeSolde( 5180, 5186 )-SommeSolde( 519 )
19 ilm 642
        // Racine = "160-161, 163-167, 1680-1681, 1685, 1687, 16880-16881,
643
        // 16883-16888, 17, 260c
644
        // 269, 279, 404-405, 4084, 420c, 421-422, 424, 426-427, 4280c, 4282,
645
        // 4284, 4286, 430c,
646
        // 431, 437, 4380c, 4386, 440c, 442, 443c-444c, 4450c, 4455,4457,
647
        // 44580c, 44584, 44587,
648
        // 446-447, 4480c, 4486, 450c-451c, 456c, 458c, 519, 510c-512c,
649
        // 514c-517c, 5180c, 5186"
18 ilm 650
        // S156=-161-163-164-169-512(C)-514(C)-517(C)-5186-519-58(C)-165-166...168+16881+16883-17-426
651
        /*
652
         * float v156 = -this.sommeCompte.soldeCompte(160, 161, true) -
73 ilm 653
         * this.sommeCompte.soldeCompte(163, 167, true) - this.sommeCompte.soldeCompte(1680, 1681,
654
         * true) - this.sommeCompte.sommeCompteFils("1685") -
655
         * this.sommeCompte.sommeCompteFils("1687") - this.sommeCompte.soldeCompte(16880, 16881,
656
         * true) - this.sommeCompte.soldeCompte(16883, 16888, true) -
657
         * this.sommeCompte.sommeCompteFils("17") + this.sommeCompte.soldeCompteCrediteur(260, 260,
658
         * true) - this.sommeCompte.sommeCompteFils("269") - this.sommeCompte.sommeCompteFils("279")
659
         * - this.sommeCompte.soldeCompte(404, 405, true) - this.sommeCompte.sommeCompteFils("4084")
660
         * + this.sommeCompte.soldeCompteCrediteur(420, 420, true) -
661
         * this.sommeCompte.soldeCompte(421, 422, true) - this.sommeCompte.sommeCompteFils("424") -
18 ilm 662
         * this.sommeCompte.soldeCompte(426, 427, true) +
663
         * this.sommeCompte.soldeCompteCrediteur(4280, 4280, true) -
73 ilm 664
         * this.sommeCompte.sommeCompteFils("4282") - this.sommeCompte.sommeCompteFils("4284") -
665
         * this.sommeCompte.sommeCompteFils("4286") + this.sommeCompte.soldeCompteCrediteur(430,
666
         * 430, true) - this.sommeCompte.sommeCompteFils("431") -
667
         * this.sommeCompte.sommeCompteFils("437") + this.sommeCompte.soldeCompteCrediteur(4380,
668
         * 4380, true) - this.sommeCompte.sommeCompteFils("4386") +
18 ilm 669
         * this.sommeCompte.soldeCompteCrediteur(440, 440, true) -
73 ilm 670
         * this.sommeCompte.sommeCompteFils("442") + this.sommeCompte.soldeCompteCrediteur(443, 444,
671
         * true) + this.sommeCompte.soldeCompteCrediteur(4450, 4450, true) -
672
         * this.sommeCompte.sommeCompteFils("4455") - this.sommeCompte.sommeCompteFils("4457") +
18 ilm 673
         * this.sommeCompte.soldeCompteCrediteur(44580, 44580, true) -
73 ilm 674
         * this.sommeCompte.sommeCompteFils("44584") - this.sommeCompte.sommeCompteFils("44587") -
18 ilm 675
         * this.sommeCompte.soldeCompte(446, 447, true) +
676
         * this.sommeCompte.soldeCompteCrediteur(4480, 4480, true) -
73 ilm 677
         * this.sommeCompte.sommeCompteFils("4486") + this.sommeCompte.soldeCompteCrediteur(450,
678
         * 451, true) + this.sommeCompte.soldeCompteCrediteur(456, 456, true) +
18 ilm 679
         * this.sommeCompte.soldeCompteCrediteur(458, 458, true) -
73 ilm 680
         * this.sommeCompte.sommeCompteFils("519") + this.sommeCompte.soldeCompteCrediteur(510, 512,
681
         * true) + this.sommeCompte.soldeCompteCrediteur(514, 517, true) +
18 ilm 682
         * this.sommeCompte.soldeCompteCrediteur(5180, 5180, true) -
683
         * this.sommeCompte.sommeCompteFils("5186") ;
684
         */
685
        long v156 = -this.sommeCompte.sommeCompteFils("161", this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(163, 166, true, this.dateDebut, this.dateFin)
83 ilm 686
                - this.sommeCompte.soldeCompte(1680, 1681, true, this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(1682, 1682, true, this.dateDebut, this.dateFin)
18 ilm 687
                - this.sommeCompte.soldeCompte(1684, 1689, true, this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("17", this.dateDebut, this.dateFin)
83 ilm 688
                - this.sommeCompte.sommeCompteFils("426", this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(450, 454, true, this.dateDebut, this.dateFin)
689
                + this.sommeCompte.soldeCompteCrediteur(456, 456, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(458, 459, true, this.dateDebut, this.dateFin)
144 ilm 690
                + this.sommeCompte.soldeCompteCrediteur(512, 517, true, this.dateDebut, this.dateFin) - this.sommeCompte.sommeCompteFils("518", this.dateDebut, this.dateFin)
83 ilm 691
                - this.sommeCompte.sommeCompteFils("519", this.dateDebut, this.dateFin);
18 ilm 692
        this.m.put("PASSIF3.25", GestionDevise.currencyToString(v156, false));
693
 
694
        // 151
695
        this.m.put("PASSIF4.25", "");
696
 
697
        /*******************************************************************************************
698
         * AVANCES ET ACOMPTE RECUS
699
         ******************************************************************************************/
700
        // 164 -SommeSolde( 4190, 4195* )
701
        // Racine = "4191"
702
        // S164=-4191
144 ilm 703
        long v164 = -this.sommeCompte.soldeCompte(4191, 4191, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(510, 511, true, this.dateDebut, this.dateFin);
18 ilm 704
        this.m.put("PASSIF3.26", GestionDevise.currencyToString(v164, false));
705
 
706
        // 152
707
        this.m.put("PASSIF4.26", "");
708
 
709
        /*******************************************************************************************
710
         * FOURNISSEURS ET COMPTES RATTACHES
711
         ******************************************************************************************/
19 ilm 712
        // 166 SommeSoldeCredit( 400, 403 )+SommeSoldeCredit( 408
713
        // )-SommeSoldeCredit( 4084, 4087 )
18 ilm 714
        // Racine = "400-401, 403, 4080-4081, 4088"
715
        // S166=-40(C)...405-40A(C)...40Z-403-4081-4084-4088
716
        long v166 = this.sommeCompte.soldeCompteCrediteur(403, 403, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(401, 401, true, this.dateDebut, this.dateFin)
151 ilm 717
                + this.sommeCompte.soldeCompteCrediteur(408, 408, true, this.dateDebut, this.dateFin);
18 ilm 718
        // float v166 = this.sommeCompte.soldeCompteCrediteur(400, 401, true) -
19 ilm 719
        // this.sommeCompte.sommeCompteFils("403") +
720
        // this.sommeCompte.soldeCompte(4080, 4081, false)
18 ilm 721
        // +
722
        // this.sommeCompte.sommeCompteFils("4088");
723
        this.m.put("PASSIF3.27", GestionDevise.currencyToString(v166, false));
724
 
725
        // 153
726
        this.m.put("PASSIF4.27", "");
727
 
728
        /*******************************************************************************************
729
         * AUTRES DETTES
730
         ******************************************************************************************/
731
        // S169=-455
732
        long v169 = -this.sommeCompte.sommeCompteFils("455", this.dateDebut, this.dateFin);
733
        this.m.put("PASSIF2.28", GestionDevise.currencyToString(v169, false));
734
 
19 ilm 735
        // 172 -SommeSolde( 269 )-SommeSolde( 279 )+SommeSoldeCredit( 404, 407
736
        // )+SommeSoldeCredit(
18 ilm 737
        // 4084, 4087 )
19 ilm 738
        // +SommeSoldeCredit( 410, 418 )-SommeSolde( 4196, 4199 )-SommeSolde(
739
        // 420, 424 )
740
        // -SommeSolde( 4260, 4286 )+SommeSoldeCredit( 430, 449
741
        // )+SommeSoldeCredit( 450, 453 )
742
        // -SommeSolde( 454 )+SommeSoldeCredit( 455, 457 )+SommeSoldeCredit(
743
        // 458, 459 )-SommeSolde(
18 ilm 744
        // 464 )
19 ilm 745
        // +SommeSoldeCredit( 467 )-SommeSolde( 4680, 4686 )+SommeSoldeCredit(
746
        // 470, 476
18 ilm 747
        // )-SommeSolde( 477 )
748
        // +SommeSoldeCredit( 478, 479 )-SommeSolde( 509 )
749
        // Racine = "4190, 4196-4198, 455c, 457, 460c, 464, 467c, 4680c, 4686,
750
        // 471c-475c, 478c, 500c, 509"
751
        /*
752
         * float v172 = -this.sommeCompte.sommeCompteFils("4190") -
753
         * this.sommeCompte.soldeCompte(4196, 4198, true) +
754
         * this.sommeCompte.soldeCompteCrediteur(455, 455, true) -
73 ilm 755
         * this.sommeCompte.sommeCompteFils("457") + this.sommeCompte.soldeCompteCrediteur(460, 460,
756
         * true) - this.sommeCompte.sommeCompteFils("464") +
18 ilm 757
         * this.sommeCompte.soldeCompteCrediteur(467, 467, true) +
758
         * this.sommeCompte.soldeCompteCrediteur(4680, 4680, true) -
73 ilm 759
         * this.sommeCompte.sommeCompteFils("4686") + this.sommeCompte.soldeCompteCrediteur(471,
760
         * 475, true) + this.sommeCompte.soldeCompteCrediteur(478, 478, true) +
18 ilm 761
         * this.sommeCompte.soldeCompteCrediteur(500, 500, true) -
762
         * this.sommeCompte.sommeCompteFils("509");
763
         */
764
        /*
73 ilm 765
         * S172=-421(C) -422(C) -424(C) -427(C) -4282(C) -4284(C) -4286(C) -43(C) +4387(C) -442(C)
766
         * -443(C) -451(C)...455 // -4563 -4564 -4567 -457 -458(C) -444(C) -4451(C) -4455(C)
767
         * -4456(C) -4457(C) +44581 +44582 -44584(C) -44587(C) -446(C) -447(C) -448(C)...4482
768
         * -4486(C) -269 -279 -41(C)...411 -41A(C)...41Z -4196 -4197 -4198 -464 -467(C) -4686(C)
769
         * -47(C)...475 -478(C) -509
18 ilm 770
         */
771
        /*
772
         * float v172 = -this.sommeCompte.sommeCompteFils("269") -
73 ilm 773
         * this.sommeCompte.sommeCompteFils("279") - this.sommeCompte.soldeCompteCrediteur(404, 407,
774
         * false) - this.sommeCompte.soldeCompteCrediteur(4084, 4087, false) -
18 ilm 775
         * this.sommeCompte.soldeCompteCrediteur(410, 418, false) -
73 ilm 776
         * this.sommeCompte.soldeCompte(4196, 4199, false) - this.sommeCompte.soldeCompte(420, 424,
777
         * false) - this.sommeCompte.soldeCompte(4260, 4286, false) -
18 ilm 778
         * this.sommeCompte.soldeCompteCrediteur(430, 449, false) -
779
         * this.sommeCompte.soldeCompteCrediteur(450, 453, false) -
73 ilm 780
         * this.sommeCompte.sommeCompteFils("454") - this.sommeCompte.soldeCompteCrediteur(455, 457,
781
         * false) - this.sommeCompte.soldeCompteCrediteur(458, 459, false) -
782
         * this.sommeCompte.sommeCompteFils("464") - this.sommeCompte.sommeCompteFils("467") -
18 ilm 783
         * this.sommeCompte.soldeCompte(4680, 4686, false) -
784
         * this.sommeCompte.soldeCompteCrediteur(470, 476, false) -
73 ilm 785
         * this.sommeCompte.sommeCompteFils("477") - this.sommeCompte.soldeCompteCrediteur(478, 479,
786
         * false) - this.sommeCompte.sommeCompteFils("509");
18 ilm 787
         */
788
 
144 ilm 789
        long v172 = this.sommeCompte.soldeCompteCrediteur(410, 411, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(421, 421, true, this.dateDebut, this.dateFin)
18 ilm 790
                + this.sommeCompte.soldeCompteCrediteur(422, 422, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(424, 424, true, this.dateDebut, this.dateFin)
791
                + this.sommeCompte.soldeCompteCrediteur(427, 427, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(4282, 4282, true, this.dateDebut, this.dateFin)
792
                + this.sommeCompte.soldeCompteCrediteur(4284, 4284, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(4286, 4286, true, this.dateDebut, this.dateFin)
151 ilm 793
                + this.sommeCompte.soldeCompteCrediteur(43, 43, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(442, 442, true, this.dateDebut, this.dateFin)
794
                + this.sommeCompte.soldeCompteCrediteur(443, 445, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(455, 455, true, this.dateDebut, this.dateFin)
795
                - this.sommeCompte.soldeCompte(446, 447, true, this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(4482, 4482, true, this.dateDebut, this.dateFin)
796
                - this.sommeCompte.soldeCompte(4486, 4486, true, this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(457, 457, true, this.dateDebut, this.dateFin)
797
                - this.sommeCompte.soldeCompte(269, 269, true, this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(279, 279, true, this.dateDebut, this.dateFin)
798
                - this.sommeCompte.soldeCompte(404, 405, true, this.dateDebut, this.dateFin) - this.sommeCompte.soldeCompte(4196, 4198, true, this.dateDebut, this.dateFin)
799
                + this.sommeCompte.soldeCompteCrediteur(46, 46, true, this.dateDebut, this.dateFin) + this.sommeCompte.soldeCompteCrediteur(478, 478, true, this.dateDebut, this.dateFin)
18 ilm 800
                - this.sommeCompte.soldeCompte(509, 509, true, this.dateDebut, this.dateFin);
801
 
802
        this.m.put("PASSIF3.28", GestionDevise.currencyToString(v172, false));
803
 
804
        // 157
805
        this.m.put("PASSIF4.28", "");
806
 
807
        /*******************************************************************************************
808
         * PRODUITS CONSTATES D'AVANCE
809
         ******************************************************************************************/
810
        // 174 -SommeSolde( 487, 489 )
811
        // Racine = "470c, 477, 480c, 487"
812
        // S174=-487
813
        long v174 = -this.sommeCompte.soldeCompte(487, 487, false, this.dateDebut, this.dateFin);
814
        this.m.put("PASSIF3.29", GestionDevise.currencyToString(v174, false));
815
 
816
        // 158
817
        this.m.put("PASSIF4.29", "");
818
 
819
        /*******************************************************************************************
820
         * TOTAL III
821
         ******************************************************************************************/
822
        // 176 R156+R164+R166+R172+R174
823
        long v176 = v156 + v164 + v166 + v172 + v174;
824
        this.m.put("PASSIF3.30", GestionDevise.currencyToString(v176, false));
825
 
826
        // 160
827
        this.m.put("PASSIF4.30", "");
828
 
829
        /*******************************************************************************************
830
         * TOTAL
831
         ******************************************************************************************/
832
        // 180 R142+R154+R176
833
        long v180 = v142 + v154 + v176;
834
        this.m.put("PASSIF3.31", GestionDevise.currencyToString(v180, false));
835
 
836
        // 161
837
        this.m.put("PASSIF4.31", "");
838
        SwingUtilities.invokeLater(new Runnable() {
839
            public void run() {
840
                Map2033A.this.bar.setValue(90);
841
            }
842
        });
843
 
844
        /*******************************************************************************************
845
         * VALEURS NON CONNUES
846
         ******************************************************************************************/
847
 
848
        this.m.put("PASSIF2.18", "");
849
        this.m.put("PASSIF2.19", "");
850
        this.m.put("PASSIF1.32", "");
851
        this.m.put("PASSIF1.33", "");
852
        this.m.put("PASSIF1.34", "");
853
 
854
        this.m.put("PASSIF4.32", "");
855
        this.m.put("PASSIF4.33", "");
856
        this.m.put("PASSIF4.34", "");
83 ilm 857
 
177 ilm 858
        final SQLField field = ComptaPropsConfiguration.getInstanceCompta().getRootSociete().getTable("COMPTE_PCE").getField("NUMERO");
859
        Where where = new Where(field, "NOT LIKE", "6%");
860
        where = where.and(new Where(field, "NOT LIKE", "7%"));
861
        where = where.and(new Where(field, "NOT LIKE", "8%"));
862
        List<String> unused = this.sommeCompte.getNonUsedCompte(where, this.dateDebut, this.dateFin);
863
        if (unused != null && !unused.isEmpty()) {
864
            JOptionPane.showMessageDialog(null, "Certains comptes n'ont pas été intégré : " + unused);
865
        }
866
 
18 ilm 867
        p.generateFrom(this.m);
868
 
869
        SwingUtilities.invokeLater(new Runnable() {
870
            public void run() {
871
                Map2033A.this.bar.setValue(95);
872
            }
873
        });
874
 
875
        SwingUtilities.invokeLater(new Runnable() {
876
            public void run() {
156 ilm 877
                Gestion.openPDF(p.getGeneratedFile());
18 ilm 878
                Map2033A.this.bar.setValue(100);
879
            }
880
        });
881
 
882
    }
883
 
884
    public Map2033A(JProgressBar bar, Date dateDeb, Date dateFin) {
19 ilm 885
        this(bar, dateDeb, dateFin, null);
886
    }
18 ilm 887
 
19 ilm 888
    public Map2033A(JProgressBar bar, Date dateDeb, Date dateFin, SQLRow posteAnalytique) {
18 ilm 889
        this.bar = bar;
890
        if (dateDeb == null && dateFin == null) {
891
            SQLRow rowSociete = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
892
            SQLRow rowExercice = Configuration.getInstance().getBase().getTable("EXERCICE_COMMON").getRow(rowSociete.getInt("ID_EXERCICE_COMMON"));
893
            dateFin = (Date) rowExercice.getObject("DATE_FIN");
894
            dateDeb = (Date) rowExercice.getObject("DATE_DEB");
895
        }
896
 
897
        this.dateDebut = dateDeb;
898
        this.dateFin = dateFin;
19 ilm 899
        this.sommeCompte = new SommeCompte(posteAnalytique);
18 ilm 900
    }
901
 
902
    public Map2033A(JProgressBar bar) {
903
 
904
        this(bar, null, null);
905
    }
906
 
907
    public void generateMap2033A() {
908
        this.start();
909
    }
910
}