IDEMPIERE-1307 Voiding allocation header keeps payment allocated. Base on patch from Richard Morales Herrera.
This commit is contained in:
parent
f3877f9a3d
commit
621b995aa4
|
@ -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());
|
log.warning("C_BPartner_ID different - Invoice=" + getC_BPartner_ID() + " - Payment=" + payment.getC_BPartner_ID());
|
||||||
if (reverse)
|
if (reverse)
|
||||||
{
|
{
|
||||||
if (!payment.isCashTrx())
|
if (!payment.isCashbookTrx())
|
||||||
{
|
{
|
||||||
payment.setIsAllocated(false);
|
payment.setIsAllocated(false);
|
||||||
payment.saveEx();
|
payment.saveEx();
|
||||||
|
|
|
@ -200,7 +200,7 @@ public final class MPayment extends X_C_Payment
|
||||||
} // resetNew
|
} // resetNew
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is Cashbook Transfer Trx
|
* Is Cash Trx
|
||||||
* @return true if Cash Trx
|
* @return true if Cash Trx
|
||||||
*/
|
*/
|
||||||
public boolean isCashTrx()
|
public boolean isCashTrx()
|
||||||
|
@ -208,6 +208,14 @@ public final class MPayment extends X_C_Payment
|
||||||
return "X".equals(getTenderType());
|
return "X".equals(getTenderType());
|
||||||
} // isCashTrx
|
} // 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.
|
* Set Credit Card.
|
||||||
* Need to set PatmentProcessor after Amount/Currency Set
|
* Need to set PatmentProcessor after Amount/Currency Set
|
||||||
|
@ -650,7 +658,7 @@ public final class MPayment extends X_C_Payment
|
||||||
{
|
{
|
||||||
// @Trifon - CashPayments
|
// @Trifon - CashPayments
|
||||||
//if ( getTenderType().equals("X") ) {
|
//if ( getTenderType().equals("X") ) {
|
||||||
if ( isCashTrx() && !MSysConfig.getBooleanValue(MSysConfig.CASH_AS_PAYMENT, true , getAD_Client_ID())) {
|
if ( isCashbookTrx()) {
|
||||||
// Cash Book Is mandatory
|
// Cash Book Is mandatory
|
||||||
if ( getC_CashBook_ID() <= 0 ) {
|
if ( getC_CashBook_ID() <= 0 ) {
|
||||||
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_CashBook_ID@"));
|
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_CashBook_ID@"));
|
||||||
|
@ -1965,7 +1973,7 @@ public final class MPayment extends X_C_Payment
|
||||||
|
|
||||||
// @Trifon - CashPayments
|
// @Trifon - CashPayments
|
||||||
//if ( getTenderType().equals("X") ) {
|
//if ( getTenderType().equals("X") ) {
|
||||||
if ( isCashTrx() && !MSysConfig.getBooleanValue(MSysConfig.CASH_AS_PAYMENT, true , getAD_Client_ID())) {
|
if ( isCashbookTrx()) {
|
||||||
// Create Cash Book entry
|
// Create Cash Book entry
|
||||||
if ( getC_CashBook_ID() <= 0 ) {
|
if ( getC_CashBook_ID() <= 0 ) {
|
||||||
log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_CashBook_ID@"));
|
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;
|
return DocAction.STATUS_Completed;
|
||||||
} // completeIt
|
} // completeIt
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the definite document number after completed
|
* Set the definite document number after completed
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue