IDEMPIERE-860 Review Payment Processors
- fix the payment amount and invoice ID reference of the new sales payment when invoiced amount is NOT equals to the authorized amount - throw error when invoiced amount is NOT equals to the authorized amount for non-CIM payment processor
This commit is contained in:
parent
4100d6ba55
commit
d2c3c23d9d
|
@ -1990,6 +1990,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
// automatically void authorization payment and create a new sales payment when invoiced amount is NOT equals to the authorized amount (applied to CIM payment processor)
|
||||
if(getGrandTotal().compareTo(totalPayAmt) != 0 &&
|
||||
ptList.size() > 0 &&
|
||||
ptList.get(0).getC_PaymentProcessor_ID() > 0 &&
|
||||
ptList.get(0).getCustomerPaymentProfileID() != null &&
|
||||
ptList.get(0).getCustomerPaymentProfileID().length() > 0)
|
||||
{
|
||||
|
@ -1998,12 +1999,14 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
newSalesPT.setIsApproved(false);
|
||||
newSalesPT.setIsVoided(false);
|
||||
newSalesPT.setIsDelayedCapture(false);
|
||||
newSalesPT.setDescription("InvoicedAmt: " + getGrandTotal() + " > TotalAuthorizedAmt: " + totalPayAmt);
|
||||
newSalesPT.setDescription("InvoicedAmt: " + getGrandTotal() + " <> TotalAuthorizedAmt: " + totalPayAmt);
|
||||
newSalesPT.setC_Invoice_ID(getC_Invoice_ID());
|
||||
newSalesPT.setPayAmt(getGrandTotal());
|
||||
|
||||
// void authorization payment
|
||||
for (MPaymentTransaction pt : ptList)
|
||||
{
|
||||
pt.setDescription("InvoicedAmt: " + getGrandTotal() + " > AuthorizedAmt: " + pt.getPayAmt());
|
||||
pt.setDescription("InvoicedAmt: " + getGrandTotal() + " <> AuthorizedAmt: " + pt.getPayAmt());
|
||||
boolean ok = pt.voidOnlineAuthorizationPaymentTransaction();
|
||||
pt.saveEx();
|
||||
if (!ok)
|
||||
|
@ -2022,6 +2025,11 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
}
|
||||
else if (getGrandTotal().compareTo(totalPayAmt) != 0 && ptList.size() > 0)
|
||||
{
|
||||
m_processMsg = "InvoicedAmt: " + getGrandTotal() + " <> AuthorizedAmt: " + totalPayAmt;
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
else
|
||||
{
|
||||
// delay capture authorization payment
|
||||
|
|
Loading…
Reference in New Issue