IDEMPIERE-6257: WListbox cannot add total line for Integer (#2470)
* IDEMPIERE-6257: WListbox cannot add total line for Integer * IDEMPIERE-6257: WListbox cannot add total line for Integer implement Carlos's suggestion (to reduce number of lines) Co-Authored-By: Carlos Ruiz <carg67@gmail.com> --------- Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
parent
f60f599619
commit
43c78b3018
|
|
@ -1234,7 +1234,19 @@ public class WListbox extends Listbox implements IMiniTable, TableValueChangeLis
|
||||||
if(amt == null )
|
if(amt == null )
|
||||||
amt = Double.valueOf(0);
|
amt = Double.valueOf(0);
|
||||||
total[col] = subtotal + amt;
|
total[col] = subtotal + amt;
|
||||||
|
}
|
||||||
|
else if (c == Integer.class)
|
||||||
|
{
|
||||||
|
Integer subtotal = Integer.valueOf(0);
|
||||||
|
if(total[col] != null)
|
||||||
|
subtotal = (Integer)(total[col]);
|
||||||
|
|
||||||
|
Integer amt = (Integer) data;
|
||||||
|
if(subtotal == null)
|
||||||
|
subtotal = Integer.valueOf(0);
|
||||||
|
if(amt == null )
|
||||||
|
amt = Integer.valueOf(0);
|
||||||
|
total[col] = subtotal + amt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1246,11 +1258,7 @@ public class WListbox extends Listbox implements IMiniTable, TableValueChangeLis
|
||||||
for (int col = 0; col < layout.length; col++)
|
for (int col = 0; col < layout.length; col++)
|
||||||
{
|
{
|
||||||
Class<?> c = layout[col].getColClass();
|
Class<?> c = layout[col].getColClass();
|
||||||
if (c == BigDecimal.class)
|
if (c == BigDecimal.class || c == Double.class || c == Integer.class)
|
||||||
{
|
|
||||||
setValueAt(total[col] , row - 1, col);
|
|
||||||
}
|
|
||||||
else if (c == Double.class)
|
|
||||||
{
|
{
|
||||||
setValueAt(total[col] , row - 1, col);
|
setValueAt(total[col] , row - 1, col);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue