Compiere 3.1

org.compiere.udf
Class PaymentTerm

java.lang.Object
  extended by COM.ibm.db2.app.UDF
      extended by org.compiere.udf.PaymentTerm

public class PaymentTerm
extends COM.ibm.db2.app.UDF

SQLJ Payment Term related Functions

Version:
$Id: PaymentTerm.java,v 1.3 2006/07/30 00:59:07 jjanke Exp $
Author:
Jorg Janke

Field Summary
 
Fields inherited from class COM.ibm.db2.app.UDF
SQLUDF_FIRST_CALL, SQLUDF_NORMAL_CALL, SQLUDF_TF_CLOSE, SQLUDF_TF_FETCH, SQLUDF_TF_FINAL, SQLUDF_TF_FIRST, SQLUDF_TF_OPEN
 
Constructor Summary
PaymentTerm()
           
 
Method Summary
static double discount(BigDecimal p_Amount, int p_C_Currency_ID, int p_C_PaymentTerm_ID, Timestamp p_DocDate, Timestamp p_PayDate)
           
static double discountD(double p_Amount, int p_C_Currency_ID, int p_C_PaymentTerm_ID, Timestamp p_DocDate, Timestamp p_PayDate)
          Get Discount amount.
static Timestamp dueDate(int p_C_PaymentTerm_ID, Timestamp p_DocDate)
          Get Due Date.
static int dueDays(int p_C_PaymentTerm_ID, Timestamp p_DocDate, Timestamp p_PayDate)
          Get Due Days.
static Timestamp invoiceDueDate(int p_C_Invoice_ID)
          Get Invoice Due Date
static int invoiceDueDays(int p_C_Invoice_ID, Timestamp p_PayDate)
          Get Due Days of invoice
 
Methods inherited from class COM.ibm.db2.app.UDF
close, getCallType, getConnection, getDBapplid, getDBauthid, getDBcodepg, getDBcolname, getDBinfo, getDBname, getDBplatform, getDBprocid, getDBtbname, getDBtbschema, getDBver_rel, getFunctionName, getScratchpad, getSpecificName, isNull, needToSet, set, set, set, set, set, set, set, set, set, set, set, setCodepage, setScratchpad, setSQLmessage, setSQLstate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaymentTerm

public PaymentTerm()
Method Detail

dueDays

public static int dueDays(int p_C_PaymentTerm_ID,
                          Timestamp p_DocDate,
                          Timestamp p_PayDate)
                   throws SQLException
Get Due Days. SELECT Name, paymentTermDueDays(C_PaymentTerm_ID, SysDate, SysDate) "DueDays" FROM C_PaymentTerm

Parameters:
p_C_PaymentTerm_ID - payment term
p_DocDate - document date
p_PayDate - payment date (or today)
Returns:
days due
Throws:
SQLException

invoiceDueDays

public static int invoiceDueDays(int p_C_Invoice_ID,
                                 Timestamp p_PayDate)
                          throws SQLException
Get Due Days of invoice

Parameters:
p_C_Invoice_ID - Invoice
p_PayDate - paument date (or today)
Returns:
days due
Throws:
SQLException

dueDate

public static Timestamp dueDate(int p_C_PaymentTerm_ID,
                                Timestamp p_DocDate)
                         throws SQLException
Get Due Date. SELECT Name, paymentTermDueDate(C_PaymentTerm_ID, SysDate) "DueDate" FROM C_PaymentTerm

Parameters:
p_C_PaymentTerm_ID - payment term
p_DocDate - document date
Returns:
due date
Throws:
SQLException

invoiceDueDate

public static Timestamp invoiceDueDate(int p_C_Invoice_ID)
                                throws SQLException
Get Invoice Due Date

Parameters:
p_C_Invoice_ID - payment term
Returns:
due date
Throws:
SQLException

discountD

public static double discountD(double p_Amount,
                               int p_C_Currency_ID,
                               int p_C_PaymentTerm_ID,
                               Timestamp p_DocDate,
                               Timestamp p_PayDate)
                        throws SQLException
Get Discount amount. SELECT C_PaymentTerm_ID, Name, paymentTermDiscount(111.1111, 100, C_PaymentTerm_ID, SysDate, SysDate) "DiscountUSD", paymentTermDiscount(111.1111, 100, C_PaymentTerm_ID, SysDate, SysDate) "DiscountJPY" FROM C_PaymentTerm

Parameters:
p_Amount - amount
p_C_Currency_ID - currency
p_C_PaymentTerm_ID - payment term
p_DocDate - document date
p_PayDate - payment date
Returns:
discount amount
Throws:
SQLException

discount

public static double discount(BigDecimal p_Amount,
                              int p_C_Currency_ID,
                              int p_C_PaymentTerm_ID,
                              Timestamp p_DocDate,
                              Timestamp p_PayDate)
                       throws SQLException
Throws:
SQLException

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.