Pom20: Porovnání verzí

Z Prirucky
Řádek 3: Řádek 3:
Předpoklady:
Předpoklady:


update pracovnici set cdokl_nerezid = cislo_op, typdokl_nerezid = 'I'
where dan_nerez = 'a' and cislo_op is not null; //'''zkopírování čísla OP pro daň.nerezidenta, pokud je č.OP vyplněno'''
update pracovnici set cdokl_nerezid = cislo_pasu, typdokl_nerezid = 'P'
where dan_nerez = 'a' and cislo_pasu is not null; //'''zkopírování č.pasu pro daň nerezidenta, pokud je č.pasu vyplněno'''


update pracovnici set c_dokl_nerezid = cislo_op, typdokl_nerezid = 'I'  
update pracovnici set cislo_op = null where dan_nerez = 'a' and cdokl_nerezid is not null
where dan_nerezident = 'a' and cislo_op is not null;
and typdokl_nerezid = 'I'; //'''vymazání č.OP, pokud bylo využito při přenosu'''
update pracovnici set cislo_pasu = null where dan_nerez = 'a'  
and cdokl_nerezid is not null and typdokl_nerezid = 'P'; //'''vymazání č.pasu, pokud bylo využito při přenosu'''


update pracovnici set c_dokl_nerezid = cislo_pasu, typdokl_nerezid = 'P'  
update pracovnici set statdokl_nerezid =  
where dan_nerezident = 'a' and cislo_op is not null;
(select kod_znakovy2 from cis_st_prisl where kod_ciselny = pracovnici.st_prisl)
where dan_nerez = 'a' and statdokl_nerezid is null; //'''doplnění státu vydání dokladu podle státní příslušnosti'''
update pracovnici set statdcis_nerezid =
(select kod_znakovy2 from cis_st_prisl where kod_ciselny = pracovnici.st_prisl)
where dan_nerez = 'a' and statdcis_nerezid is null; //'''doplnění státu daň. identif. podle státní příslušnosti'''

Verze z 3. 2. 2017, 17:36

Daňoví nerezidenti (převedení dat z Osobních do Mzdových údajů)

Předpoklady:

update pracovnici set cdokl_nerezid = cislo_op, typdokl_nerezid = 'I' 
where dan_nerez = 'a' and cislo_op is not null; //zkopírování čísla OP pro daň.nerezidenta, pokud je č.OP vyplněno

update pracovnici set cdokl_nerezid = cislo_pasu, typdokl_nerezid = 'P' 
where dan_nerez = 'a' and cislo_pasu is not null; //zkopírování č.pasu pro daň nerezidenta, pokud je č.pasu vyplněno
update pracovnici set cislo_op = null where dan_nerez = 'a' and cdokl_nerezid is not null
and typdokl_nerezid = 'I'; //vymazání č.OP, pokud bylo využito při přenosu

update pracovnici set cislo_pasu = null where dan_nerez = 'a' 
and cdokl_nerezid is not null and typdokl_nerezid = 'P'; //vymazání č.pasu, pokud bylo využito při přenosu
update pracovnici set statdokl_nerezid = 
(select kod_znakovy2 from cis_st_prisl where kod_ciselny = pracovnici.st_prisl) 
where dan_nerez = 'a' and statdokl_nerezid is null; //doplnění státu vydání dokladu podle státní příslušnosti

update pracovnici set statdcis_nerezid = 
(select kod_znakovy2 from cis_st_prisl where kod_ciselny = pracovnici.st_prisl) 
where dan_nerez = 'a' and statdcis_nerezid is null; //doplnění státu daň. identif. podle státní příslušnosti