IDEMPIERE-4020 Payment Reverse/Correct with C_Project_ID generating wrong GL postings

This commit is contained in:
hengsin 2020-02-11 13:30:25 +08:00
parent 74a84a9fa4
commit 5b9f61ae52
1 changed files with 14 additions and 4 deletions

View File

@ -726,10 +726,20 @@ public class MPayment extends X_C_Payment
if (newRecord
|| is_ValueChanged("C_Charge_ID") || is_ValueChanged("C_Invoice_ID")
|| is_ValueChanged("C_Order_ID") || is_ValueChanged("C_Project_ID"))
setIsPrepayment (getC_Charge_ID() == 0
&& getC_BPartner_ID() != 0
&& (getC_Order_ID() != 0
|| (getC_Project_ID() != 0 && getC_Invoice_ID() == 0)));
{
if (getReversal_ID() > 0)
{
setIsPrepayment(getReversal().isPrepayment());
}
else
{
setIsPrepayment (getC_Charge_ID() == 0
&& getC_BPartner_ID() != 0
&& (getC_Order_ID() != 0
|| (getC_Project_ID() != 0 && getC_Invoice_ID() == 0)));
}
}
if (isPrepayment())
{
if (newRecord