public boolean testAllocation(){
  boolean change=false;
  if (isProcessed()) {
    BigDecimal alloc=getAllocatedAmt();
    if (alloc == null)     alloc=Env.ZERO;
    BigDecimal total=getGrandTotal();
    if (!isSOTrx())     total=total.negate();
    if (isCreditMemo())     total=total.negate();
    boolean test=total.compareTo(alloc) == 0;
    change=test != isPaid();
    if (change)     setIsPaid(test);
    log.fine("Paid=" + test + " ("+ alloc+ "="+ total+ ")");
  }
  return change;
}

public boolean testAllocation ( ) { boolean change = false ; if ( isProcessed ( ) ) { BigDecimal alloc = getAllocatedAmt ( ) ; if ( alloc == null ) alloc = Env . ZERO ; BigDecimal total = getGrandTotal ( ) ; if ( ! isSOTrx ( ) ) total = total . negate ( ) ; if ( isCreditMemo ( ) ) total = total . negate ( ) ; boolean test = total . compareTo ( alloc ) == 0 ; change = test != isPaid ( ) ; if ( change ) setIsPaid ( test ) ; log . fine ( "Paid=" + test + " (" + alloc + "=" + total + ")" ) ; } return change ; }
test allocation ( and set paid flag )
