|
|
| Řádek 1: |
Řádek 1: |
| ''Nemocnost po střediscích'' je sestava určená pro [[Generátor sestav II]]
| | #REDIRECT |
| [[Image: Nemocnost po strediscich-Krankenstand-dilci cast.png|700px|right]] | | [[Nemocnost po střediscích a za stejné období předchozího roku (sestava)]] |
| Postup:
| |
| | |
| '''1.''' Agenda: [[SQL prompt]] - zde vložte příkaz:
| |
| : <small> insert into cis_pojmy (nazev, kod) values ('Krankenstand', 0); </small>
| |
| | |
| '''2.''' Číselník [[Pojmy (číselník)]] - zde nastavte do '''pojmu ''Krankenstand''''' ty mzdové položky, které považujete za "nemocnosti".
| |
| | |
| '''3.''' Zadejte novou definici pro generátor sestav (sql)
| |
| | |
| <small>
| |
| select str, nazev,
| |
| (select sum(fond_dny) from pom_mes where prac_str = str and datum = %DATUMOD%) as fond_dny,
| |
| (select sum(fond_dny) from pom_mes where prac_str = str and
| |
| year(cast(datum as date)) = year(cast(%DATUMOD% as date))-1 and
| |
| month(cast(datum as date)) = month(cast(%DATUMOD% as date))
| |
| ) as fond_dny_minrok,
| |
| | |
| (select sum(odpr_dny) from pom_mes where prac_str = str and datum = %DATUMOD%) as odpr_dny,
| |
| (select sum(odpr_dny) from pom_mes where prac_str = str and
| |
| year(cast(datum as date)) = year(cast(%DATUMOD% as date))-1 and
| |
| month(cast(datum as date)) = month(cast(%DATUMOD% as date))
| |
| ) as odpr_dny_minrok,
| |
| | |
| (select sum(dny) from pichacky where prac_str = str and datum = %DATUMOD% and
| |
| kod in (select kod from cis_pojmy where nazev = 'Krankenstand')
| |
| ) as Krank_dny,
| |
| | |
| (select sum(dny) from pichacky where prac_str = str and
| |
| year(cast(datum as date)) = year(cast(%DATUMOD% as date))-1 and
| |
| month(cast(datum as date)) = month(cast(%DATUMOD% as date)) and
| |
| kod in (select kod from cis_pojmy where nazev = 'Krankenstand')
| |
| ) as Krank_dny_minrok,
| |
| | |
| (
| |
| (select sum(dny) from pichacky where prac_str = str and datum = %DATUMOD% and
| |
| kod in (select kod from cis_pojmy where nazev = 'Krankenstand'))
| |
| /
| |
| (select sum(fond_dny) from pom_mes where prac_str = str and datum = %DATUMOD%)
| |
| )*100 as Krank_dny_proc,
| |
| | |
| (
| |
| (select sum(dny) from pichacky where prac_str = str and
| |
| year(cast(datum as date)) = year(cast(%DATUMOD% as date))-1 and
| |
| month(cast(datum as date)) = month(cast(%DATUMOD% as date)) and
| |
| kod in (select kod from cis_pojmy where nazev = 'Krankenstand')
| |
| )
| |
| /
| |
| (select sum(fond_dny) from pom_mes where prac_str = str and
| |
| year(cast(datum as date)) = year(cast(%DATUMOD% as date))-1 and
| |
| month(cast(datum as date)) = month(cast(%DATUMOD% as date))
| |
| )
| |
| )*100 as Krank_dny_min_proc
| |
| | |
| from stred order by str;
| |
| </small>
| |
| | |
| == Komentář ==
| |
| * Fond je vyčíslován za všechny druhy pracovních poměrů (tj. i DPP, DPČ).
| |
| * Data jsou vybírána za období určené uživatelem před vytvořením sestavy - v položce ''Od'' - tzn. za 1 měsíc (např. 03/2018).
| |
| * Data ve sloupcích označených "Minrok" nebo "Min" jsou čerpána z období přesně o rok zpět od volby ''Od'' (např. 03/2017).
| |
| | |
| == Odkazy ==
| |
| * [[Generátor sestav II (příklady sestav)]]
| |
| * [[Generátor sestav II]]
| |