OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 173 → Rev 174

/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/product/ui/CurrencyWithSymbolRenderer.java
34,6 → 34,8
private final FieldPath fieldPath;
private final CurrencyConverter c;
 
private boolean hideZeroValue = false;
 
private String getSymbol(String currencyCode) {
// Because Java Currency return PLN as Symbol for Zl, we use our own talbe
return org.openconcerto.erp.core.finance.accounting.model.Currency.getSymbol(currencyCode);
46,6 → 48,10
this(null);
}
 
public void setHideZeroValue(boolean hideZeroValue) {
this.hideZeroValue = hideZeroValue;
}
 
/**
* Affiche une valeur monétaire en ajoutant le symbole de la devise du path
*
60,8 → 66,13
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
 
if (value != null) {
value = GestionDevise.currencyToString((BigDecimal) value);
BigDecimal amount = (BigDecimal) value;
 
if (this.hideZeroValue && amount.signum() == 0) {
value = "";
} else {
value = GestionDevise.currencyToString(amount);
 
if (fieldPath == null) {
value = value + " " + getSymbol(c.getCompanyCurrencyCode());
} else {
78,7 → 89,8
// reprend
// pas les valeurs de la SQLRow (ex : si on veut récupérer la devise du
// fournisseur
// sélectionné, getDistantRow ira chercher la valeur du fournisseur référencé en
// sélectionné, getDistantRow ira chercher la valeur du fournisseur
// référencé en
// BDD
// et non dans la SQLRow)
 
108,6 → 120,7
}
}
}
}
setHorizontalAlignment(SwingConstants.RIGHT);
 
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);