IDEMPIERE-3594 Wrong callout rules for PaymentRule

This commit is contained in:
Carlos Ruiz 2017-12-31 12:11:17 +01:00
parent 9683bd7ea5
commit 62e61b2833
3 changed files with 7 additions and 33 deletions

View File

@ -90,9 +90,9 @@ public class CalloutInvoice extends CalloutEngine
Env.setContext(ctx, WindowNo, "DocBaseType", s);
// AP Check & AR Credit Memo
if (s.startsWith("AP"))
mTab.setValue("PaymentRule", "S"); // Check
mTab.setValue("PaymentRule", X_C_Invoice.PAYMENTRULE_Check);
else if (s.endsWith("C"))
mTab.setValue("PaymentRule", "P"); // OnCredit
mTab.setValue("PaymentRule", X_C_Invoice.PAYMENTRULE_OnCredit);
}
}
catch (SQLException e)
@ -186,13 +186,9 @@ public class CalloutInvoice extends CalloutEngine
// PaymentRule
String s = rs.getString(IsSOTrx ? "PaymentRule" : "PaymentRulePO");
if (s != null && s.length() != 0)
{
if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term
s = "P";
else if (IsSOTrx && (s.equals("S") || s.equals("U"))) // No Check/Transfer for SO_Trx
s = "P"; // Payment Term
mTab.setValue("PaymentRule", s);
}
if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term
s = X_C_Invoice.PAYMENTRULE_OnCredit;
// Payment Term
ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull())

View File

@ -105,13 +105,9 @@ public class CalloutInvoiceBatch extends CalloutEngine
// PaymentRule
String s = rs.getString(IsSOTrx ? "PaymentRule" : "PaymentRulePO");
if (s != null && s.length() != 0)
{
if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term
s = "P";
else if (IsSOTrx && (s.equals("S") || s.equals("U"))) // No Check/Transfer for SO_Trx
s = "P"; // Payment Term
// mTab.setValue("PaymentRule", s);
}
mTab.setValue("PaymentRule", s);
if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term
s = X_C_Invoice.PAYMENTRULE_OnCredit;
// Payment Term
Integer ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull())

View File

@ -184,13 +184,7 @@ public class CalloutOrder extends CalloutEngine
// PaymentRule
String s = rs.getString(IsSOTrx ? "PaymentRule" : "PaymentRulePO");
if (s != null && s.length() != 0)
{
if (IsSOTrx && (s.equals("B") || s.equals("S") || s.equals("U"))) // No Cash/Check/Transfer for SO_Trx
s = "P"; // Payment Term
if (!IsSOTrx && (s.equals("B"))) // No Cash for PO_Trx
s = "P"; // Payment Term
mTab.setValue("PaymentRule", s);
}
// Payment Term
Integer ii =new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull())
@ -404,13 +398,7 @@ public class CalloutOrder extends CalloutEngine
// PaymentRule
s = rs.getString(IsSOTrx ? "PaymentRule" : "PaymentRulePO");
if (s != null && s.length() != 0)
{
if (s.equals("B")) // No Cache in Non POS
s = "P";
if (IsSOTrx && (s.equals("S") || s.equals("U"))) // No Check/Transfer for SO_Trx
s = "P"; // Payment Term
mTab.setValue("PaymentRule", s);
}
// Payment Term
ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull())
@ -592,13 +580,7 @@ public class CalloutOrder extends CalloutEngine
// PaymentRule
s = rs.getString(IsSOTrx ? "PaymentRule" : "PaymentRulePO");
if (s != null && s.length() != 0)
{
if (s.equals("B")) // No Cache in Non POS
s = "P";
if (IsSOTrx && (s.equals("S") || s.equals("U"))) // No Check/Transfer for SO_Trx
s = "P"; // Payment Term
mTab.setValue("PaymentRule", s);
}
// Payment Term
ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull())