CREATE OR REPLACE VIEW frontsql.akc_all
 AS
 SELECT akc_prie.i_akc_prie AS id,
    akc_prie.i_akcia,
    akc_prie.i_priestor AS id_def,
    akc_prie.odter,
    akc_prie.doter,
    1 AS pocet,
    akc_prie.nakl_cena,
    akc_prie.cena,
    akc_prie.dph,
    akc_prie.pozn,
    akc_prie.in_pozn,
    priestor.n_priestor AS nazov,
    'Priestory '::text AS typ
   FROM (frontsql.akc_prie akc_prie
     LEFT JOIN frontsql.priestor priestor ON ((akc_prie.i_priestor = priestor.i_priestor)))
UNION ALL
 SELECT akc_ub.i_akc_ub AS id,
    akc_ub.i_akcia,
    akc_ub.i_typ_izby AS id_def,
    akc_ub.odter,
    akc_ub.doter,
    akc_ub.pocet,
    akc_ub.nakl_cena,
    akc_ub.cena,
    akc_ub.dph,
    akc_ub.pozn,
    akc_ub.in_pozn,
    typ_izby.n_typ_izby AS nazov,
    'Ubytovanie'::text AS typ
   FROM (frontsql.akc_ub akc_ub
     LEFT JOIN frontsql.typ_izby typ_izby ON ((akc_ub.i_typ_izby = typ_izby.i_typ_izby)))
UNION ALL
 SELECT akc_slu.i_akc_slu AS id,
    akc_slu.i_akcia,
    akc_slu.i_sluzba AS id_def,
    akc_slu.odter,
    akc_slu.doter,
    akc_slu.pocet,
    akc_slu.nakl_cena,
    akc_slu.cena,
    akc_slu.dph,
    akc_slu.pozn,
    akc_slu.in_pozn,
    sluzba.n_sluzba AS nazov,
    'Sluzby    '::text AS typ
   FROM (frontsql.akc_slu akc_slu
     LEFT JOIN frontsql.sluzba sluzba ON ((akc_slu.i_sluzba = sluzba.i_sluzba)));
