OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 170 Rev 181
Line 92... Line 92...
92
import org.openconcerto.utils.CollectionUtils;
92
import org.openconcerto.utils.CollectionUtils;
93
import org.openconcerto.utils.ExceptionHandler;
93
import org.openconcerto.utils.ExceptionHandler;
94
import org.openconcerto.utils.Tuple2;
94
import org.openconcerto.utils.Tuple2;
95
import org.openconcerto.utils.cc.IExnClosure;
95
import org.openconcerto.utils.cc.IExnClosure;
96
import org.openconcerto.utils.cc.ITransformer;
96
import org.openconcerto.utils.cc.ITransformer;
97
import org.openconcerto.utils.i18n.TranslationManager;
-
 
98
 
97
 
99
public final class Module extends AbstractModule {
98
public final class Module extends AbstractModule {
100
 
99
 
101
    public static final String PROJECT_TABLENAME = "AFFAIRE";
100
    public static final String PROJECT_TABLENAME = "AFFAIRE";
102
    private List<String> listTableAffaire = Arrays.asList("DEMANDE_PRIX", "BON_RECEPTION", "DEMANDE_ACHAT_ELEMENT", "SAISIE_VENTE_FACTURE", "AVOIR_CLIENT", "BON_DE_LIVRAISON", "COMMANDE_CLIENT",
101
    private List<String> listTableAffaire = Arrays.asList("DEMANDE_PRIX", "BON_RECEPTION", "DEMANDE_ACHAT_ELEMENT", "SAISIE_VENTE_FACTURE", "AVOIR_CLIENT", "BON_DE_LIVRAISON", "COMMANDE_CLIENT",
Line 189... Line 188...
189
    }
188
    }
190
 
189
 
191
    @Override
190
    @Override
192
    protected void setupElements(final SQLElementDirectory dir) {
191
    protected void setupElements(final SQLElementDirectory dir) {
193
        super.setupElements(dir);
192
        super.setupElements(dir);
194
        TranslationManager.getInstance().addTranslationStreamFromClass(this.getClass());
-
 
195
        dir.addSQLElement(ProjectSQLElement.class);
193
        dir.addSQLElement(ProjectSQLElement.class);
196
        dir.addSQLElement(ProjectStateSQLElement.class);
194
        dir.addSQLElement(ProjectStateSQLElement.class);
197
        dir.addSQLElement(ProjectTypeSQLElement.class);
195
        dir.addSQLElement(ProjectTypeSQLElement.class);
198
 
196
 
199
        final SQLElement element = dir.getElement("DEVIS");
197
        final SQLElement element = dir.getElement("DEVIS");
Line 605... Line 603...
605
 
603
 
606
    @Override
604
    @Override
607
    protected void setupComponents(final ComponentsContext ctxt) {
605
    protected void setupComponents(final ComponentsContext ctxt) {
608
 
606
 
609
        DBRoot root = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
607
        DBRoot root = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
610
        List<String> table2check = Arrays.asList("BON_RECEPTION", "DEMANDE_PRIX", "DEMANDE_ACHAT_ELEMENT");
608
        List<String> table2check = Arrays.asList("BON_RECEPTION", "DEMANDE_PRIX", "DEMANDE_ACHAT_ELEMENT", "FACTURE_FOURNISSEUR");
611
        for (String table : table2check) {
609
        for (String table : table2check) {
612
            if (root.contains(table)) {
610
            if (root.contains(table)) {
613
                SQLTable tableCR = root.getTable(table);
611
                SQLTable tableCR = root.getTable(table);
614
                if (!tableCR.contains("ID_AFFAIRE")) {
612
                if (!tableCR.contains("ID_AFFAIRE")) {
615
                    try {
613
                    try {