IDEMPIERE-3099 AP Credit Memo, Rule: Cash Generate Payment with wrong amount

This commit is contained in:
Carlos Ruiz 2018-01-22 19:28:28 +01:00
parent 470b3d45cc
commit 339f171f65
1 changed files with 4 additions and 1 deletions

View File

@ -1778,7 +1778,10 @@ public class MInvoice extends X_C_Invoice implements DocAction
payment.setC_Invoice_ID(getC_Invoice_ID());
payment.setC_Currency_ID(getC_Currency_ID());
payment.setC_DocType_ID(doctype.getC_DocType_ID());
payment.setPayAmt(getGrandTotal());
if (isCreditMemo())
payment.setPayAmt(getGrandTotal().negate());
else
payment.setPayAmt(getGrandTotal());
payment.setIsPrepayment(false);
payment.setDateAcct(getDateAcct());
payment.setDateTrx(getDateInvoiced());