OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 182 Rev 185
Line 45... Line 45...
45
        } else {
45
        } else {
46
            nbColis = BigDecimal.ZERO;
46
            nbColis = BigDecimal.ZERO;
47
        }
47
        }
48
 
48
 
49
        final BigDecimal qteUV = sqlRowAccessor.getBigDecimal("QTE_UNITAIRE");
49
        final BigDecimal qteUV = sqlRowAccessor.getBigDecimal("QTE_UNITAIRE");
-
 
50
        final BigDecimal qte = sqlRowAccessor.getTable().getName().equalsIgnoreCase("BON_DE_LIVRAISON_ELEMENT") ? new BigDecimal(sqlRowAccessor.getInt("QTE_LIVREE"))
50
        final BigDecimal qte = new BigDecimal(sqlRowAccessor.getInt("QTE"));
51
                : new BigDecimal(sqlRowAccessor.getInt("QTE"));
51
 
52
 
52
        final BigDecimal tare;
53
        final BigDecimal tare;
53
        if (sqlRowAccessor.getObject("TARE") != null) {
54
        if (sqlRowAccessor.getObject("TARE") != null) {
54
            tare = new BigDecimal(sqlRowAccessor.getInt("NB_COLIS"));
55
            tare = sqlRowAccessor.getBigDecimal("TARE");
55
        } else {
56
        } else {
56
            tare = BigDecimal.ZERO;
57
            tare = BigDecimal.ZERO;
57
        }
58
        }
58
 
59
 
59
        BigDecimal pdsNet = nbColis.multiply(qte).multiply(qteUV);
60
        BigDecimal pdsNet = new BigDecimal(sqlRowAccessor.getFloat("POIDS")).multiply(qte).multiply(qteUV);
60
        if (this.type == TypePoidsDocProvider.POIDS_NET) {
61
        if (this.type == TypePoidsDocProvider.POIDS_NET) {
61
            return pdsNet;
62
            return pdsNet;
62
        } else {
63
        } else {
63
            return pdsNet.add(tare.multiply(nbColis));
64
            return pdsNet.add(tare.multiply(nbColis));
64
        }
65
        }