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 41... Line 41...
41
        this.type = t;
41
        this.type = t;
42
        this.alwaysShowOnZeroQty = alwaysShowOnZeroQty;
42
        this.alwaysShowOnZeroQty = alwaysShowOnZeroQty;
43
        this.pieceName = withPieceName;
43
        this.pieceName = withPieceName;
44
    }
44
    }
45
 
45
 
-
 
46
    private final BigDecimal cent = new BigDecimal(100);
-
 
47
 
46
    public Object getValue(SpreadSheetCellValueContext context) {
48
    public Object getValue(SpreadSheetCellValueContext context) {
47
        final SQLRowAccessor row = context.getRow();
49
        final SQLRowAccessor row = context.getRow();
48
        final BigDecimal pv = row.getBigDecimal("PV_HT");
50
        final BigDecimal pv = row.getBigDecimal("PV_HT");
-
 
51
        final BigDecimal pR = row.getBigDecimal("POURCENT_REMISE");
49
        if (!this.alwaysShowOnZeroQty && pv != null && pv.compareTo(BigDecimal.ZERO) == 0) {
52
        if (!this.alwaysShowOnZeroQty && pv != null && pv.compareTo(BigDecimal.ZERO) == 0 && (pR == null || pR.compareTo(cent) != 0)) {
50
            return null;
53
            return null;
51
        }
54
        }
52
 
55
 
53
        final String field;
56
        final String field;
54
        if (this.type == Type.NORMAL) {
57
        if (this.type == Type.NORMAL) {