IDEMPIERE-1307 Voiding allocation header keeps payment allocated. Base on patch from Richard Morales Herrera.

This commit is contained in:
Heng Sin Low 2013-09-05 11:48:28 +08:00
parent f3877f9a3d
commit 621b995aa4
2 changed files with 14 additions and 5 deletions

View File

@ -266,7 +266,7 @@ public class MAllocationLine extends X_C_AllocationLine
log.warning("C_BPartner_ID different - Invoice=" + getC_BPartner_ID() + " - Payment=" + payment.getC_BPartner_ID());
if (reverse)
{
if (!payment.isCashTrx())
if (!payment.isCashbookTrx())
{
payment.setIsAllocated(false);
payment.saveEx();

View File

@ -200,7 +200,7 @@ public final class MPayment extends X_C_Payment
} // resetNew
/**
* Is Cashbook Transfer Trx
* Is Cash Trx
* @return true if Cash Trx
*/
public boolean isCashTrx()
@ -208,6 +208,14 @@ public final class MPayment extends X_C_Payment
return "X".equals(getTenderType());
} // isCashTrx
/**
* Is Cashbook Trx
* @return true if this is a cashbook trx
*/
public boolean isCashbookTrx() {
return isCashTrx() && !MSysConfig.getBooleanValue(MSysConfig.CASH_AS_PAYMENT, true , getAD_Client_ID());
}
/**************************************************************************
* Set Credit Card.
* Need to set PatmentProcessor after Amount/Currency Set
@ -650,7 +658,7 @@ public final class MPayment extends X_C_Payment
{
// @Trifon - CashPayments
//if ( getTenderType().equals("X") ) {
if ( isCashTrx() && !MSysConfig.getBooleanValue(MSysConfig.CASH_AS_PAYMENT, true , getAD_Client_ID())) {
if ( isCashbookTrx()) {
// Cash Book Is mandatory
if ( getC_CashBook_ID() <= 0 ) {
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_CashBook_ID@"));
@ -1965,7 +1973,7 @@ public final class MPayment extends X_C_Payment
// @Trifon - CashPayments
//if ( getTenderType().equals("X") ) {
if ( isCashTrx() && !MSysConfig.getBooleanValue(MSysConfig.CASH_AS_PAYMENT, true , getAD_Client_ID())) {
if ( isCashbookTrx()) {
// Create Cash Book entry
if ( getC_CashBook_ID() <= 0 ) {
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_CashBook_ID@"));
@ -2048,6 +2056,7 @@ public final class MPayment extends X_C_Payment
return DocAction.STATUS_Completed;
} // completeIt
/**
* Set the definite document number after completed
*/