OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Show entire file | Ignore 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 Compte {
21
public class Compte {
21
    private final Long id;
22
    private final Long id;
22
    private String numero;
23
    private String numero;
23
    private String nom;
24
    private 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 ((Compte) obj).numero.equalsIgnoreCase(this.numero);
55
        return ((Compte) obj).numero.equalsIgnoreCase(this.numero);
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("COMPTE_PCE");
60
        final SQLTable table = root.getTable("COMPTE_PCE");
60
        insert.add(table.getField("NUMERO"), this.numero);
61
        insert.add(table.getField("NUMERO"), this.numero);
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
 
-
 
67
 
65
    @Override
68
    @Override
66
    public String toString() {
69
    public String toString() {
67
        return "Compte numero:" + this.numero + " " + this.nom + " (id:" + this.id + ")";
70
        return "Compte numero:" + this.numero + " " + this.nom + " (id:" + this.id + ")";
68
    }
71
    }
69
}
72
}