OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 73 Rev 83
Line 29... Line 29...
29
        final SQLTable tableBon = getSource();
29
        final SQLTable tableBon = getSource();
30
        final SQLTable tableFacture = getDestination();
30
        final SQLTable tableFacture = getDestination();
31
        // map(tableDevis.getField("PORT_HT"), tableCommande.getField("PORT_HT"));
31
        // map(tableDevis.getField("PORT_HT"), tableCommande.getField("PORT_HT"));
32
        // map(tableDevis.getField("REMISE_HT"), tableCommande.getField("REMISE_HT"));
32
        // map(tableDevis.getField("REMISE_HT"), tableCommande.getField("REMISE_HT"));
33
        map(tableBon.getField("ID_CLIENT"), tableFacture.getField("ID_CLIENT"));
33
        map(tableBon.getField("ID_CLIENT"), tableFacture.getField("ID_CLIENT"));
34
        map(tableBon.getField("NOM"), tableFacture.getField("NOM"));
34
        if (tableBon.getTable().contains("ID_POLE_PRODUIT")) {
35
        map(tableBon.getField("INFOS"), tableFacture.getField("INFOS"));
35
            map(tableBon.getField("ID_POLE_PRODUIT"), tableFacture.getField("ID_POLE_PRODUIT"));
-
 
36
        }
36
    }
37
    }
37
 
38
 
38
    @Override
39
    @Override
39
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
40
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
40
        super.merge(srcRow, rowVals);
41
        super.merge(srcRow, rowVals);
41
 
42
 
42
        // Merge elements
43
        // Merge elements
43
        final SQLTable tableElementSource = getSource().getTable("BON_DE_LIVRAISON_ELEMENT");
44
        final SQLTable tableElementSource = getSource().getTable("BON_DE_LIVRAISON_ELEMENT");
44
        final SQLTable tableElementDestination = getSource().getTable("SAISIE_VENTE_FACTURE_ELEMENT");
45
        final SQLTable tableElementDestination = getSource().getTable("SAISIE_VENTE_FACTURE_ELEMENT");
45
        final Collection<? extends SQLRowAccessor> myListItem = srcRow.asRow().getReferentRows(tableElementSource);
46
        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_SAISIE_VENTE_FACTURE");
46
 
50
 
47
        if (myListItem.size() != 0) {
51
        if (myListItem.size() != 0) {
48
            final SQLInjector injector = SQLInjector.getInjector(tableElementSource, tableElementDestination);
52
            final SQLInjector injector = SQLInjector.getInjector(tableElementSource, tableElementDestination);
49
            for (SQLRowAccessor rowElt : myListItem) {
53
            for (SQLRowAccessor rowElt : myListItem) {
50
                final SQLRowValues createRowValuesFrom = injector.createRowValuesFrom(rowElt.asRow());
54
                final SQLRowValues createRowValuesFrom = injector.createRowValuesFrom(rowElt.asRow());