CREATE OR REPLACE FUNCTION paymentTermDiscount (p_Amount NUMERIC,p_C_Currency_ID INTEGER, p_C_PaymentTerm_ID INTEGER, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE)
CREATE OR REPLACE FUNCTION paymentAllocated (p_C_Payment_ID INTEGER, p_C_Currency_ID INTEGER)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Payment.allocated(int,int)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION paymentAvailable (p_C_Payment_ID INTEGER)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Payment.available(int)'
LANGUAGE java VOLATILE;
/** Account **/
CREATE OR REPLACE FUNCTION acctBalance (p_Account_ID INTEGER, p_AmtDr NUMERIC, p_AmtCr NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Account.balance(int,java.math.BigDecimal,java.math.BigDecimal)'
LANGUAGE java VOLATILE;
/** Manufacturing e-evolution **/
CREATE OR REPLACE FUNCTION documentNo (p_MPC_MRP_ID INTEGER)
RETURNS VARCHAR
AS 'org.compiere.sqlj.Manufacturing.documentNo(int)'
LANGUAGE java VOLATILE;
END INSTALL",
"BEGIN REMOVE
--DROP SCHEMA fun CASCADE;
--DROP FUNCTION adempiereVersion();
--DROP FUNCTION adempiereProperties();
--DROP FUNCTION adempiereProperty(p_key VARCHAR);
--DROP FUNCTION TRUNC(datetime TIMESTAMP WITH TIME ZONE);
--DROP FUNCTION firstOf(datetime TIMESTAMP WITH TIME ZONE ,xx VARCHAR);
--DROP FUNCTION daysBetween(datetime1 TIMESTAMP WITH TIME ZONE , datetime2 TIMESTAMP WITH TIME ZONE);
--DROP FUNCTION addDays(day TIMESTAMP WITH TIME ZONE, days INTEGER);
--DROP FUNCTION charAt(source VARCHAR, pos NUMERIC);
--DROP FUNCTION productAttribute (M_AttributeSetInstance_ID INTEGER);
--DROP FUNCTION bomPriceLimit (M_Product_ID INTEGER, M_PriceList_Version_ID INTEGER);
--DROP FUNCTION bomPriceList (M_Product_ID INTEGER, M_PriceList_Version_ID INTEGER);
--DROP FUNCTION bomPriceStd (M_Product_ID INTEGER, M_PriceList_Version_ID INTEGER);
--DROP FUNCTION bomQtyAvailable (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER);
--DROP FUNCTION bomQtyOnHand (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER);
--DROP FUNCTION bomQtyOrdered (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER);
--DROP FUNCTION bomQtyReserved (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER);
--DROP FUNCTION currencyBase (Amount DECIMAL, C_CurrencyFrom_ID INTEGER,
ConversionDate TIMESTAMP WITH TIME ZONE, AD_Client_ID INTEGER, AD_Org_ID INTEGER);
--DROP FUNCTION currencyConvert (Amount NUMERIC, C_CurrencyFrom_ID INTEGER, C_CurrencyTo_ID INTEGER,
ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID INTEGER, AD_Client_ID NUMERIC, AD_Org_ID INTEGER);
--DROP FUNCTION currencyRate (C_CurrencyFrom_ID INTEGER, C_CurrencyTo_ID INTEGER,
ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID INTEGER, AD_Client_ID INTEGER, AD_Org_ID INTEGER);
--DROP FUNCTION bpartnerRemitLocation (p_C_BPartner_ID INTEGER);
--DROP FUNCTION invoiceOpen (p_C_Invoice_ID INTEGER, p_C_InvoicePaySchedule_ID INTEGER);
--DROP FUNCTION invoicePaid (p_C_Invoice_ID INTEGER, p_C_Currency_ID INTEGER, p_MultiplierAP NUMERIC);
--DROP FUNCTION invoiceDiscount (p_C_Invoice_ID INTEGER, p_PayDate TIMESTAMP WITH TIME ZONE, p_C_InvoicePaySchedule_ID INTEGER);
--DROP FUNCTION paymentTermDueDays (p_C_PaymentTerm_ID INTEGER, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE);
--DROP FUNCTION paymentTermDiscount (p_Amount NUMERIC, p_C_PaymentTerm_ID INTEGER, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE);
--DROP FUNCTION paymentAllocated (p_C_Payment_ID INTEGER, p_C_Currency_ID INTEGER);
--DROP FUNCTION paymentAvailable (p_C_Payment_ID INTEGER);
--DROP FUNCTION acctBalance (p_Account_ID INTEGER, p_AmtDr NUMERIC, p_AmtCr NUMERIC);