IO-1914 Added inventory page.
This commit is contained in:
40
hasura/migrations/1654022042838_run_sql_migration/down.sql
Normal file
40
hasura/migrations/1654022042838_run_sql_migration/down.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- CREATE OR REPLACE FUNCTION public.search_inventory (search text)
|
||||
-- RETURNS SETOF inventory
|
||||
-- LANGUAGE plpgsql
|
||||
-- STABLE
|
||||
-- AS $function$
|
||||
-- BEGIN
|
||||
-- IF search = '' THEN
|
||||
-- RETURN query
|
||||
-- SELECT
|
||||
-- *
|
||||
-- FROM
|
||||
-- inventory;
|
||||
-- ELSE
|
||||
-- RETURN query
|
||||
-- SELECT
|
||||
-- *
|
||||
-- FROM
|
||||
-- inventory i,
|
||||
-- billlines bl,
|
||||
-- bills b,
|
||||
-- vendors v
|
||||
-- WHERE
|
||||
-- i.billlineid = bl.id
|
||||
-- AND bl.billid = b.id
|
||||
-- AND b.vendorid = v.id
|
||||
-- AND i.line_desc ILIKE '%' || search || '%'
|
||||
-- OR b.invoice_number ILIKE '%' || search || '%'
|
||||
-- OR v.name ILIKE '%' || search || '%'
|
||||
-- ORDER BY
|
||||
-- i.line_desc ILIKE '%' || search || '%'
|
||||
-- OR NULL,
|
||||
-- b.invoice_number ILIKE '%' || search || '%'
|
||||
-- OR NULL,
|
||||
-- v.name ILIKE '%' || search || '%'
|
||||
-- OR NULL;
|
||||
-- END IF;
|
||||
-- END
|
||||
-- $function$;
|
||||
Reference in New Issue
Block a user