OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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