Improvement for Auto Allocation process - this modification allow the auto allocation process to allocate the remanent portion of partially allocated payments

This commit is contained in:
Carlos Ruiz 2011-03-26 01:46:57 -05:00
parent b69f03010b
commit d442d2fe55
1 changed files with 5 additions and 2 deletions

View File

@ -650,6 +650,7 @@ public class AllocationAuto extends SvrProcess
.add(payment.getDiscountAmt())
.add(payment.getWriteOffAmt())
.add(payment.getOverUnderAmt());
availableAmt = availableAmt.subtract(allocatedAmt);
if (!payment.isReceipt())
availableAmt = availableAmt.negate();
log.fine("Available=" + availableAmt);
@ -704,12 +705,14 @@ public class AllocationAuto extends SvrProcess
if (payment.getC_Currency_ID() != C_Currency_ID)
continue;
BigDecimal allocatedAmt = payment.getAllocatedAmt();
if (allocatedAmt != null && allocatedAmt.signum() != 0)
continue;
// comment following lines to allow partial allocation
// if (allocatedAmt != null && allocatedAmt.signum() != 0)
// continue;
BigDecimal availableAmt = payment.getPayAmt()
.add(payment.getDiscountAmt())
.add(payment.getWriteOffAmt())
.add(payment.getOverUnderAmt());
availableAmt = availableAmt.subtract(allocatedAmt);
if (!payment.isReceipt())
availableAmt = availableAmt.negate();
allocatedPayments = allocatedPayments.add(availableAmt);