FR [3132797] - FS02 Cash Flow
http://www.adempiere.com/index.php/FS02_Cash_Flow https://sourceforge.net/tracker/?func=detail&aid=3132797&group_id=176962&atid=879335 Fix problem reported by hardmax https://sourceforge.net/projects/adempiere/forums/forum/610548/topic/3880506?message=8936691
This commit is contained in:
parent
278febbefb
commit
7a41c80694
|
@ -1342,11 +1342,21 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
if ( getGrandTotal().signum() != 0
|
||||
&& PAYMENTRULE_OnCredit.equals(getPaymentRule()))
|
||||
{
|
||||
if (!createPaySchedule())
|
||||
{
|
||||
m_processMsg = "@ErrorPaymentSchedule@";
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
} else {
|
||||
if (MInvoicePaySchedule.getInvoicePaySchedule(getCtx(), getC_Invoice_ID(), 0, get_TrxName()).length > 0)
|
||||
{
|
||||
m_processMsg = "@ErrorPaymentSchedule@";
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
}
|
||||
|
||||
// Credit Status
|
||||
if (isSOTrx() && !isReversal())
|
||||
|
|
|
@ -1285,11 +1285,21 @@ public class MOrder extends X_C_Order implements DocAction
|
|||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
if ( getGrandTotal().signum() != 0
|
||||
&& PAYMENTRULE_OnCredit.equals(getPaymentRule()))
|
||||
{
|
||||
if (!createPaySchedule())
|
||||
{
|
||||
m_processMsg = "@ErrorPaymentSchedule@";
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
} else {
|
||||
if (MOrderPaySchedule.getOrderPaySchedule(getCtx(), getC_Order_ID(), 0, get_TrxName()).length > 0)
|
||||
{
|
||||
m_processMsg = "@ErrorPaymentSchedule@";
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
}
|
||||
|
||||
// Credit Check
|
||||
if (isSOTrx())
|
||||
|
|
|
@ -211,6 +211,11 @@ public class MPaymentTerm extends X_C_PaymentTerm
|
|||
return false;
|
||||
}
|
||||
|
||||
// do not apply payment term if the invoice is not on credit or if total is zero
|
||||
if ( (! MInvoice.PAYMENTRULE_OnCredit.equals(invoice.getPaymentRule()) )
|
||||
|| invoice.getGrandTotal().signum() == 0)
|
||||
return false;
|
||||
|
||||
if (!isValid())
|
||||
return applyNoSchedule (invoice);
|
||||
//
|
||||
|
@ -311,6 +316,11 @@ public class MPaymentTerm extends X_C_PaymentTerm
|
|||
return false;
|
||||
}
|
||||
|
||||
// do not apply payment term if the order is not on credit or if total is zero
|
||||
if ( (! MOrder.PAYMENTRULE_OnCredit.equals(order.getPaymentRule()) )
|
||||
|| order.getGrandTotal().signum() == 0)
|
||||
return false;
|
||||
|
||||
if (!isValid())
|
||||
return applyOrderNoSchedule (order);
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue