OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Rev 182 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 177
Line 14... Line 14...
14
 package org.openconcerto.erp.generationEcritures;
14
 package org.openconcerto.erp.generationEcritures;
15
 
15
 
16
import org.openconcerto.sql.model.DBRoot;
16
import org.openconcerto.sql.model.DBRoot;
17
import org.openconcerto.sql.model.SQLInsert;
17
import org.openconcerto.sql.model.SQLInsert;
18
import org.openconcerto.sql.model.SQLTable;
18
import org.openconcerto.sql.model.SQLTable;
-
 
19
import org.openconcerto.sql.users.User;
19
 
20
 
20
import java.math.BigDecimal;
21
import java.math.BigDecimal;
21
import java.util.ArrayList;
22
import java.util.ArrayList;
22
import java.util.List;
23
import java.util.List;
23
 
24
 
Line 59... Line 60...
59
 
60
 
60
    public Number getId() {
61
    public Number getId() {
61
        return this.id;
62
        return this.id;
62
    }
63
    }
63
 
64
 
64
    SQLInsert createInsert(DBRoot root) {
65
    SQLInsert createInsert(DBRoot root, User user) {
65
        final SQLInsert insert = new SQLInsert();
66
        final SQLInsert insert = new SQLInsert();
66
        final SQLTable table = root.getTable("MOUVEMENT");
67
        final SQLTable table = root.getTable("MOUVEMENT");
67
        // FIXME le numero doit être généré en auto
68
        // FIXME le numero doit être généré en auto
68
        // Thread.dumpStack();
69
        // Thread.dumpStack();
69
        // NUMERO = SELECT (MAX) ?
70
        // NUMERO = SELECT (MAX) ?
Line 75... Line 76...
75
        }
76
        }
76
        insert.add(table.getField("ID_PIECE"), this.piece.getId().intValue());
77
        insert.add(table.getField("ID_PIECE"), this.piece.getId().intValue());
77
        if (this.pere != null) {
78
        if (this.pere != null) {
78
            insert.add(table.getField("ID_MOUVEMENT_PERE"), this.pere.getId().intValue());
79
            insert.add(table.getField("ID_MOUVEMENT_PERE"), this.pere.getId().intValue());
79
        }
80
        }
80
        // TODO CREATION_DATE MODIFICATION_DATE
81
        insert.addCreationTrackedField(user, table);
81
        return insert;
82
        return insert;
82
    }
83
    }
83
 
84
 
84
    public boolean isBalanced() {
85
    public boolean isBalanced() {
85
        BigDecimal d = BigDecimal.ZERO;
86
        BigDecimal d = BigDecimal.ZERO;