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,10 +1342,20 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
return DocAction.STATUS_Invalid;
|
return DocAction.STATUS_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!createPaySchedule())
|
if ( getGrandTotal().signum() != 0
|
||||||
|
&& PAYMENTRULE_OnCredit.equals(getPaymentRule()))
|
||||||
{
|
{
|
||||||
m_processMsg = "@ErrorPaymentSchedule@";
|
if (!createPaySchedule())
|
||||||
return DocAction.STATUS_Invalid;
|
{
|
||||||
|
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
|
// Credit Status
|
||||||
|
|
|
@ -1285,10 +1285,20 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
return DocAction.STATUS_Invalid;
|
return DocAction.STATUS_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!createPaySchedule())
|
if ( getGrandTotal().signum() != 0
|
||||||
|
&& PAYMENTRULE_OnCredit.equals(getPaymentRule()))
|
||||||
{
|
{
|
||||||
m_processMsg = "@ErrorPaymentSchedule@";
|
if (!createPaySchedule())
|
||||||
return DocAction.STATUS_Invalid;
|
{
|
||||||
|
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
|
// Credit Check
|
||||||
|
|
|
@ -211,6 +211,11 @@ public class MPaymentTerm extends X_C_PaymentTerm
|
||||||
return false;
|
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())
|
if (!isValid())
|
||||||
return applyNoSchedule (invoice);
|
return applyNoSchedule (invoice);
|
||||||
//
|
//
|
||||||
|
@ -310,7 +315,12 @@ public class MPaymentTerm extends X_C_PaymentTerm
|
||||||
log.log(Level.SEVERE, "No valid order - " + order);
|
log.log(Level.SEVERE, "No valid order - " + order);
|
||||||
return false;
|
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())
|
if (!isValid())
|
||||||
return applyOrderNoSchedule (order);
|
return applyOrderNoSchedule (order);
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue