OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | 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
public class Journal {
21
public class Journal {
21
    private final Long id;
22
    private final Long id;
22
    private final String code;
23
    private final String code;
23
    private final String nom;
24
    private final String nom;
Line 52... Line 53...
52
        if (this.getClass() != obj.getClass())
53
        if (this.getClass() != obj.getClass())
53
            return false;
54
            return false;
54
        return ((Journal) obj).code.equalsIgnoreCase(this.code);
55
        return ((Journal) obj).code.equalsIgnoreCase(this.code);
55
    }
56
    }
56
 
57
 
57
    SQLInsert createInsert(DBRoot root) {
58
    SQLInsert createInsert(DBRoot root, User user) {
58
        final SQLInsert insert = new SQLInsert();
59
        final SQLInsert insert = new SQLInsert();
59
        final SQLTable table = root.getTable("JOURNAL");
60
        final SQLTable table = root.getTable("JOURNAL");
60
        insert.add(table.getField("CODE"), this.code);
61
        insert.add(table.getField("CODE"), this.code);
61
        insert.add(table.getField("NOM"), this.nom);
62
        insert.add(table.getField("NOM"), this.nom);
-
 
63
        insert.addCreationTrackedField(user, table);
62
        return insert;
64
        return insert;
63
    }
65
    }
64
 
66
 
65
    @Override
67
    @Override
66
    public String toString() {
68
    public String toString() {