core-jgi/sqlj/postgresql/sqlj.ddr

220 lines
11 KiB
Plaintext
Executable File

SQLActions[ ] = {
"BEGIN INSTALL
BEGIN PostgreSQL SET search_path TO adempiere END PostgreSQL;
CREATE OR REPLACE FUNCTION adempiereVersion()
RETURNS VARCHAR
AS 'org.compiere.sqlj.Adempiere.getVersion()'
LANGUAGE java VOLATILE;;
CREATE OR REPLACE FUNCTION adempiereProperties()
RETURNS VARCHAR
AS 'org.compiere.sqlj.Adempiere.getProperties()'
LANGUAGE java VOLATILE;;
CREATE OR REPLACE FUNCTION adempiereProperty(p_key VARCHAR)
RETURNS VARCHAR
AS 'org.compiere.sqlj.Adempiere.getProperty(java.lang.String)'
LANGUAGE java VOLATILE;;
CREATE OR REPLACE FUNCTION nextID(AD_Sequence_ID INTEGER, System VARCHAR)
RETURNS INTEGER
AS 'org.compiere.sqlj.Adempiere.nextID(int,java.lang.String)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION nextIDfunc(AD_Sequence_ID INTEGER, System VARCHAR)
RETURNS INTEGER
AS 'org.compiere.sqlj.Adempiere.nextIDfunc(int,java.lang.String)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION get_Sysconfig(Name VARCHAR, defaultValue VARCHAR, AD_Client_ID INTEGER, AD_Client_ID INTEGER)
RETURNS VARCHAR
AS 'org.compiere.sqlj.Adempiere.get_Sysconfig(java.lang.String,java.lang.String,int,int)'
LANGUAGE java VOLATILE;
/** Product **/
CREATE OR REPLACE FUNCTION productAttribute (M_AttributeSetInstance_ID NUMERIC)
RETURNS VARCHAR
AS 'org.compiere.sqlj.Product.attributeName(int)'
LANGUAGE java VOLATILE;
/************* bomPriceLimit *******************/
CREATE OR REPLACE FUNCTION bomPriceLimit (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomPriceLimit(int,int)'
LANGUAGE java VOLATILE;
/************* bomPriceList *******************/
CREATE OR REPLACE FUNCTION bomPriceList (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomPriceList(int,int)'
LANGUAGE java VOLATILE;
/************* bomPriceStd *******************/
CREATE OR REPLACE FUNCTION bomPriceStd (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomPriceStd(int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyAvailable *******************/
CREATE OR REPLACE FUNCTION bomQtyAvailable (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyAvailable(int,int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyAvailable with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyAvailableASI (M_Product_ID NUMERIC , M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyAvailableASI(int,int,int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyOnHand *******************/
CREATE OR REPLACE FUNCTION bomQtyOnHand (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOnHand(int,int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyOnHand with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyOnHandASI (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOnHandASI(int,int,int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyOrdered *******************/
CREATE OR REPLACE FUNCTION bomQtyOrdered (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOrdered(int,int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyOrdered with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyOrderedASI (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOrderedASI(int,int,int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyReserved *******************/
CREATE OR REPLACE FUNCTION bomQtyReserved (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyReserved(int,int,int)'
LANGUAGE java VOLATILE;
/************* bomQtyReserved with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyReservedASI (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyReservedASI(int,int,int,int)'
LANGUAGE java VOLATILE;
/** Currency **/
CREATE OR REPLACE FUNCTION currencyBase (Amount NUMERIC, C_CurrencyFrom_ID NUMERIC,
ConversionDate TIMESTAMP WITH TIME ZONE, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Currency.base(java.math.BigDecimal,int,java.sql.Timestamp,int,int)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION currencyConvert (Amount NUMERIC, C_CurrencyFrom_ID NUMERIC, C_CurrencyTo_ID NUMERIC,
ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID NUMERIC, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Currency.convert(java.math.BigDecimal,int,int,java.sql.Timestamp,int,int,int)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION currencyRate (C_CurrencyFrom_ID NUMERIC, C_CurrencyTo_ID NUMERIC,
ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID NUMERIC, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Currency.rate(int,int,java.sql.Timestamp,int,int,int)'
LANGUAGE java VOLATILE;
/** BPartner **/
CREATE OR REPLACE FUNCTION bpartnerRemitLocation (p_C_BPartner_ID NUMERIC)
RETURNS NUMERIC
AS 'int org.compiere.sqlj.BPartner.remitLocation(int)'
LANGUAGE java VOLATILE;
/** Invoice **/
CREATE OR REPLACE FUNCTION invoiceOpen (p_C_Invoice_ID NUMERIC, p_C_InvoicePaySchedule_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Invoice.open(int,int)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION invoicePaid (p_C_Invoice_ID NUMERIC, p_C_Currency_ID NUMERIC, p_MultiplierAP NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Invoice.paid(int,int,int)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION invoiceDiscount (p_C_Invoice_ID NUMERIC, p_PayDate TIMESTAMP WITH TIME ZONE, p_C_InvoicePaySchedule_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Invoice.discount(int,java.sql.Timestamp,int)'
LANGUAGE java VOLATILE;
/** Payment Term **/
CREATE OR REPLACE FUNCTION paymentTermDueDays (p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE)
RETURNS INTEGER
AS 'org.compiere.sqlj.PaymentTerm.dueDays(int,java.sql.Timestamp,java.sql.Timestamp)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION paymentTermDueDate (p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE)
RETURNS TIMESTAMP WITH TIME ZONE
AS 'org.compiere.sqlj.PaymentTerm.dueDate(int,java.sql.Timestamp)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION paymentTermDiscount (p_Amount NUMERIC,p_C_Currency_ID NUMERIC, p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE)
RETURNS NUMERIC
AS 'org.compiere.sqlj.PaymentTerm.discount(java.math.BigDecimal,int, int ,java.sql.Timestamp,java.sql.Timestamp)'
LANGUAGE java VOLATILE;
/** Payment **/
CREATE OR REPLACE FUNCTION paymentAllocated (p_C_Payment_ID NUMERIC, p_C_Currency_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Payment.allocated(int,int)'
LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION paymentAvailable (p_C_Payment_ID NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Payment.available(int)'
LANGUAGE java VOLATILE;
/** Account **/
CREATE OR REPLACE FUNCTION acctBalance (p_Account_ID NUMERIC, p_AmtDr NUMERIC, p_AmtCr NUMERIC)
RETURNS NUMERIC
AS 'org.compiere.sqlj.Account.balance(int,java.math.BigDecimal,java.math.BigDecimal)'
LANGUAGE java VOLATILE;
END INSTALL",
"BEGIN REMOVE
--DROP FUNCTION adempiereVersion();
--DROP FUNCTION adempiereProperties();
--DROP FUNCTION adempiereProperty(p_key VARCHAR);
--DROP FUNCTION nextID(AD_Sequence_ID INTEGER, System VARCHAR);
--DROP FUNCTION nextIDfunc(AD_Sequence_ID INTEGER, System VARCHAR);
--DROP FUNCTION productAttribute (M_AttributeSetInstance_ID NUMERIC);
--DROP FUNCTION bomPriceLimit (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC);
--DROP FUNCTION bomPriceList (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC);
--DROP FUNCTION bomPriceStd (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC);
--DROP FUNCTION bomQtyAvailable (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION bomQtyAvailableASI (M_Product_ID NUMERIC , M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION bomQtyOnHand (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION bomQtyOnHandASI (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION bomQtyOrdered (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION bomQtyOrderedASI (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION bomQtyReserved (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION bomQtyReservedASI (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC);
--DROP FUNCTION currencyBase (Amount NUMERIC, C_CurrencyFrom_ID NUMERIC,ConversionDate TIMESTAMP WITH TIME ZONE, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC);
--DROP FUNCTION currencyConvert (Amount NUMERIC, C_CurrencyFrom_ID NUMERIC, C_CurrencyTo_ID NUMERIC,ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID NUMERIC, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC);
--DROP FUNCTION currencyRate (C_CurrencyFrom_ID NUMERIC, C_CurrencyTo_ID NUMERIC,ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID NUMERIC, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC);
--DROP FUNCTION bpartnerRemitLocation (p_C_BPartner_ID NUMERIC);
--DROP FUNCTION invoiceOpen (p_C_Invoice_ID NUMERIC, p_C_InvoicePaySchedule_ID NUMERIC);
--DROP FUNCTION invoicePaid (p_C_Invoice_ID NUMERIC, p_C_Currency_ID NUMERIC, p_MultiplierAP NUMERIC);
--DROP FUNCTION invoiceDiscount (p_C_Invoice_ID NUMERIC, p_PayDate TIMESTAMP WITH TIME ZONE, p_C_InvoicePaySchedule_ID NUMERIC);
--DROP FUNCTION paymentTermDueDays (p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE);
--DROP FUNCTION paymentTermDueDate (p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE);
--DROP FUNCTION paymentTermDiscount (p_Amount NUMERIC,p_C_Currency_ID NUMERIC, p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE);
--DROP FUNCTION paymentAllocated (p_C_Payment_ID NUMERIC, p_C_Currency_ID NUMERIC);
--DROP FUNCTION paymentAvailable (p_C_Payment_ID NUMERIC);
--DROP FUNCTION acctBalance (p_Account_ID NUMERIC, p_AmtDr NUMERIC, p_AmtCr NUMERIC);
END REMOVE"
}