OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 156 Rev 174
Line 43... Line 43...
43
            map(getSource().getField("ID_ADRESSE"), getDestination().getField("ID_ADRESSE"));
43
            map(getSource().getField("ID_ADRESSE"), getDestination().getField("ID_ADRESSE"));
44
        }
44
        }
45
        if (getSource().getTable().contains("ID_ADRESSE_LIVRAISON")) {
45
        if (getSource().getTable().contains("ID_ADRESSE_LIVRAISON")) {
46
            map(getSource().getField("ID_ADRESSE_LIVRAISON"), getDestination().getField("ID_ADRESSE_LIVRAISON"));
46
            map(getSource().getField("ID_ADRESSE_LIVRAISON"), getDestination().getField("ID_ADRESSE_LIVRAISON"));
47
        }
47
        }
-
 
48
        if (getSource().getTable().contains("ID_CATEGORIE_COMPTABLE") && getDestination().getTable().contains("ID_CATEGORIE_COMPTABLE")) {
-
 
49
            map(getSource().getField("ID_CATEGORIE_COMPTABLE"), getDestination().getField("ID_CATEGORIE_COMPTABLE"));
-
 
50
        }
48
    }
51
    }
49
 
52
 
50
    @Override
53
    @Override
51
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
54
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
52
        super.merge(srcRow, rowVals);
55
        super.merge(srcRow, rowVals);
53
 
56
 
54
        // Merge elements
57
        // Merge elements
55
        final SQLTable tableElementSource = getSource().getTable("DEVIS_ELEMENT");
58
        final SQLTable tableElementSource = getSource().getTable("DEVIS_ELEMENT");
56
        final SQLTable tableElementDestination = getSource().getTable("BON_DE_LIVRAISON_ELEMENT");
59
        final SQLTable tableElementDestination = getSource().getTable("BON_DE_LIVRAISON_ELEMENT");
57
        final Collection<? extends SQLRowAccessor> myListItem = srcRow.asRow().getReferentRows(tableElementSource);
60
        final Collection<? extends SQLRowAccessor> myListItem = srcRow.asRow().getReferentRows(tableElementSource);
58
        transfertReference(srcRow, rowVals, "NOM", "NOM");
-
 
59
        transfertReference(srcRow, rowVals, "INFOS", "INFOS");
-
 
60
        transfertNumberReference(srcRow, rowVals, tableElementDestination, "ID_BON_DE_LIVRAISON");
61
        transfertNumberReference(srcRow, rowVals, tableElementDestination, "ID_BON_DE_LIVRAISON");
-
 
62
        transfertReference(srcRow, rowVals, tableElementDestination, "ID_BON_DE_LIVRAISON", "NOM", "NOM");
-
 
63
        transfertReference(srcRow, rowVals, tableElementDestination, "ID_BON_DE_LIVRAISON", "INFOS", "INFOS");
61
 
64
 
62
        if (myListItem.size() != 0) {
65
        if (myListItem.size() != 0) {
63
            final SQLInjector injector = SQLInjector.getInjector(tableElementSource, tableElementDestination);
66
            final SQLInjector injector = SQLInjector.getInjector(tableElementSource, tableElementDestination);
64
            for (SQLRowAccessor rowElt : myListItem) {
67
            for (SQLRowAccessor rowElt : myListItem) {
65
                final SQLRowValues createRowValuesFrom = injector.createRowValuesFrom(rowElt.asRow());
68
                final SQLRowValues createRowValuesFrom = injector.createRowValuesFrom(rowElt.asRow());