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 70... Line 70...
70
        }
70
        }
71
 
71
 
72
        if (tableFacture.contains("CREATE_VIRTUAL_STOCK")) {
72
        if (tableFacture.contains("CREATE_VIRTUAL_STOCK")) {
73
            mapDefaultValues(tableFacture.getField("CREATE_VIRTUAL_STOCK"), Boolean.FALSE);
73
            mapDefaultValues(tableFacture.getField("CREATE_VIRTUAL_STOCK"), Boolean.FALSE);
74
        }
74
        }
-
 
75
        if (getSource().getTable().contains("ID_CATEGORIE_COMPTABLE") && getDestination().getTable().contains("ID_CATEGORIE_COMPTABLE")) {
-
 
76
            map(getSource().getField("ID_CATEGORIE_COMPTABLE"), getDestination().getField("ID_CATEGORIE_COMPTABLE"));
75
 
77
        }
76
    }
78
    }
77
 
79
 
78
    @Override
80
    @Override
79
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
81
    protected void merge(SQLRowAccessor srcRow, SQLRowValues rowVals) {
80
        super.merge(srcRow, rowVals);
82
        super.merge(srcRow, rowVals);
81
 
83
 
82
        // Merge elements
84
        // Merge elements
83
        final SQLTable tableElementSource = getSource().getTable("COMMANDE_CLIENT_ELEMENT");
85
        final SQLTable tableElementSource = getSource().getTable("COMMANDE_CLIENT_ELEMENT");
84
        final SQLTable tableElementDestination = getSource().getTable("SAISIE_VENTE_FACTURE_ELEMENT");
86
        final SQLTable tableElementDestination = getSource().getTable("SAISIE_VENTE_FACTURE_ELEMENT");
85
        final Collection<? extends SQLRowAccessor> myListItem = srcRow.asRow().getReferentRows(tableElementSource);
87
        final Collection<? extends SQLRowAccessor> myListItem = srcRow.asRow().getReferentRows(tableElementSource);
86
        transfertReference(srcRow, rowVals, "NOM", "NOM");
-
 
87
        transfertReference(srcRow, rowVals, "INFOS", "INFOS");
-
 
88
        transfertNumberReference(srcRow, rowVals, tableElementDestination, "ID_SAISIE_VENTE_FACTURE");
88
        transfertNumberReference(srcRow, rowVals, tableElementDestination, "ID_SAISIE_VENTE_FACTURE");
-
 
89
        transfertReference(srcRow, rowVals, tableElementDestination, "ID_SAISIE_VENTE_FACTURE", "NOM", "NOM");
-
 
90
        transfertReference(srcRow, rowVals, tableElementDestination, "ID_SAISIE_VENTE_FACTURE", "INFOS", "INFOS");
89
        if (getDestination().contains("ID_TAXE_FRAIS_DOCUMENT")) {
91
        if (getDestination().contains("ID_TAXE_FRAIS_DOCUMENT")) {
90
            final SQLRowAccessor rowClient = srcRow.getForeign("ID_CLIENT");
92
            final SQLRowAccessor rowClient = srcRow.getForeign("ID_CLIENT");
91
            SQLRowAccessor rowFrais = rowClient.getForeign("ID_FRAIS_DOCUMENT");
93
            SQLRowAccessor rowFrais = rowClient.getForeign("ID_FRAIS_DOCUMENT");
92
            if (rowFrais != null && !rowFrais.isUndefined()) {
94
            if (rowFrais != null && !rowFrais.isUndefined()) {
93
                rowVals.put("FRAIS_DOCUMENT_HT", rowFrais.getLong("MONTANT_HT"));
95
                rowVals.put("FRAIS_DOCUMENT_HT", rowFrais.getLong("MONTANT_HT"));