OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 149 Rev 174
Line 32... Line 32...
32
            map(getSource().getField("TOTAL_POIDS"), getDestination().getField("T_POIDS"));
32
            map(getSource().getField("TOTAL_POIDS"), getDestination().getField("T_POIDS"));
33
            map(getSource().getField("REMISE_HT"), getDestination().getField("REMISE_HT"));
33
            map(getSource().getField("REMISE_HT"), getDestination().getField("REMISE_HT"));
34
            map(getSource().getField("PORT_HT"), getDestination().getField("PORT_HT"));
34
            map(getSource().getField("PORT_HT"), getDestination().getField("PORT_HT"));
35
            map(getSource().getField("ID_TAXE_PORT"), getDestination().getField("ID_TAXE_PORT"));
35
            map(getSource().getField("ID_TAXE_PORT"), getDestination().getField("ID_TAXE_PORT"));
36
        }
36
        }
-
 
37
        if (getSource().contains("ID_AFFAIRE") && getDestination().contains("ID_AFFAIRE")) {
-
 
38
            map(getSource().getField("ID_AFFAIRE"), getDestination().getField("ID_AFFAIRE"));
-
 
39
        }
-
 
40
        if (getSource().contains("ID_POLE_PRODUIT") && getDestination().contains("ID_POLE_PRODUIT")) {
-
 
41
            map(getSource().getField("ID_POLE_PRODUIT"), getDestination().getField("ID_POLE_PRODUIT"));
-
 
42
        }
37
    }
43
    }
38
 
44
 
39
    @Override
45
    @Override
40
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
46
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
41
        super.merge(srcRow, rowVals);
47
        super.merge(srcRow, rowVals);
42
 
48
 
43
        // Merge elements
49
        // Merge elements
44
        final SQLTable tableElementSource = getSource().getTable("BON_RECEPTION_ELEMENT");
50
        final SQLTable tableElementSource = getSource().getTable("BON_RECEPTION_ELEMENT");
45
        final SQLTable tableElementDestination = getSource().getTable("FACTURE_FOURNISSEUR_ELEMENT");
51
        final SQLTable tableElementDestination = getSource().getTable("FACTURE_FOURNISSEUR_ELEMENT");
46
        final Collection<? extends SQLRowAccessor> myListItem = srcRow.asRow().getReferentRows(tableElementSource);
52
        final Collection<? extends SQLRowAccessor> myListItem = srcRow.asRow().getReferentRows(tableElementSource);
47
        transfertReference(srcRow, rowVals, "NOM", "NOM");
-
 
48
        transfertReference(srcRow, rowVals, "INFOS", "INFOS");
-
 
49
        transfertNumberReference(srcRow, rowVals, tableElementDestination, "ID_FACTURE_FOURNISSEUR");
53
        transfertNumberReference(srcRow, rowVals, tableElementDestination, "ID_FACTURE_FOURNISSEUR");
-
 
54
        transfertReference(srcRow, rowVals, tableElementDestination, "ID_FACTURE_FOURNISSEUR", "NOM", "NOM");
-
 
55
        transfertReference(srcRow, rowVals, tableElementDestination, "ID_FACTURE_FOURNISSEUR", "INFOS", "INFOS");
50
        if (myListItem.size() != 0) {
56
        if (myListItem.size() != 0) {
51
            final SQLInjector injector = SQLInjector.getInjector(tableElementSource, tableElementDestination);
57
            final SQLInjector injector = SQLInjector.getInjector(tableElementSource, tableElementDestination);
52
            for (SQLRowAccessor rowElt : myListItem) {
58
            for (SQLRowAccessor rowElt : myListItem) {
53
                final SQLRowValues createRowValuesFrom = injector.createRowValuesFrom(rowElt.asRow());
59
                final SQLRowValues createRowValuesFrom = injector.createRowValuesFrom(rowElt.asRow());
54
                if (createRowValuesFrom.getTable().getFieldsName().contains("POURCENT_ACOMPTE")) {
60
                if (createRowValuesFrom.getTable().getFieldsName().contains("POURCENT_ACOMPTE")) {