OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 182 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 182 Rev 185
Line 31... Line 31...
31
import java.util.Date;
31
import java.util.Date;
32
import java.util.HashMap;
32
import java.util.HashMap;
33
import java.util.Map;
33
import java.util.Map;
34
 
34
 
35
// FIXME mettre toute les generations dans des threads à part
35
// FIXME mettre toute les generations dans des threads à part
36
public final class GenerationMvtReglementAchat extends GenerationEcritures implements Runnable {
36
public final class GenerationMvtReglementAchat extends GenerationEcritures {
37
 
37
 
38
    private int idSaisieAchat;
38
    private int idSaisieAchat;
39
 
39
 
40
    // Journal Caisse
40
    // Journal Caisse
41
    private static final Integer journalCaisse = Integer.valueOf(JournalSQLElement.CAISSES);
41
    private static final Integer journalCaisse = Integer.valueOf(JournalSQLElement.CAISSES);
Line 43... Line 43...
43
    private static final SQLTable tablePrefCompte = base.getTable("PREFS_COMPTE");
43
    private static final SQLTable tablePrefCompte = base.getTable("PREFS_COMPTE");
44
    private static final SQLTable tableMouvement = base.getTable("MOUVEMENT");
44
    private static final SQLTable tableMouvement = base.getTable("MOUVEMENT");
45
    private static final SQLRow rowPrefsCompte = tablePrefCompte.getRow(2);
45
    private static final SQLRow rowPrefsCompte = tablePrefCompte.getRow(2);
46
    private int idPere = 1; // Id du mouvement pere
46
    private int idPere = 1; // Id du mouvement pere
47
 
47
 
48
    public GenerationMvtReglementAchat(SQLRow rowAchat, int idMvt) {
48
    public GenerationMvtReglementAchat(SQLRow rowAchat, int idMvt) throws Exception {
49
        setRowAnalytiqueSource(rowAchat);
49
        setRowAnalytiqueSource(rowAchat);
50
        this.idSaisieAchat = rowAchat.getID();
50
        this.idSaisieAchat = rowAchat.getID();
51
        this.idPere = idMvt;
51
        this.idPere = idMvt;
52
        new Thread(GenerationMvtReglementAchat.this).start();
52
        genereReglement();
53
    }
53
    }
54
 
54
 
55
    private void genereReglement() throws Exception {
55
    private void genereReglement() throws Exception {
56
 
56
 
57
        System.out.println("Génération des ecritures du reglement du mouvement " + this.idMvt);
57
        System.out.println("Génération des ecritures du reglement du mouvement " + this.idMvt);
Line 232... Line 232...
232
            rowVals.update(this.idMvt);
232
            rowVals.update(this.idMvt);
233
        }
233
        }
234
 
234
 
235
    }
235
    }
236
 
236
 
237
    public void run() {
-
 
238
        try {
-
 
239
            genereReglement();
-
 
240
        } catch (Exception e) {
-
 
241
            ExceptionHandler.handle("Erreur pendant la générations des écritures comptables", e);
-
 
242
            e.printStackTrace();
-
 
243
        }
-
 
244
    }
-
 
245
}
237
}