Skip to content

Commit

Permalink
#10500 Add function isEUCountry
Browse files Browse the repository at this point in the history
  • Loading branch information
cristinamghita committed Jan 8, 2021
1 parent a99fa08 commit f3e60ce
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE OR REPLACE FUNCTION isEUCountry(IN p_C_Country_ID numeric)
RETURNS char(1) AS
$BODY$
DECLARE

isEUCountry char(1);

BEGIN

isEUCountry := (select case when (count(1) > 0) then 'Y' else 'N' end
from C_CountryArea_Assign ca
where ca.C_CountryArea_ID = 540000 -- European Union
and ca.C_Country_ID = p_C_Country_ID);

IF isEUCountry IS NOT NUll THEN
RETURN isEUCountry;
ELSE
RETURN 'N';
END IF;
END;
$BODY$ LANGUAGE plpgsql;
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
CREATE OR REPLACE FUNCTION isEUCountry(IN p_C_Country_ID numeric)
RETURNS char(1) AS
$BODY$
DECLARE

isEUCountry char(1);

BEGIN

isEUCountry := (select case when (count(1) > 0) then 'Y' else 'N' end
from C_CountryArea_Assign ca
where ca.C_CountryArea_ID = 540000 -- European Union
and ca.C_Country_ID = p_C_Country_ID);

IF isEUCountry IS NOT NUll THEN
RETURN isEUCountry;
ELSE
RETURN 'N';
END IF;
END;
$BODY$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION de_metas_endcustomer_fresh_reports.isEUShippingFromInvoice(IN p_C_Invoice_ID numeric)
RETURNS char(1) AS
$BODY$
Expand Down

0 comments on commit f3e60ce

Please sign in to comment.