From 5975348a615aa082553478c9b9ccf76ced23cbda Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 12 Aug 2014 09:52:06 +0200 Subject: [PATCH] IDEMPIERE-2135 Payment Term not applied for Direct Debit invoices --- org.adempiere.base/src/org/compiere/model/MInvoice.java | 2 +- org.adempiere.base/src/org/compiere/model/MOrder.java | 2 +- org.adempiere.base/src/org/compiere/model/MPaymentTerm.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index 3bd6b3a138..13a12db064 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -1450,7 +1450,7 @@ public class MInvoice extends X_C_Invoice implements DocAction } if ( getGrandTotal().signum() != 0 - && PAYMENTRULE_OnCredit.equals(getPaymentRule())) + && (PAYMENTRULE_OnCredit.equals(getPaymentRule()) || PAYMENTRULE_DirectDebit.equals(getPaymentRule()))) { if (!createPaySchedule()) { diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index 187ef96ae0..23f0389722 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -1369,7 +1369,7 @@ public class MOrder extends X_C_Order implements DocAction } if ( getGrandTotal().signum() != 0 - && PAYMENTRULE_OnCredit.equals(getPaymentRule())) + && (PAYMENTRULE_OnCredit.equals(getPaymentRule()) || PAYMENTRULE_DirectDebit.equals(getPaymentRule()))) { if (!createPaySchedule()) { diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java index 2f2da9ca9f..a677ba17b4 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java @@ -203,7 +203,7 @@ public class MPaymentTerm extends X_C_PaymentTerm } // do not apply payment term if the invoice is not on credit or if total is zero - if ( (! MInvoice.PAYMENTRULE_OnCredit.equals(invoice.getPaymentRule()) ) + if ( (! (MInvoice.PAYMENTRULE_OnCredit.equals(invoice.getPaymentRule()) || MInvoice.PAYMENTRULE_DirectDebit.equals(invoice.getPaymentRule()))) || invoice.getGrandTotal().signum() == 0) return false; @@ -308,7 +308,7 @@ public class MPaymentTerm extends X_C_PaymentTerm } // do not apply payment term if the order is not on credit or if total is zero - if ( (! MOrder.PAYMENTRULE_OnCredit.equals(order.getPaymentRule()) ) + if ( (! (MOrder.PAYMENTRULE_OnCredit.equals(order.getPaymentRule()) || MOrder.PAYMENTRULE_DirectDebit.equals(order.getPaymentRule())) ) || order.getGrandTotal().signum() == 0) return false;