PRIVATE euro_path, hladajcstredisk
PUBLIC gp_limit
PUBLIC oHandler
oHandler=NEWOBJECT("_screenresize")
BINDEVENT(_SCREEN,"Resize",oHandler,"myresize")
m.gp_limit="10"

SET SYSMENU TO
SET SYSMENU AUTOMATIC

DO priprav_speciality

***************** MENU PRO OBJEDNAVKOVY SYSTEM ******************
DEFINE POPUP vyroba MARGIN RELATIVE SHADOW COLOR SCHEME 4
is_stravovani = .F.
DO vyroba_menu_def  && tenhle programek je zvlast v progs_cs\ a progs_sk\, abychom si ho mohli s milanem nezavisle upravovat

***************** MENU PRO VAZBU NA UCETNICTVI ****************** 
DO ucto_menu_def IN ucto_exp

*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DEFINE PAD kalkulace OF _MSYSMENU PROMPT jaz("mm_kalkulace") COLOR SCHEME 3 MESS jaz("kalkulace")
DEFINE PAD odpocty   OF _MSYSMENU PROMPT jaz("mm_odpocty")   COLOR SCHEME 3 MESS jaz("mm_odpocty_mssg") 
DEFINE PAD pohyby    OF _MSYSMENU PROMPT jaz("mm_pohyby")    COLOR SCHEME 3 MESS jaz("mm_pohyby_mssg") SKIP FOR m.gityp_inst=1
DEFINE PAD opravy    OF _MSYSMENU PROMPT jaz("mm_opravy")    COLOR SCHEME 3 MESS jaz("mm_opravy_mssg") SKIP FOR m.gityp_inst=1
DEFINE PAD hledej    OF _MSYSMENU PROMPT jaz("mm_hledani")   COLOR SCHEME 3 MESS jaz("mm_hledej_mssg") SKIP FOR m.gityp_inst=1
DEFINE PAD sestavy   OF _MSYSMENU PROMPT jaz("mm_reporty")   COLOR SCHEME 3 MESS jaz("mm_sestavy_mssg") 
DEFINE PAD vzorniky  OF _MSYSMENU PROMPT jaz("mm_vzorniky")  COLOR SCHEME 3 MESS jaz("mm_vzorniky_mssg")
DEFINE PAD ostatni   OF _MSYSMENU PROMPT jaz("mm_ostatni")   COLOR SCHEME 3 MESS jaz("mm_ostatni_mssg")
DEFINE PAD vyber_skl OF _MSYSMENU PROMPT jaz("mm_sklad")     COLOR SCHEME 3 MESS jaz("mm_sklad_mssg") SKIP FOR IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)

IF is_stravovani
    DEFINE PAD stravovani OF _MSYSMENU PROMPT jaz("mm_stravovani") COLOR SCHEME 3 MESS jaz("mm_odpocty_mssg") 
    ON     PAD stravovani OF _MSYSMENU ACTI POPUP vyroba
ENDIF 
IF m.is_kongres
    DEFINE PAD kongres   OF _MSYSMENU PROMPT jaz("mm_kongres")   COLOR SCHEME 3 MESS 'CongressMan' SKIP FOR !m.is_kongres
    ON     PAD kongres   OF _MSYSMENU ACTI POPUP kongres
ENDIF 
IF m.is_dochadzka
	DEFINE PAD doch   OF _MSYSMENU PROMPT jaz("mm_dochadzka")   COLOR SCHEME 3 MESS jaz("mm_dochadzka_mssg")
    ON SELECTION PAD doch OF _MSYSMENU do (m.doch_Path+"dochazka.exe")
ENDIF

DEFINE PAD konec     OF _MSYSMENU PROMPT jaz("mm_konec")     COLOR SCHEME 3 MESS jaz("mm_konec_mssg")

ON			 PAD kalkulace	OF _MSYSMENU ACTI POPUP kalkulace
ON			 PAD odpocty	OF _MSYSMENU ACTI POPUP odpocty
ON			 PAD pohyby		OF _MSYSMENU ACTI POPUP pohyby
ON			 PAD opravy		OF _MSYSMENU ACTI POPUP opravy
ON SELECTION PAD hledej		OF _MSYSMENU DO spust_form WITH "hledej3","" in menu_def &&ACTI POPUP hledej
ON			 PAD sestavy	OF _MSYSMENU ACTI POPUP sestavy
ON			 PAD vzorniky	OF _MSYSMENU ACTI POPUP vzorniky
ON 			 PAD ostatni	OF _MSYSMENU ACTI POPUP ostatni
IF VARTYPE(m.vyber_skl_form)=="L" AND m.vyber_skl_form
	ON SELECTION PAD vyber_skl	OF _MSYSMENU  DO spust_form WITH "vybersklad","" in menu_def
ELSE 
	ON 			 PAD vyber_skl	OF _MSYSMENU ACTI POPUP vyber_skl
ENDIF 
ON			 PAD konec		OF _MSYSMENU ACTI POPUP konec

*--------------------------------------------------------
DEFINE POPUP kalkulace MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR  1 OF kalkulace PROMPT jaz("m_kalk_oprava")       MESS jaz("m_kalk_oprava_mssg")
DEFINE BAR  2 OF kalkulace PROMPT jaz("m_kalk_nahrada")      MESS jaz("m_kalk_nahrada_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  3 OF kalkulace PROMPT jaz("m_kalk_polozky")      MESS jaz("m_kalk_polozky_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  5 OF kalkulace PROMPT jaz("m_kalk_calcceny")     MESS jaz("m_kalk_calcceny_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  6 OF kalkulace PROMPT jaz("m_kalk_test rekurse") MESS jaz("m_kalk_test rekurse_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  7 OF kalkulace PROMPT jaz("m_kalk_vlozenie")     MESS jaz("m_kalk_vlozenie_mssg")
*DEFINE bar 8 OF kalkulace PROMPT jaz("m_kalk_test menu")    MESS jaz("m_kalk_test menu_mssg")
*DEFINE bar 9 OF kalkulace PROMPT jaz("m_kalk_nett-2-brtt")  MESS jaz("m_kalk_nett-2-brtt_mssg")
DEFINE BAR 21 OF kalkulace PROMPT jaz("m_kalk_menu")         MESS jaz("m_kalk_menu_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 22 OF kalkulace PROMPT jaz("m_kalk_postupy")      MESS jaz("m_kalk_postupy_mssg")
DEFINE BAR 98 OF kalkulace PROMPT "\-"
DEFINE BAR 99 OF kalkulace PROMPT "\-"

ON SELECTION BAR  1 OF kalkulace DO spust_form WITH "opr_kalk","" in menu_def
ON SELECTION BAR  2 OF kalkulace DO spust_form WITH "nahrada","" in menu_def
ON SELECTION BAR  3 OF kalkulace DO spust_form WITH "pol_pouz","" in menu_def
ON SELECTION BAR  5 OF kalkulace DO spust_form WITH "calcceny","" in menu_def
ON SELECTION BAR  6 OF kalkulace DO spust_form WITH "test_rekurze","" in menu_def
ON SELECTION BAR  7 OF kalkulace DO spust_form WITH "vlozpolozku","" in menu_def
*ON SELECTION BAR 8 OF kalkulace DO tst_menu
*ON SELECTION BAR 9 OF kalkulace DO net2brt
ON SELECTION BAR 21 OF kalkulace DO spust_form WITH "menu","" in menu_def
ON SELECTION BAR 22 OF kalkulace DO spust_form WITH "kop_postupy","" in menu_def
*--------------------------------------------------------

DEFINE POPUP konec MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 10 OF konec PROMPT jaz("m_kon_konec") MESSAGE jaz("m_kon_kon_mssg") SKIP FOR IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)
DEFINE BAR 20 OF konec PROMPT jaz("m_kon_konec_arch") MESSAGE jaz("m_kon_kon_mssg") SKIP FOR IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)
DEFINE BAR 30 OF konec PROMPT jaz("m_kon_reloginx") MESSAGE "" SKIP FOR IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)
DEFINE BAR 31 OF konec PROMPT jaz("m_kon_relogin") MESSAGE "" SKIP FOR IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)

IF ATC("evzen", m.machine_semaf) + ATC("apc04", m.machine_semaf) > 0
	DEFINE       BAR 32 OF konec PROMPT "\-"
	DEFINE       BAR 33 OF konec PROMPT "Suspend" MESSAGE ""
	ON SELECTION BAR 33 OF konec DO sta_susp
	IF ATC("evzen", m.machine_semaf) > 0 
	    gcxfrx = "0"
	ENDIF 
ENDIF 


DEFINE BAR 35 OF konec PROMPT "\-"
IF m.slovenskaverzia
	DEFINE BAR 50 OF konec PROMPT jaz("m_kon_licencia")
    ON SELECTION BAR 50 OF konec DO FORM licencia
ENDIF
DEFINE BAR 60 OF konec PROMPT jaz("m_kon_prohlidni historii") MESSAGE ""
DEFINE BAR 65 OF konec PROMPT jaz("m_vzdalena sprava")+" (TeamViewer)" MESSAGE ""
IF m.slovenskaverzia
	DEFINE BAR 66 OF konec PROMPT jaz("m_vzdalena sprava")+" (AnyDesk)" MESSAGE ""
	DEFINE BAR 67 OF konec PROMPT jaz("m_vzdalena sprava")+" (UltraViewer)" MESSAGE ""
ENDIF 
DEFINE BAR 69 OF konec PROMPT "\-"
DEFINE BAR 70 OF konec PROMPT jaz("m_kon_zmena_hesla") MESSAGE ""
DEFINE BAR 77 OF konec PROMPT jaz("m_kon_zmena_uct_obdobia") MESSAGE ""

IF m.slovenskaverzia
    DEFINE BAR 81 OF konec PROMPT jaz("m_kon_setup") MESSAGE ""
	IF !EMPTY(m.gcdatumzmenydph)
	    DEFINE BAR 82 OF konec PROMPT jaz("m_kon_zmenadph")+" "+m.gcdatumzmenydph MESSAGE ""
	ENDIF 

ELSE 
    DEFINE BAR 80 OF konec PROMPT "\-"
    DEFINE BAR 81 OF konec PROMPT jaz("m_kon_setup") MESSAGE ""
    DEFINE BAR 88 OF konec PROMPT "Zobrazení použitých cenových hladin"

    ON SELECTION BAR 88 OF konec DO (m.gcini_path + "speciality\zobraz_pouzite_hladiny")

ENDIF 


DEFINE BAR 90 OF konec PROMPT "\-"
DEFINE BAR 91 OF konec PROMPT "Backup - vytvoreni zalohy" MESSAGE ""
DEFINE BAR 98 OF konec PROMPT "\-"
DEFINE BAR 99 OF konec PROMPT "\-"

ON SELECTION BAR 10 OF konec DO exi_to_fox IN menu_def
ON SELECTION BAR 20 OF konec DO exi_to_fox with .t. IN menu_def
ON SELECTION BAR 30 OF konec DO relog in menu_def
ON SELECTION BAR 31 OF konec DO relog with .t. in menu_def
*ON SELECTION BAR 40 OF konec DO aboutbox IN menu_def
ON SELECTION BAR 60 OF konec DO form historia
IF m.slovenskaverzia
	IF FILE(m.gcini_path+"TeamViewerQS.exe")
		ON SELECTION BAR 65 OF konec RUN /N TeamViewerQS.exe
	ENDIF 
	IF FILE(m.gcini_path+"anydesk.exe")
		ON SELECTION BAR 66 OF konec RUN /N anydesk.exe
	ENDIF 
	IF FILE(m.gcini_path+"UltraViewerQS.exe")
		ON SELECTION BAR 67 OF konec RUN /N UltraViewerQS.exe
	ENDIF 
ELSE
	IF FILE(m.gcini_path+"TeamViewerQS.exe")
		ON SELECTION BAR 65 OF konec RUN /N TeamViewerQS.exe
	ENDIF 
ENDIF
ON SELECTION BAR 70 OF konec DO spust_form WITH "zmenheslo","" in menu_def &&DO FORM zmenheslo
ON SELECTION BAR 77 OF konec DO spust_form WITH "setuctob","" in menu_def &&DO FORM setuctob
ON SELECTION BAR 81 OF konec DO spust_form WITH "setup","" in menu_def &&DO FORM setup
IF !EMPTY(m.gcdatumzmenydph)
	ON SELECTION BAR 82 OF konec DO zmenadph
ENDIF 

ON SELECTION BAR 91 OF konec DO zalohuj_1 IN zalohovac

*--------------------------------------------------------
DEFINE POPUP ostatni_reind MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR  1 OF ostatni_reind PROMPT jaz("m_ost reindexace") MESSAGE "" SKIP FOR m.issql
DEFINE BAR  2 OF ostatni_reind PROMPT jaz("m_ost reindexace_trz") MESSAGE "" SKIP FOR m.issql
DEFINE BAR  3 OF ostatni_reind PROMPT jaz("m_ost reindexace_arch_trz") MESSAGE "" SKIP FOR m.issql
DEFINE BAR 10 OF ostatni_reind PROMPT "\-"
IF m.issql
	DEFINE BAR 14 OF ostatni_reind PROMPT jaz("m_ost kontrola vsech skl") MESSAGE "" SKIP FOR m.gityp_inst=1
ENDIF 
DEFINE BAR 15 OF ostatni_reind PROMPT jaz("m_ost prepocet vsech skl") MESSAGE "" SKIP FOR m.gityp_inst=1 
DEFINE BAR 16 OF ostatni_reind PROMPT jaz("m_ost prepocet alergenov") MESSAGE "" SKIP FOR m.gityp_inst=1
DEFINE BAR 17 OF ostatni_reind PROMPT jaz("m_ost_ulozene_os_udaje") 
DEFINE BAR 98 OF ostatni_reind PROMPT "\-"
DEFINE BAR 99 OF ostatni_reind PROMPT "\-"

ON SELECTION BAR  1 OF ostatni_reind DO indexy
ON SELECTION BAR  2 OF ostatni_reind DO index_sk WITH "" IN indexy
ON SELECTION BAR  3 OF ostatni_reind DO index_sk WITH "_a" IN indexy
IF m.issql
	ON SELECTION BAR 14 OF ostatni_reind DO spust_form WITH "prep_sql","" IN menu_def 
ENDIF 
ON SELECTION BAR 15 OF ostatni_reind DO spust_form WITH "prep_all","","prep_all with 0" IN menu_def &&FORM prep_all with 0
ON SELECTION BAR 16 OF ostatni_reind DO spust_form WITH "prep_alerg","" IN menu_def &&FORM prep_all with 0
ON SELECTION BAR 17 OF ostatni_reind DO spust_form WITH "os_udaje","" in menu_def &&DO form compare_db
*--------------------------------------------------------
DEFINE POPUP ostatni_admin MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 53 OF ostatni_admin PROMPT "Suspend" MESSAGE ""
DEFINE BAR 70 OF ostatni_admin PROMPT jaz("m_ost_kontrola_struktur") SKIP FOR m.gcuser_id<>"SUP"
IF m.issql
	DEFINE BAR 73 OF ostatni_admin PROMPT jaz("m_ost stru_upda") MESSAGE "" SKIP FOR m.gcuser_id<>"SUP"
	DEFINE BAR 75 OF ostatni_admin PROMPT jaz("m_ost_mazanie_tabuliek") MESSAGE "" SKIP FOR m.gcuser_id<>"SUP"
ELSE
	DEFINE BAR 73 OF ostatni_admin PROMPT jaz("m_ost stru_upda") MESSAGE "" 
	IF m.is_kongres
		DEFINE BAR 74 OF ostatni_admin PROMPT jaz("m_ost stru_upda")+" Postgres" MESSAGE "" 
	ENDIF 
ENDIF  
DEFINE BAR 77 OF ostatni_admin PROMPT jaz("m_ost stru_upda") + " natvrdo" MESSAGE "" SKIP FOR m.issql
DEFINE BAR 78 OF ostatni_admin PROMPT jaz("m_ost_struktura_db_server") SKIP FOR m.gcuser_id<>"SUP" OR !(m.issql OR m.is_kongres)
DEFINE BAR 79 OF ostatni_admin PROMPT jaz("m_ost_migracia_dat") SKIP FOR m.gcuser_id<>"SUP" OR !(m.issql OR m.is_kongres)
DEFINE BAR 80 OF ostatni_admin PROMPT jaz("m_ost_synchronizacia_dat") SKIP FOR m.gcuser_id<>"SUP" OR !(m.issql OR m.is_kongres)
DEFINE BAR 81 OF ostatni_admin PROMPT jaz("m_ost_kontrola_fs") SKIP FOR m.gcuser_id<>"SUP" AND !m.issql
DEFINE BAR 82 OF ostatni_admin PROMPT jaz("m_ost_nulovanie_max_dokladov") SKIP FOR ! glis_admin

DEFINE BAR 99 OF ostatni_admin PROMPT "\-"
*DEFINE BAR 100 OF ostatni_admin PROMPT "Akcie" SKIP FOR m.gcuser_id<>"SUP"

ON SELECTION BAR 53 OF ostatni_admin DO sta_susp

IF ".FXP"$UPPER(SYS(16,0))
	ON SELECTION BAR 70 OF ostatni_admin DO FORM s_tab with (m.gcini_path+"views\"),"food600_ps"
ELSE
	ON SELECTION BAR 70 OF ostatni_admin DO FORM s_tab with (m.gcini_path+"views\"),"food600_ps"," "+IIF(m.issql AND m.sqlprefix="ps_","x"," ")+IIF(!m.issql,"x"," ")+IIF(m.issql AND m.sqlprefix="my_","x"," ")+" "
ENDIF
IF m.issql
	ON SELECTION BAR 73 OF ostatni_admin DO spust_form WITH "verzia","","verzia with  'X'+m.gcverze_dat" in menu_def
	ON SELECTION BAR 75 OF ostatni_admin DO spust_form WITH "mazanie_dat","" in menu_def
ELSE 
	ON SELECTION BAR 73 OF ostatni_admin DO stru_update_rucne IN stru_upd
	IF m.is_kongres
		ON SELECTION BAR 74 OF ostatni_admin DO spust_form WITH "verzia","","verzia with  'X'+m.gcverze_dat" in menu_def
	ENDIF 
ENDIF 
ON SELECTION BAR 77 OF ostatni_admin DO stru_update_rucne with .t. IN stru_upd
ON SELECTION BAR 78 OF ostatni_admin DO spust_form WITH "compare_db","" in menu_def &&DO form compare_db
ON SELECTION BAR 79 OF ostatni_admin DO spust_form WITH "migracia","" in menu_def
ON SELECTION BAR 80 OF ostatni_admin DO spust_form WITH "synchronizacia","" in menu_def
ON SELECTION BAR 81 OF ostatni_admin DO spust_form WITH "kontrola_fs","" in menu_def
ON SELECTION BAR 82 OF ostatni_admin DO spust_form WITH "setmaxima","" in menu_def

*--------------------------------------------------------
DEFINE POPUP ostatni_konecmes MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 41 OF ostatni_konecmes PROMPT jaz("m_ost konec mesice obratu") MESSAGE "" SKIP FOR m.gityp_inst=1
DEFINE BAR 42 OF ostatni_konecmes PROMPT jaz("m_ost konec mesice trzeb") MESSAGE ""

ON SELECTION BAR 41 OF ostatni_konecmes DO spust_form WITH "konecmes","" in menu_def &&DO FORM konecmes
ON SELECTION BAR 42 OF ostatni_konecmes DO spust_form WITH "koniecsk","" in menu_def &&DO FORM koniecsk

*--------------------------------------------------------
DEFINE POPUP ostatni_archivace MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 3 OF ostatni_archivace PROMPT jaz("m_ost Archivace obratu") MESSAGE "" SKIP FOR m.gityp_inst=1
DEFINE BAR 5 OF ostatni_archivace PROMPT jaz("m_ost Archivace trzeb") MESSAGE ""
DEFINE BAR 7 OF ostatni_archivace PROMPT jaz("m_ost_pocatek")         MESS jaz("m_ost_pocatek_mssg")

ON SELECTION BAR 3 OF ostatni_archivace DO spust_form WITH "archivac","" in menu_def &&DO form archivac
ON SELECTION BAR 5 OF ostatni_archivace DO spust_form WITH "archivacia_sk","" in menu_def &&DO FORM archivacia_sk &&arch_sk

ON SELECTION BAR 7 OF ostatni_archivace DO spust_form WITH "pocatek","" in menu_def &&DO FORM pocatek
*--------------------------------------------------------
DEFINE POPUP ostatni_kontroly MARGIN RELATIVE SHADOW COLOR SCHEME 4
IF m.slovenskaverzia
	DEFINE BAR 60 OF ostatni_kontroly PROMPT ALLTRIM(jaz("m_ost chk_vv_pv"))+" Sk" MESSAGE "" SKIP FOR m.gityp_inst=1
ENDIF
DEFINE BAR 61 OF ostatni_kontroly PROMPT jaz("m_ost chk_vv_pv") MESSAGE "" SKIP FOR m.gityp_inst=1
*DEFINE BAR 64 OF ostatni_kontroly PROMPT jaz("m_ost chk_vv_pv") + " PARLAMENT" MESSAGE "" SKIP FOR ATC("D_SNEM", m.gchom_path) = 0
DEFINE BAR 65 OF ostatni_kontroly PROMPT jaz("m_ost chk_vv_pv") + " cely barak" MESSAGE "" SKIP FOR m.gityp_inst=1
DEFINE BAR 66 OF ostatni_kontroly PROMPT jaz("m_ost kontrola trzbovych dbf") MESSAGE ""
IF m.issql
	DEFINE BAR 67 OF ostatni_kontroly PROMPT jaz("m_ost kontrola migracie trzbov") MESSAGE ""
ENDIF 

IF m.slovenskaverzia
	ON SELECTION BAR 60 OF ostatni_kontroly DO spust_form WITH "intpoh","" in menu_def &&DO form intpoh
ENDIF
ON SELECTION BAR 61 OF ostatni_kontroly DO spust_form WITH "chk_vv_pv","" in menu_def &&DO chk_vv_pv IN kontroly
*ON SELECTION BAR 64 OF ostatni_kontroly DO spust_form WITH "ukazstav_snem","" in menu_def
ON SELECTION BAR 65 OF ostatni_kontroly DO spust_form WITH "ukazstav","" in menu_def &&DO ukazstav
ON SELECTION BAR 66 OF ostatni_kontroly DO spust_form WITH "chk_sk","" in menu_def &&DO chk_sk   IN kontroly
IF m.issql
	ON SELECTION BAR 67 OF ostatni_kontroly DO spust_form WITH "chk_migracie","" in menu_def 
ENDIF 
*--------------------------------------------------------

DEFINE POPUP ostatni MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR  1 OF ostatni PROMPT jaz("m_ost reindexace") MESSAGE "" SKIP FOR IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)
DEFINE BAR 10 OF ostatni PROMPT "\-"
DEFINE BAR 21 OF ostatni PROMPT jaz("m_ost pristupova prava") + " "+jaz("m_ost pristupova prava_skupiny") MESSAGE ""
DEFINE BAR 22 OF ostatni PROMPT jaz("m_ost pristupova prava") + " "+jaz("m_ost pristupova prava_uzivatele") MESSAGE ""
IF VARTYPE(m.prava_na_druhy)=="L" AND m.prava_na_druhy
	DEFINE BAR 23 OF ostatni PROMPT jaz("m_ost prava_skup") MESSAGE "" SKIP FOR ! glis_admin
ENDIF 
DEFINE BAR 24 OF ostatni PROMPT jaz("m_ost definicni soubory") MESSAGE "" SKIP FOR ! glis_admin
IF !m.slovenskaverzia AND !m.issql
	DEFINE BAR 25 OF ostatni PROMPT jaz("m_ost definicni soubory") + " nove" MESSAGE "" SKIP FOR ! glis_admin
ENDIF
DEFINE BAR 26 OF ostatni PROMPT jaz("m_ost mazani nepouzitych karet") MESSAGE "" SKIP FOR ! glis_admin .OR. m.gityp_inst=1
DEFINE BAR 30 OF ostatni PROMPT "\-"
DEFINE BAR 31 OF ostatni PROMPT jaz("m_ost prohlizeni chyb") MESSAGE ""
DEFINE BAR 32 OF ostatni PROMPT jaz("m_ost semafory") MESSAGE ""
DEFINE BAR 40 OF ostatni PROMPT "\-"
DEFINE BAR 41 OF ostatni PROMPT jaz("m_ost konec mesice") MESSAGE ""
DEFINE BAR 45 OF ostatni PROMPT jaz("m_ost archivace") MESSAGE "" SKIP FOR IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)
DEFINE BAR 47 OF ostatni PROMPT jaz("m_ost Ze zasoby") MESSAGE "" SKIP FOR m.gityp_inst=1
IF ATC( "BAKARE", m.wi_zakaz) > 0
	DEFINE BAR 48 OF ostatni PROMPT jaz("m_ost tisk zadanek bakare") MESSAGE ""
ENDIF
DEFINE BAR 50 OF ostatni PROMPT "\-"
DEFINE BAR 66 OF ostatni PROMPT jaz("m_ost kontroly dbf") MESSAGE ""
DEFINE BAR 72 OF ostatni PROMPT jaz("m_ost kontrola inventur") MESSAGE ""
DEFINE BAR 73 OF ostatni PROMPT jaz("m_ost kontrola dat uzaverek") MESSAGE ""
DEFINE BAR 75 OF ostatni PROMPT jaz("m_ost speciality") MESSAGE "" SKIP FOR m.gityp_inst=1
IF !EMPT(m.gcucto_path)
	DEFINE BAR 80 OF ostatni PROMPT "\-"
	IF LOWER(m.gcuct_perioda)='d'
		DEFINE BAR 81 OF ostatni PROMPT jaz("m_ost denny export do ucta") MESSAGE ""
	ENDIF
	DEFINE BAR 82 OF ostatni PROMPT jaz("m_ost export do ucta") MESSAGE ""
ENDIF
DEFINE BAR 88 OF ostatni PROMPT jaz("m_ost uzaverka") SKIP FOR m.gityp_inst=1 .or. (.not. m.slovenskaverzia)
IF m.poc_horcov>0
	DEFINE BAR 89 OF ostatni PROMPT jaz("m_ostatni_horec")		MESSAGE jaz("m_ostatni_horec_mssg")
ENDIF
DEFINE BAR 90 OF ostatni PROMPT jaz("m_ost uvery")
DEFINE BAR 91 OF ostatni PROMPT jaz("m_ost kascomp") SKIP FOR EMPTY(m.kasc_server)
*** L.L. (14.03.2007) Prenos s KasComp
IF m.poc_kaspokl >0
	DEFINE BAR 93 OF ostatni PROMPT jaz("m_ostatni_kascomp")		MESSAGE jaz("m_ostatni_kascomp_mssg")
ENDIF
*** L.L. (14.03.2007) Koniec: Prenos s KasComp
IF !EMPTY(m.bart_path)
	DEFINE BAR 94 OF ostatni PROMPT jaz("m_ost_bartech")		MESSAGE jaz("m_ostatni_bartech_mssg")
ENDIF
DEFINE BAR 95 OF ostatni PROMPT jaz("m_ost_happyhour")		MESSAGE jaz("m_ostatni_happyhour_mssg")
IF (LOWER(m.hor_verzia)="hores9" AND m.issql) OR (LOWER(m.hor_verzia)="hores10")
	DEFINE BAR 96 OF ostatni PROMPT IIF(LOWER(m.hor_verzia)="hores9",m.jaz("m_ost_export_hores"),m.jaz("m_ost_export_hores10"))	
ENDIF 
IF m.is_rkeeper
	DEFINE BAR 97 OF ostatni PROMPT m.jaz("m_ost_export_rkeeper")
ENDIF 
DEFINE BAR 99 OF ostatni PROMPT jaz("m_ost_listovanie_zv")		MESSAGE jaz("m_ost_listovanie_zv_mssg")
DEFINE BAR 100 OF ostatni PROMPT jaz("m_ost_listovanie_pi")		MESSAGE jaz("m_ost_listovanie_pi_mssg")
DEFINE BAR 110 OF ostatni PROMPT jaz("m_ost_administrace") MESSAGE "" SKIP FOR ! glis_admin AND IIF(m.is_kongres,_screen.formcount>3,_screen.formcount>2)
DEFINE BAR 111 OF ostatni PROMPT "\-"
DEFINE BAR 112 OF ostatni PROMPT "\-"


ON        BAR  1 OF ostatni ACTI POPUP ostatni_reind
ON SELECTION BAR 21 OF ostatni DO spust_form WITH "prava_skupiny","" in menu_def &&DO FORM prava_skupiny
ON SELECTION BAR 22 OF ostatni DO spust_form WITH "prava_users","" in menu_def &&DO FORM prava_users
IF VARTYPE(m.prava_na_druhy)=="L" AND m.prava_na_druhy
	ON SELECTION BAR 23 OF ostatni DO spust_form WITH "prava_skup","" in menu_def
ENDIF 
ON SELECTION BAR 24 OF ostatni DO spust_form WITH "setstred","" in menu_def &&DO form setstred
IF !m.slovenskaverzia AND !m.issql
	ON SELECTION BAR 25 OF ostatni DO spust_form WITH "man__set","" in menu_def &&DO FORM man__set
ENDIF
ON SELECTION BAR 26 OF ostatni DO spust_form WITH "mrtvoly","" in menu_def &&DO FORM mrtvoly
ON SELECTION BAR 31 OF ostatni DO spust_form WITH "chyby","" in menu_def &&DO chyby IN logy
ON SELECTION BAR 32 OF ostatni DO spust_form WITH "semafor","" in menu_def &&DO FORM semafor
ON        BAR 41 OF ostatni ACTIVATE POPUP ostatni_konecmes
ON        BAR 45 OF ostatni ACTIVATE POPUP ostatni_archivace
ON SELECTION BAR 47 OF ostatni DO spust_form WITH "zezasoby","" in menu_def &&DO FORM zezasoby
IF ATC( "BAKARE", m.wi_zakaz) > 0
	ON SELECTION BAR 48 OF ostatni DO tisk_zad
ENDIF
ON        BAR 66 OF ostatni ACTIVATE POPUP ostatni_kontroly

ON SELECTION BAR 72 OF ostatni DO spust_form WITH "kontrola_inv","" in menu_def &&DO kontrola_inv
ON SELECTION BAR 73 OF ostatni DO spust_form WITH "hodiny_uzaverek","" in menu_def &&DO FORM hodiny_uzaverek

ON        BAR 75 OF ostatni ACTI POPUP speciality
IF !EMPT(m.gcucto_path)
	IF m.slovenskaverzia
		IF LOWER(m.gcuct_perioda)='d'
			ON SELECTION BAR 81 OF ostatni DO spust_form WITH "uctexp0","","uctexp0 with .t." in menu_def &&DO uctexp0 WITH .T.
		ENDIF
		IF VARTYPE(m.gcuct_typ)=="C" AND LOWER(m.gcuct_typ)="spin"
			ON  SELECT BAR 82 OF ostatni DO spust_form WITH "uct_spin","" in menu_def &&DO FORM uct_spin
		ELSE
			ON  SELECT BAR 82 OF ostatni DO spust_form WITH "ucto","" in menu_def &&DO FORM ucto
		ENDIF
	ELSE
		ON      BAR 82 OF ostatni ACTI POPUP uc_exp
	ENDIF
ENDIF
ON SELECTION BAR 88 OF ostatni DO spust_form WITH "uzaverka","" in menu_def &&DO FORM uzaverka
IF m.poc_horcov>0
	ON SELECTION BAR 89 OF ostatni DO spust_form WITH "z_horca","" in menu_def &&DO FORM z_horca
ENDIF
ON SELECTION BAR 90 OF ostatni DO spust_form WITH "uvery","" in menu_def &&DO FORM uvery
ON SELECTION BAR 91 OF ostatni DO spust_form WITH "kascomp","" in menu_def &&DO FORMkascomp

*** L.L. (14.03.2007) Prenos s KasComp
IF m.poc_kaspokl >0
	ON SELECTION BAR 93 OF ostatni DO spust_form WITH "z_kascom","" in menu_def &&DO FORM z_kascom
ENDIF
*** L.L. (14.03.2007) Koniec: Prenos s KasComp
IF !EMPTY(m.bart_path)
	ON SELECTION BAR 94 OF ostatni DO spust_form WITH "bartech","" in menu_def &&DO FORM bartech
ENDIF
ON SELECTION BAR 95 OF ostatni DO spust_form WITH "happyhour","" in menu_def &&DO FORM happyhour
IF (LOWER(m.hor_verzia)="hores9" AND m.issql) OR (LOWER(m.hor_verzia)="hores10")
	ON SELECTION BAR 96 OF ostatni DO spust_form WITH "z_hores10","" in menu_def 
ENDIF 
IF m.is_rkeeper
	ON SELECTION BAR 97 OF ostatni DO spust_form WITH "z_rkeeper","" in menu_def 
ENDIF 

ON SELECTION BAR 99 OF ostatni DO spust_form WITH "listovanie","","listovanie with 'ZV'" in menu_def 
ON SELECTION BAR 100 OF ostatni DO spust_form WITH "listovanie","","listovanie with 'PI'" in menu_def 
ON        BAR 110 OF ostatni ACTI POPUP ostatni_admin

***** .\MILAN\MENU_DEF.PRG


*--------------------------------------------------------

DEFINE POPUP sestavy MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR  1 OF sestavy PROMPT jaz("m_ses hlavicky kalkulaci") MESSAGE jaz("m_ses hlavicky kalkulaci_mssg")
DEFINE BAR  3 OF sestavy PROMPT jaz("m_ses polozky kalkulaci") MESSAGE jaz("m_ses polozky kalkulaci_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  4 OF sestavy PROMPT jaz("m_ses ceniky pokladen") MESSAGE jaz("m_ses ceniky pokladen_mssg")
DEFINE BAR  5 OF sestavy PROMPT jaz("m_ses poloz umistenych receptu") MESSAGE "" SKIP FOR m.gityp_inst=1

DEFINE BAR  7 OF sestavy PROMPT jaz("m_ses ceniky pokladen") + " jidelak" MESSAGE jaz("m_ses ceniky pokladen_mssg") SKIP FOR .NOT. "senat" $ LOWER(gchom_path)

DEFINE BAR 20 OF sestavy PROMPT "\-"
DEFINE BAR 25 OF sestavy PROMPT jaz("m_ses_inventurni sestavy") MESSAGE jaz("m_ses_inventurni sestavy_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 30 OF sestavy PROMPT "\-"
DEFINE BAR 36 OF sestavy PROMPT jaz("m_ses_obratove sestavy") MESSAGE jaz("m_ses_obratove sestavy_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 37 OF sestavy PROMPT jaz("m_ses_pohyby za obdobie") MESSAGE jaz("m_ses_pohyby za obdobie_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 38 OF sestavy PROMPT jaz("m_ses_obratove sestavy_fakt") MESSAGE jaz("m_ses_obratove sestavy_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 39 OF sestavy PROMPT jaz("m_ses_obratove sestavy_hromada") MESSAGE jaz("m_ses_obratove sestavy_mssg") SKIP FOR .t. && SKIP FOR m.gityp_inst=1

DEFINE BAR 40 OF sestavy PROMPT "\-"
DEFINE BAR 45 OF sestavy PROMPT jaz("m_ses_trzbove sestavy") MESSAGE ""
DEFINE BAR 47 OF sestavy PROMPT jaz("m_s_trzby dnes na kasach") MESSA jaz("m_s_trzby dnes na kasach_mssg")
DEFINE BAR 48 OF sestavy PROMPT jaz("m_s_trzby zurnaly") MESSAGE ""
IF !slovenskaverzia AND m.issql
	DEFINE BAR 49 OF sestavy PROMPT jaz("m_s_trzby zurnaly")+" 2" MESSAGE ""
ENDIF 
DEFINE BAR 50 OF sestavy PROMPT "\-"
DEFINE BAR 55 OF sestavy PROMPT jaz("m_ses bouraci tabulka") MESSAGE jaz("m_ses bouraci tabulka_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 56 OF sestavy PROMPT jaz("m_ses dodavatele/odberatele") MESSAGE jaz("m_ses dodavatele/odber_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 59 OF sestavy PROMPT jaz("m_ses opravene doklady") MESSAGE jaz("m_ses opravene doklady_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 80 OF sestavy PROMPT "\-"
DEFINE BAR 81 OF sestavy PROMPT jaz("m_ses porovnanie_trzieb") MESSAGE jaz("m_ses porovnanie_trzieb_mssg")
*DEFINE BAR 85 OF sestavy PROMPT jaz("m_ses prepni archivni data") MESSAGE jaz("m_ses prepni archivni data_mssg") SKIP FOR m.gityp_inst=1
*DEFINE BAR 86 OF sestavy PROMPT jaz("m_ses spoj aktualni+archivni") MESSAGE jaz("") SKIP FOR m.gityp_inst=1
IF m.slovenskaverzia
	DEFINE BAR 90 OF sestavy PROMPT jaz("m_ses alkohol") MESSAGE jaz("m_ses alkohol_mssg") SKIP FOR m.gityp_inst=1
	DEFINE BAR 91 OF sestavy PROMPT jaz("m_ses nehybane") MESSAGE jaz("m_ses nehybane_mssg") SKIP FOR m.gityp_inst=1
	DEFINE BAR 92 OF sestavy PROMPT jaz("m_ses alkohol")+" 474/2009" MESSAGE jaz("m_ses alkohol_mssg") SKIP FOR m.gityp_inst=1
ENDIF

DEFINE BAR 98 OF sestavy PROMPT "\-"
DEFINE BAR 99 OF sestavy PROMPT "\-"

ON SELECTION BAR  1 OF sestavy DO spust_form WITH "s_hlavicky","" in menu_def
ON SELECTION BAR  3 OF sestavy DO spust_form WITH "sel_kalk","" in menu_def
ON SELECTION BAR  4 OF sestavy DO spust_form WITH "s_cennik","" in menu_def
ON SELECTION BAR  5 OF sestavy DO spust_form WITH "poloz_kalk","" in menu_def
ON SELECTION BAR  7 OF sestavy DO spust_form WITH "s_jidelak","" in menu_def

ON SELECTION BAR 25 OF sestavy DO spust_form WITH "zost_inv","" in menu_def
ON SELECTION BAR 36 OF sestavy DO spust_form WITH "dajdokl","" in menu_def
ON SELECTION BAR 37 OF sestavy DO spust_form WITH "dajdokl2","" in menu_def
ON SELECTION BAR 38 OF sestavy DO spust_form WITH "s_faktur","" in menu_def
ON SELECTION BAR 39 OF sestavy DO spust_form WITH "s_obraty_all","" in menu_def

ON SELECTION BAR 45 OF sestavy DO spust_form WITH "s_trzby","","s_trzby_new" in menu_def
ON SELECTION BAR 47 OF sestavy DO spust_form WITH "na_kasach","" in menu_def

IF m.slovenskaverzia OR m.issql
	ON SELECTION BAR 48 OF sestavy DO spust_form WITH "zurnaly","" in menu_def
ELSE 
	ON SELECTION BAR 48 OF sestavy DO spust_form WITH "zurnal_cz","" in menu_def
ENDIF 
IF !m.slovenskaverzia AND m.issql
	ON SELECTION BAR 49 OF sestavy DO spust_form WITH "zurnal_cz","" in menu_def
ENDIF

ON SELECTION BAR 55 OF sestavy DO spust_form WITH "s_bourak","" in menu_def
ON SELECTION BAR 56 OF sestavy DO spust_form WITH "s_partneri","" in menu_def
ON SELECTION BAR 59 OF sestavy DO spust_form WITH "s_opravy","" in menu_def
ON SELECTION BAR 81 OF sestavy DO spust_form WITH "s_compare","" in menu_def 
*ON SELECTION BAR 85 OF sestavy DO prepni_archiv IN menu_def
*ON SELECTION BAR 86 OF sestavy DO aktualni_a_archivni IN menu_def
IF m.slovenskaverzia
	ON SELECTION BAR 90 OF sestavy DO spust_form WITH "alkohol","" in menu_def
	ON SELECTION BAR 91 OF sestavy DO spust_form WITH "nevydane","" in menu_def
	ON SELECTION BAR 92 OF sestavy DO spust_form WITH "alko474","" in menu_def
ENDIF

*--------------------------------------------------------
DEFINE POPUP vzorniky MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR  1 OF vzorniky PROMPT jaz("m_vz_karty") 	       MESS jaz("m_vz_karty_mssg")
DEFINE BAR  2 OF vzorniky PROMPT jaz("m_vz_ceny") 	       MESS jaz("m_vz_ceny_mssg")
DEFINE BAR  3 OF vzorniky PROMPT jaz("m_vz_kalk_umisteni") MESS jaz("m_vz_kalk_umisteni_mssg")
DEFINE BAR  4 OF vzorniky PROMPT jaz("m_vz_umiestn_druhy") MESS jaz("m_vz_umiest_druhy_mssg")
DEFINE BAR  5 OF vzorniky PROMPT "\-"
DEFINE BAR  6 OF vzorniky PROMPT jaz("m_vz_druhy")         MESS jaz("m_vz_druhy_mssg")
DEFINE BAR  7 OF vzorniky PROMPT jaz("m_vz_partneri")      MESS jaz("m_vz_partneri_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  8 OF vzorniky PROMPT jaz("m_vz_bourak")        MESS jaz("m_vz_bourak_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  9 OF vzorniky PROMPT jaz("m_vz_sklad")         MESS jaz("m_vz_sklad_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 10 OF vzorniky PROMPT jaz("m_vz_bourak")+" EDI" MESS jaz("m_vz_bourak_edi_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 16 OF vzorniky PROMPT jaz("m_vz_vypocty prod.cen")
ON SELECTION BAR 16 OF vzorniky DO spust_form WITH "vypocty","" in menu_def 
DEFINE BAR 20 OF vzorniky PROMPT "\-"
DEFINE BAR 21 OF vzorniky PROMPT jaz("m_vz_zpravy do kuchyne") MESS jaz("m_vz_zpravy do kuchyne_mssg")
DEFINE BAR 22 OF vzorniky PROMPT jaz("m_vz_zpravy do kuchyne")+" nové" MESS jaz("m_vz_zpravy do kuchyne_mssg")
DEFINE BAR 29 OF vzorniky PROMPT jaz("m_vz_zalistovani dodavatele") MESS jaz("m_vz_zalistovani dodav_mssg") SKIP FOR m.gityp_inst=1
IF m.slovenskaverzia
	DEFINE BAR 40 OF vzorniky PROMPT jaz("m_vz_vazena_inventuta") MESS jaz("m_vz_vazena_inventura_mssg") SKIP FOR .f.
ELSE
	DEFINE BAR 40 OF vzorniky PROMPT jaz("m_vz_vazena_inventuta") MESS jaz("m_vz_vazena_inventura_mssg") SKIP FOR m.gityp_inst=1
ENDIF
DEFINE BAR 66 OF vzorniky PROMPT jaz("m_vz_kursy men") MESS ""
DEFINE BAR 68 OF vzorniky PROMPT jaz("m_vz_postmix") MESS ""
DEFINE BAR 69 OF vzorniky PROMPT jaz("m_vz_spdan") MESS "" SKIP FOR m.spotrebnadan=0
DEFINE BAR 70 OF vzorniky PROMPT jaz("m_vz_prevadzky") MESS "" SKIP FOR !m.alkoprevadzky
DEFINE BAR 71 OF vzorniky PROMPT jaz("m_vz_karty") + " - nazvy limity" MESS jaz("m_vz_karty_mssg")
DEFINE BAR 72 OF vzorniky PROMPT jaz("m_vz_triedenie") MESS jaz("m_vz_triedenie_mssg")
IF m.slovenskaverzia
	DEFINE BAR 73 OF vzorniky PROMPT jaz("m_vz_zameny_tlac") MESS jaz("m_vz_zam_tlac_mssg")
    ON SELECTION BAR 73 OF vzorniky DO spust_form WITH "objzameny","" in menu_def
ENDIF
DEFINE BAR 75 OF vzorniky PROMPT jaz("m_vz_karty") + " - EANY"
DEFINE BAR 76 OF vzorniky PROMPT jaz("m_vz_karty_del")
IF m.issql
	DEFINE BAR 77 OF vzorniky PROMPT jaz("m_vz_miestnosti")
	DEFINE BAR 78 OF vzorniky PROMPT jaz("m_vz_karty_obj")
    ON SELECTION BAR 77 OF vzorniky DO spust_form WITH "miestnosti","" in menu_def
    ON SELECTION BAR 78 OF vzorniky DO spust_form WITH "karty_objednavanie","" in menu_def
ENDIF 
DEFINE BAR 79 OF vzorniky PROMPT jaz("m_vz_typypohybov")
DEFINE BAR 80 OF vzorniky PROMPT jaz("m_vz_prevadzky")
DEFINE BAR 81 OF vzorniky PROMPT jaz("m_vz_obaly") SKIP FOR !m.issql
DEFINE BAR 82 OF vzorniky PROMPT jaz("m_vz_alergeny") 
DEFINE BAR 83 OF vzorniky PROMPT jaz("m_vz_kalorie") 
DEFINE BAR 84 OF vzorniky PROMPT jaz("m_vz_lock") 
IF m.issql
	DEFINE BAR 85 OF vzorniky PROMPT jaz("m_vz_cenovky")
ENDIF 
DEFINE BAR 98 OF vzorniky PROMPT "\-"
DEFINE BAR 99 OF vzorniky PROMPT "\-"

ON SELECTION BAR  1 OF vzorniky DO spust_form WITH "karty","grdkarty" in menu_def
ON SELECTION BAR  2 OF vzorniky DO spust_form WITH "prod_cen","grdkarty" in menu_def 
ON SELECTION BAR  3 OF vzorniky DO spust_form WITH "umisteni","" in menu_def 
ON SELECTION BAR  4 OF vzorniky DO spust_form WITH "umdruhy","" in menu_def 
ON SELECTION BAR  6 OF vzorniky DO spust_form WITH "skup_new","" in menu_def 
ON SELECTION BAR  7 OF vzorniky DO spust_form WITH "partneri","" in menu_def 
ON SELECTION BAR  8 OF vzorniky DO spust_form WITH "bourak","" in menu_def 
ON SELECTION BAR  9 OF vzorniky DO spust_form WITH "sklad","" in menu_def 
ON SELECTION BAR 10 OF vzorniky DO spust_form WITH "bourak_edi","" in menu_def 
ON SELECTION BAR 21 OF vzorniky DO spust_form WITH "kuchmssg","" in menu_def
ON SELECTION BAR 22 OF vzorniky DO spust_form WITH "spravy","" in menu_def 
ON SELECTION BAR 29 OF vzorniky DO spust_form WITH "dod_list","" in menu_def 
ON SELECTION BAR 40 OF vzorniky DO spust_form WITH "vaz_inv","" in menu_def 
ON SELECTION BAR 66 OF vzorniky DO spust_form WITH "kursy","" in menu_def 
ON SELECTION BAR 68 OF vzorniky DO spust_form WITH "pmxfood","" in menu_def 
ON SELECTION BAR 69 OF vzorniky DO spust_form WITH "spotrebdan","" in menu_def 
ON SELECTION BAR 70 OF vzorniky DO spust_form WITH "prevadzky","" in menu_def 
ON SELECTION BAR 71 OF vzorniky DO spust_form WITH "karty_texty","" in menu_def 
ON SELECTION BAR 72 OF vzorniky DO spust_form WITH "triedenie","" in menu_def
ON SELECTION BAR 75 OF vzorniky DO FORM vz_eany
ON SELECTION BAR 76 OF vzorniky DO spust_form WITH "kartydel","" in menu_def
ON SELECTION BAR 79 OF vzorniky DO spust_form WITH "typypohybov","" in menu_def
ON SELECTION BAR 80 OF vzorniky DO spust_form WITH "edi_prevadzky","" in menu_def
ON SELECTION BAR 81 OF vzorniky DO spust_form WITH "obaly","" in menu_def
ON SELECTION BAR 82 OF vzorniky DO spust_form WITH "setalergeny","" in menu_def
ON SELECTION BAR 83 OF vzorniky DO spust_form WITH "setkalorie","" in menu_def
ON SELECTION BAR 84 OF vzorniky DO spust_form WITH "setlock","" in menu_def
IF m.issql
	ON SELECTION BAR 85 OF vzorniky DO spust_form WITH "cenovky","" in menu_def
ENDIF 

*--------------------------------------------------------
DEFINE POPUP pohyby MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR  1 OF pohyby PROMPT jaz("m_poh_prijem_int") MESS jaz("m_poh_prijem_int_mssg")
DEFINE BAR  2 OF pohyby PROMPT jaz("m_poh_vydej_int") + IIF(m.vice_firem_1_food, " (i mezifiremni)", "")  MESS jaz("m_poh_vydej_int_mssg")
DEFINE BAR  6 OF pohyby PROMPT "\-"
DEFINE BAR  7 OF pohyby PROMPT jaz("m_poh_prijem_ext") MESS jaz("m_poh_prijem_ext_mssg")
DEFINE BAR  8 OF pohyby PROMPT jaz("m_poh_vydej_ext")  MESS jaz("m_poh_vydej_ext_mssg")
DEFINE BAR  9 OF pohyby PROMPT jaz("m_poh_vratka_ext") MESS jaz("m_poh_vratka_ext_mssg")
***x***DEFINE BAR 12 OF pohyby PROMPT jaz("m_poh_vydej_ext")  + " v jednom Foodu" MESS jaz("m_poh_vydej_ext_mssg") SKIP FOR .not. m.vice_firem_1_food
DEFINE BAR 16 OF pohyby PROMPT "\-"
DEFINE BAR 17 OF pohyby PROMPT jaz("m_poh_inv kompl")  MESS jaz("m_poh_inv kompl_mssg") SKIP FOR !EMPTY(m.sqlsuffix)
DEFINE BAR 18 OF pohyby PROMPT jaz("m_poh_inv po polozkach")  MESS jaz("m_poh_inv poloz_mssg") SKIP FOR !EMPTY(m.sqlsuffix)
DEFINE BAR 20 OF pohyby PROMPT "\-"
DEFINE BAR 21 OF pohyby PROMPT jaz("m_poh_bourani")               MESS jaz("m_poh_bourani_mssg")
DEFINE BAR 22 OF pohyby PROMPT jaz("m_poh_bourani") + " receptur" MESS jaz("m_poh_bourani_mssg")
IF m.is_straty
	DEFINE BAR 23 OF pohyby PROMPT jaz("m_poh_bourani") + " straty" MESS jaz("m_poh_bourani_mssg")
ENDIF 
DEFINE BAR 30 OF pohyby PROMPT "\-"
DEFINE BAR 33 OF pohyby PROMPT jaz("m_poh_preceneni")  MESS jaz("m_poh_preceneni_mssg") SKIP FOR !EMPTY(m.sqlsuffix)
DEFINE BAR 35 OF pohyby PROMPT "\-"
DEFINE BAR 36 OF pohyby PROMPT jaz("m_poh_zadanka")    MESS jaz("m_poh_zadanka_mssg")
DEFINE BAR 37 OF pohyby PROMPT jaz("m_poh_vydej zadanky")    MESS jaz("m_poh_vydej zadanky_mssg")
DEFINE BAR 40 OF pohyby PROMPT "\-"
DEFINE BAR 43 OF pohyby PROMPT jaz("m_poh_zadanka_extreni") MESS jaz("m_poh_zadanka_extreni_mssg")
DEFINE BAR 44 OF pohyby PROMPT jaz("m_poh_zadanka_extreni_skup") MESS jaz("m_poh_zadanka_extreni_mssg")
DEFINE BAR 45 OF pohyby PROMPT jaz("m_poh_zadanka_extreni_makro") MESS jaz("m_poh_zadanka_extreni_mssg")
DEFINE BAR 46 OF pohyby PROMPT jaz("m_poh_zadanka_extreni_central") MESS jaz("m_poh_zadanka_extreni_mssg")
IF m.issql
	DEFINE BAR 47 OF pohyby PROMPT jaz("m_poh_objednavka_externi")  MESS jaz("m_poh_zadanka_extreni_mssg")
    ON SELECTION BAR 47 OF pohyby                              DO spust_form WITH "zadanka4","","zadanka4" IN menu_def
ENDIF 
DEFINE BAR 49 OF pohyby PROMPT jaz("m_poh_prijem zadanky") MESS jaz("m_poh_prijem zadanky_mssg")
DEFINE BAR 50 OF pohyby PROMPT "\-"
DEFINE BAR 51 OF pohyby PROMPT jaz("m_poh_tisk etiket") MESS jaz("m_poh_tisk etiket_mssg") SKIP FOR EMPT(m.ean_print)
DEFINE BAR 56 OF pohyby PROMPT jaz("m_poh_do zasoby")   MESS jaz("m_poh_prijem_ext_mssg")
DEFINE BAR 58 OF pohyby PROMPT jaz("m_poh_prijem_int_rucni") MESS jaz("m_poh_prijem_int_rucni_mssg")
DEFINE BAR 60 OF pohyby PROMPT "\-"
DEFINE BAR 61 OF pohyby PROMPT jaz("m_poh_sberna faktura") MESS jaz("m_poh_tisk etiket_mssg")
DEFINE BAR 62 OF pohyby PROMPT "\-"
DEFINE BAR 63 OF pohyby PROMPT jaz("m_poh_zadanka edi") MESS jaz("m_poh_zadanka edi_mssg")
DEFINE BAR 64 OF pohyby PROMPT jaz("m_poh_zadanka suma") MESS jaz("m_poh_zadanka sumar_mssg")
DEFINE BAR 98 OF pohyby PROMPT "\-"
DEFINE BAR 99 OF pohyby PROMPT "\-"

ON SELECTION BAR  1 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM prij_int',"prij_int"

IF "D_ALTO" $ UPPER(gchom_path) OR "D_SALTO" $ UPPER(gchom_path)
	ON SELECTION BAR  2 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej_a with "VV"',"vydej_a"
	ON SELECTION BAR  7 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM pri_ex_a with "E"',"pri_ex_a"
    ON SELECTION BAR  8 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej_a with "VE"',"vydej_a"
    ON SELECTION BAR  9 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej_a with "VR"',"vydej_a"
ELSE
	IF m.slovenskaverzia
		ON SELECTION BAR  2 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej with "VV"',"vydej"
		ON SELECTION BAR  7 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM pri_ext with "PE"',"pri_ext"
	    ON SELECTION BAR  9 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej with "VR"',"vydej"
        ON SELECTION BAR  8 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej with "VE"',"vydej"
***x***        ON SELECTION BAR 12 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej_new with "VV"', "vydej"
	ELSE
*		ON SELECTION BAR  2 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej     with "VV"', "vydej"
    	ON SELECTION BAR  2 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej_new with "VV"', "vydej"
		ON SELECTION BAR  7 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM pri_ext with "PE"',"pri_ext"
    	ON SELECTION BAR  9 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej with "VR"',"vydej"
    	    ON SELECTION BAR  8 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej with "VE"',"vydej"
***x***            ON SELECTION BAR 12 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vydej_new with "VV"', "vydej"
	ENDIF 
ENDIF

ON SELECTION BAR 17 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM inventur with "KOMPL"',"inventur"
ON SELECTION BAR 18 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM inventur with "VYB"',"inventur"

ON SELECTION BAR 21 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM buracka'      ,"buracka"
ON SELECTION BAR 22 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM buracka_kalk' ,"buracka"
IF m.is_straty
	ON SELECTION BAR 23 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM buracka_straty' ,"buracka"
ENDIF 
ON SELECTION BAR 33 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM precenen',"precenen"
ON SELECTION BAR 36 OF pohyby                              DO spust_form WITH "zadanka","","zadanka WITH 'ZV'" IN menu_def 
ON SELECTION BAR 37 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM vyd_zad',"vyd_zad"

ON SELECTION BAR 43 OF pohyby                              DO spust_form WITH "zadanka","","zadanka WITH 'ZE'" IN menu_def 
ON SELECTION BAR 44 OF pohyby                              DO spust_form WITH "zadanka2","","zadanka2 WITH 'ZE'" IN menu_def 
ON SELECTION BAR 45 OF pohyby                              DO spust_form WITH "zadanka_makro","","zadanka_makro WITH 'ZE'" IN menu_def
ON SELECTION BAR 46 OF pohyby                              DO spust_form WITH "zadanka3","","zadanka3 WITH 'ZE'" IN menu_def
ON SELECTION BAR 49 OF pohyby DO FORM kontrola_inventury WITH  ' DO FORM oprava with "ZE",.t.,.t.',"oprava"

ON SELECTION BAR 51 OF pohyby                              DO spust_form WITH "ean_prn","" in menu_def
ON SELECTION BAR 56 OF pohyby                              DO spust_form WITH "p_v_buff","" in menu_def
ON SELECTION BAR 58 OF pohyby DO FORM kontrola_inventury WITH ' DO FORM prij_inm with "V"',"prij_inm"
ON SELECTION BAR 61 OF pohyby                              DO spust_form WITH "fakt_sf","" in menu_def 
ON SELECTION BAR 63 OF pohyby                              DO spust_form WITH "zadanka_edi","" in menu_def 
ON SELECTION BAR 64 OF pohyby                              DO spust_form WITH "sumar_zad","" in menu_def 
*--------------------------------------------------------
DEFINE POPUP opravy MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR  1 OF opravy PROMPT jaz("m_opr_prijem_int")	 MESS jaz("m_opr_prijem_mssg")
DEFINE BAR  2 OF opravy PROMPT jaz("m_opr_vydej_i")	     MESS jaz("m_opr_sklad_mssg")
DEFINE BAR  3 OF opravy PROMPT "\-"
DEFINE BAR  4 OF opravy PROMPT jaz("m_opr_prijem")       MESS jaz("m_opr_prijem_mssg")
DEFINE BAR  5 OF opravy PROMPT jaz("m_opr_vydej_e")      MESS jaz("m_opr_vydej_e_mssg")
DEFINE BAR  6 OF opravy PROMPT jaz("m_opr_vratka_e")     MESS jaz("m_opr_vratka_mssg")
DEFINE BAR  7 OF opravy PROMPT jaz("m_poh_bourani")    MESS jaz("m_poh_bourani_mssg")
DEFINE BAR 10 OF opravy PROMPT "\-"
DEFINE BAR 12 OF opravy PROMPT jaz("m_opr_dle c_dokl")     MESS jaz("m_opr_dle c_dokl mssg")
DEFINE BAR 50 OF opravy PROMPT "\-"
DEFINE BAR 51 OF opravy PROMPT jaz("m_opr_inventura")  MESS jaz("m_opr_inventura_mssg") SKIP FOR !EMPTY(m.sqlsuffix)
DEFINE BAR 52 OF opravy PROMPT jaz("m_opr_inventura")+" - " +jaz("storno posledni")  MESS jaz("m_opr_inventura_mssg") SKIP FOR !EMPTY(m.sqlsuffix)
DEFINE BAR 60 OF opravy PROMPT "\-"
DEFINE BAR 61 OF opravy PROMPT jaz("m_opr_storno odp kasy")  MESS jaz("m_opr_storno odp kasy_mssg") SKIP FOR !EMPTY(m.sqlsuffix)
DEFINE BAR 62 OF opravy PROMPT jaz("m_opr_storno odp polot") MESS jaz("m_opr_storno odp polot_mssg") SKIP FOR !EMPTY(m.sqlsuffix)
DEFINE BAR 70 OF opravy PROMPT "\-"
DEFINE BAR 74 OF opravy PROMPT jaz("m_opr_sberna faktura")       MESS jaz("m_opr_prijem_mssg")
DEFINE BAR 80 OF opravy PROMPT "\-"
DEFINE BAR 84 OF opravy PROMPT jaz("m_opr_zadanka")
DEFINE BAR 85 OF opravy PROMPT jaz("m_opr_zadanka2")
DEFINE BAR 86 OF opravy PROMPT jaz("m_opr_objednavka")
DEFINE BAR 87 OF opravy PROMPT jaz("m_opr_objednavka") + " EDI"
*DEFINE BAR 88 OF opravy PROMPT jaz("m_opr_davka")
DEFINE BAR 98 OF opravy PROMPT "\-"
DEFINE BAR 99 OF opravy PROMPT "\-"

ON SELECTION BAR  1 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "PV"',"oprava"
ON SELECTION BAR  2 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "VV"',"oprava"

ON SELECTION BAR  4 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "PE"',"oprava"
ON SELECTION BAR  5 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "VE"',"oprava"
ON SELECTION BAR  6 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "VR"',"oprava"
ON SELECTION BAR  7 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "PB"',"oprava"

ON SELECTION BAR 12 OF opravy DO FORM kontrola_inventury WITH ' DO FORM opravystart with ""',"opravystart"

ON SELECTION BAR 51 OF opravy DO spust_form WITH "o_inven","" in menu_def &&DO FORM o_inven
ON SELECTION BAR 52 OF opravy DO spust_form WITH "o_inven","","o_inven WITH 'storno'" IN menu_def &&FORM o_inven WITH "storno"

ON SELECTION BAR 61 OF opravy DO FORM kontrola_inventury WITH ' DO FORM stor_odp',"stor_odp"
ON SELECTION BAR 62 OF opravy DO FORM kontrola_inventury WITH ' DO FORM stor_pol',"stor_pol"

ON SELECTION BAR 74 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "SF"',"oprava"
ON SELECTION BAR 84 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "ZV"',"oprava"
ON SELECTION BAR 85 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "ZV",.f.,.t.',"oprava"
ON SELECTION BAR 86 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "ZE"',"oprava"
ON SELECTION BAR 87 OF opravy DO FORM kontrola_inventury WITH ' DO FORM oprava with "ZO"',"oprava"
*ON SELECTION BAR 88 OF opravy DO spust_form WITH "opr_davk","" in menu_def

*--------------------------------------------------------
DEFINE POPUP odpocty MARGIN RELATIVE SHADOW COLOR SCHEME 4

DEFINE BAR  1 OF odpocty PROMPT jaz("m_odp_kasy")             MESS jaz("m_odp_kasy_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  2 OF odpocty PROMPT jaz("m_odp_davky")            MESS jaz("m_odp_davky_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR  5 OF odpocty PROMPT jaz("m_odp_davky mnohostred")  MESS jaz("m_odp_davky_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 13 OF odpocty PROMPT jaz("m_odp_dluhy")             MESS jaz("m_odp_dluhy_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 41 OF odpocty PROMPT "\-"
DEFINE BAR 44 OF odpocty PROMPT jaz("m_prov_rauty") MESS jaz("m_prov_priprava_vyroby_mssg") SKIP FOR m.gityp_inst=1

IF m.slovenskaverzia
	IF !m.issql AND FILE(m.gcdat_path + "limity.dbf")
		DEFINE BAR 45 OF odpocty PROMPT jaz("m_prov_limity") MESS jaz("m_prov_limity_mssg") SKIP FOR m.gityp_inst=1
	ENDIF
ELSE
	IF !m.issql AND FILE(m.gcdat_path + "limity.dbf") AND !m.is_newlim
		DEFINE BAR 45 OF odpocty PROMPT jaz("m_prov_limity") MESS jaz("m_prov_limity_mssg") SKIP FOR m.gityp_inst=1
	ENDIF
ENDIF

DEFINE BAR 46 OF odpocty PROMPT jaz("m_maz_dlhy") MESS jaz("m_maz_dlhy_mssg") SKIP FOR m.gityp_inst=1
IF m.is_newlim
	DEFINE BAR 47 OF odpocty PROMPT jaz("m_prov_limity")+" - nové" MESS jaz("m_prov_limity_mssg") SKIP FOR m.gityp_inst=1
ENDIF
DEFINE BAR 48 OF odpocty PROMPT jaz("m_odp_plan") MESS jaz("m_odp_plan_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 49 OF odpocty PROMPT jaz("m_odp_plan_karty") MESS jaz("m_odp_plan_karty_mssg") SKIP FOR m.gityp_inst=1
DEFINE BAR 51 OF odpocty PROMPT jaz("m_odp_nahled_spotreby") SKIP FOR m.gityp_inst=1
DEFINE BAR 98 OF odpocty PROMPT "\-"
DEFINE BAR 99 OF odpocty PROMPT "\-"

ON SELECTION BAR  1 OF odpocty DO FORM kontrola_inventury WITH ' DO FORM odp_kas',"odp_kas"
ON SELECTION BAR  2 OF odpocty DO FORM kontrola_inventury WITH ' DO FORM davka',"davka"
ON SELECTION BAR  5 OF odpocty DO FORM kontrola_inventury WITH ' DO form davka_or',"davka_or"
ON SELECTION BAR 13 OF odpocty DO FORM kontrola_inventury WITH ' DO form odp_dlh',"odp_dlh"
ON SELECTION BAR 44 OF odpocty DO spust_form WITH "rauty","" in menu_def &&DO FORM rauty
IF m.slovenskaverzia
	IF !m.issql AND FILE(m.gcdat_path + "limity.dbf")
		ON SELECTION BAR 45 OF odpocty DO spust_form WITH "limity","" in menu_def &&DO FORM limity
	ENDIF
ELSE 
	IF !m.issql AND FILE(m.gcdat_path + "limity.dbf") AND !m.is_newlim
		ON SELECTION BAR 45 OF odpocty DO spust_form WITH "limity","" in menu_def &&DO FORM limity
	ENDIF
ENDIF
ON SELECTION BAR 46 OF odpocty DO spust_form WITH "maz_dlh","" in menu_def &&DO FORM maz_dlh
IF m.is_newlim
	ON SELECTION BAR 47 OF odpocty DO spust_form with "lim_hl","gridzoznam" in menu_def
ENDIF
ON SELECTION BAR 48 OF odpocty DO spust_form WITH "planovanie","" in menu_def
ON SELECTION BAR 49 OF odpocty DO spust_form WITH "plan_sklad","" in menu_def
ON SELECTION BAR 51 OF odpocty DO FORM kontrola_inventury WITH ' DO FORM odp_kas_maso',"odp_kas"

*--------------------------------------------------------
DEFINE POPUP vyber_skl MARGIN RELATIVE SHADOW COLOR SCHEME 4
m.vysledoktestu=n_checkall("UPDATE_STRUKTUR")
IF ! EMPTY(m.vysledoktestu)
	TRY 
		MESSAGEBOX(jaz("ted nelze, zkuste pozdeji") + CHR(13) + jaz("form_bezi_stru_upd")+ CHR(13)+ m.vysledoktestu, 16+256, "FoodMan", 3333)
	CATCH
		MESSAGEBOX(jaz("ted nelze, zkuste pozdeji") + CHR(13) + jaz("form_bezi_stru_upd"), 16+256, "FoodMan", 3333)
	ENDTRY 
ELSE 
	IF m.issql
		rv("fooddat","food_dat")
	ELSE
		USE (m.fn_food_dat) ALIAS food_dat
	ENDIF
	IF m.kontrolujservisy
		SELECT * FROM food_dat INTO CURSOR fooddat WHERE servis>0
	ELSE
		SELECT * FROM food_dat INTO CURSOR fooddat
	ENDIF 
	IF m.glis_admin
		SELECT c_stredisk, id_zkratka, ID WHERE id_menu LIKE "%" + m.gcgroup_id + "%" AND pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" ;
			ORDER BY id_zkratka FROM fooddat INTO CURSOR sklady
	ELSE
		IF m.issql
			m.s_pgm=m.gcpgm
			USE (m.sqlprefix+"rug") ALIAS ugr IN 0
		ELSE
			USE (m.gchom_path + "ug___" + m.gcpgm) ALIAS ugr IN 0 AGAIN
		ENDIF
		SELECT ID WHERE user_id = m.gcuser_id FROM ugr INTO CURSOR id1

		SELECT ID WHERE pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" AND prava_skup == ID AND prava_skup IN (SELECT ID FROM id1) ;
			FROM fooddat INTO CURSOR id3
		IF USED("id3")
			IF RECCOUNT("id3")>0
				SELECT ID WHERE pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" AND prava_skup IN (SELECT ID FROM id3) ;
					FROM fooddat INTO CURSOR id2 READWRITE
				IF USED("id2")
					IF RECCOUNT("id2")>0
						INSERT INTO id2 (id) SELECT id FROM id1
						SELECT c_stredisk, id_zkratka, ID WHERE id_menu LIKE "%" + m.gcgroup_id + "%" AND pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" ;
							AND ID IN (SELECT ID FROM id2) ;
							ORDER BY id_zkratka FROM fooddat INTO CURSOR sklady
					ELSE
						SELECT c_stredisk, id_zkratka, ID WHERE id_menu LIKE "%" + m.gcgroup_id + "%" AND pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" ;
							AND ID IN (SELECT ID FROM id3) ;
							ORDER BY id_zkratka FROM fooddat INTO CURSOR sklady
					ENDIF
				ELSE
					SELECT c_stredisk, id_zkratka, ID WHERE id_menu LIKE "%" + m.gcgroup_id + "%" AND pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" ;
						AND ID IN (SELECT ID FROM id3) ;
						ORDER BY id_zkratka FROM fooddat INTO CURSOR sklady
				ENDIF
			ELSE
				SELECT c_stredisk, id_zkratka, ID WHERE id_menu LIKE "%" + m.gcgroup_id + "%" AND pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" ;
					AND ID IN (SELECT ID FROM id1) ;
					ORDER BY id_zkratka FROM fooddat INTO CURSOR sklady
			ENDIF

		ELSE
			SELECT c_stredisk, id_zkratka, ID WHERE id_menu LIKE "%" + m.gcgroup_id + "%" AND pgm LIKE "MAN%" AND pgm_param NOT LIKE "KAN%" ;
				AND ID IN (SELECT ID FROM id1) ;
				ORDER BY id_zkratka FROM fooddat INTO CURSOR sklady
		ENDIF
		DO pozavirej WITH "id1, id2, id3, ugr"
	ENDIF
	DO pozavirej WITH "fooddat, food_dat"

	TRY 
	ii = 1
	IF m.slovenskaverzia
		DO open_database
		IF m.issql
			rv("uctobd","uctobd")
			rv("inventurstrediska","inventur")
		ELSE
			USE (m.fn_doklady) IN 0 ALIAS doklady
			USE (m.fn_sk_sez)  IN 0 ALIAS sk_sez
			USE (m.fn_uctobd)  IN 0 ALIAS uctobd
			IF FILE(m.gccen_path+"inventur.dbf")
				USE (m.gccen_path+"inventur.dbf") IN 0
			ENDIF 
		ENDIF

		dajp('neprijatevv','dkneprijatevv')
		dajp('neodcitane' ,'dkneodcitane')
		
		SELECT sklady
		Scan
			Select uctobd
			Locate For c_stredisk=sklady.c_stredisk
			Select dkneprijatevv
			Sum pocetd To m.pd For c_partner=sklady.c_stredisk
			Sum pocetd To m.pda For c_partner=sklady.c_stredisk .And. mesiac<=uctobd.uctobd
			Select dkneodcitane
			Sum pocetu To m.pu For id_man=sklady.Id
			Sum pocetu To m.pua For id_man=sklady.Id .And. mesiac<=uctobd.uctobd
			IF USED("inventur")
				SELECT inventur
				LOCATE FOR c_stredisk=sklady.c_stredisk
				IF FOUND()
					txt_invent=" inv."
				ELSE
					txt_invent=SPACE(5)
				ENDIF 
			ELSE
				txt_invent=SPACE(5)
			ENDIF 
			Select sklady
	        txt_prijemky = IIF(m.pd=0 and m.pda=0, SPACE(LEN(jaz("form tbprijemky"))), jaz("form tbprijemky")) + TRANSFORM(m.pd, "@Z 999") + TRANSFORM(m.pda, "@Z /99  ")
	        txt_odpocty  = IIF(m.pu=0 and m.pua=0, SPACE(LEN(jaz("form tbodpocty"))),  jaz("form tbodpocty"))  + TRANSFORM(m.pu, "@Z 999") + TRANSFORM(m.pua, "@Z /99  ")
			Define Bar m.ii Of vyber_skl Prompt sklady.id_zkratka + " " + txt_prijemky + txt_odpocty + txt_invent + Str(sklady.c_stredisk, 9) Font 'Courier NEW', 8
			ii = ii + 1
		Endscan
	ELSE
		DO open_database
		IF m.issql
			rv("inventurstrediska","inventur")
		ELSE
			USE (m.fn_doklady) IN 0 ALIAS doklady NOUPDATE 
			USE (m.fn_sk_sez)  IN 0 ALIAS sk_sez  NOUPDATE 
			IF FILE(m.gccen_path+"inventur.dbf")
				USE (m.gccen_path+"inventur.dbf") IN 0
			ENDIF 
		ENDIF

		dajp('neprijatevv','dkneprijatevv')
		dajp('neodcitane' ,'dkneodcitane')
		SELECT sklady
		Scan
			Select dkneprijatevv
			Sum pocetd To m.pd For c_partner=sklady.c_stredisk
			Select dkneodcitane
			Sum pocetu To m.pu For id_man=sklady.Id
			IF USED("inventur")
				SELECT inventur
				LOCATE FOR c_stredisk=sklady.c_stredisk
				IF FOUND()
					txt_invent=" "+jaz("form inventura")
				ELSE
					txt_invent=" "+SPACE(LEN(jaz("form inventura")))
				ENDIF 
			ELSE
				txt_invent=" "+SPACE(LEN(jaz("form inventura")))
			ENDIF 
			Select sklady
	        txt_prijemky = IIF(m.pd=0, SPACE(LEN(jaz("form tbprijemky"))), jaz("form tbprijemky")) + TRANSFORM(m.pd, "@Z 999  ")
	        txt_odpocty  = IIF(m.pu=0, SPACE(LEN(jaz("form tbodpocty"))),  jaz("form tbodpocty"))  + TRANSFORM(m.pu, "@Z 999")
			Define Bar m.ii Of vyber_skl Prompt sklady.id_zkratka + " " + txt_prijemky + txt_odpocty + txt_invent + Str(sklady.c_stredisk, 9) Font 'Courier NEW', 8
			ii = ii + 1
		Endscan
	ENDIF
	CATCH
	ENDTRY 
ENDIF 
DO pozavirej WITH 'doklady,sk_sez,sklady,dkneodcitane,dkneprijatevv,uctobd, inventur'
CLOSE DATABASES
DEFINE BAR 998 OF vyber_skl PROMPT "\-"
DEFINE BAR 999 OF vyber_skl PROMPT "\-"

ON SELE POPUP vyber_skl DO vyber_sklad IN menu_def WITH VAL(RIGHT(PROMPT(), 8))
DO pozavirej WITH "food_dat, ug, id1, id2, id3, sklady"

*-----------------------------------------------------------------
DEFINE POPUP kongres MARGIN RELATIVE SHADOW COLOR SCHEME 4
IF m.is_kongres
	DEFINE BAR 1 OF kongres PROMPT "" +da.atext(131)+"" COLOR SCHEME 3
	DEFINE BAR 2 OF kongres PROMPT "" +da.atext(185)+"" COLOR SCHEME 3
	DEFINE BAR 3 OF kongres PROMPT "" +da.atext(186)+"" COLOR SCHEME 3
	DEFINE BAR 4 OF kongres PROMPT "" +da.atext(167)+"" COLOR SCHEME 3
	DEFINE BAR 5 OF kongres PROMPT "" +da.atext(65) +"" COLOR SCHEME 3
	DEFINE BAR 6 OF kongres PROMPT "x" COLOR SCHEME 3 	SKIP FOR .t.

	DEFINE POPUP kong1 MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF kong1 PROMPT "" +da.atext(131)+""
	DEFINE BAR 2 OF kong1 PROMPT "" +da.atext(146)+""
	ON SELECTION BAR 1 OF kong1 sy.do_form(41)
	ON SELECTION BAR 2 OF kong1 sy.do_form(65)
	ON  BAR 1 OF kongres ACTIVATE POPUP kong1

	ON  SELECTION BAR 2 OF kongres do form k_prehlady_kongres

	DEFINE POPUP m_k_cisel MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF m_k_cisel PROMPT "" +da.atext(299)+""
	DEFINE BAR 2 OF m_k_cisel PROMPT "" +da.atext(132)+""
	DEFINE BAR 3 OF m_k_cisel PROMPT "" +da.atext(140)+""
	DEFINE BAR 4 OF m_k_cisel PROMPT "" +da.atext(139)+""
	DEFINE BAR 5 OF m_k_cisel PROMPT "" +da.atext(135)+""
	DEFINE BAR 6 OF m_k_cisel PROMPT "\-"
	DEFINE BAR 7 OF m_k_cisel PROMPT "" +da.atext(67)+""
	DEFINE BAR 8 OF m_k_cisel PROMPT "" +da.atext(85)+""
	DEFINE BAR 9 OF m_k_cisel PROMPT "\-"
	DEFINE BAR 10 OF m_k_cisel PROMPT "" +da.atext(155)+""
	DEFINE BAR 11 OF m_k_cisel PROMPT "" +da.atext(142)+""
	DEFINE BAR 12 OF m_k_cisel PROMPT "\-"
	DEFINE BAR 13 OF m_k_cisel PROMPT "" +da.atext(9)+""
	DEFINE BAR 14 OF m_k_cisel PROMPT "\-"
	DEFINE BAR 15 OF m_k_cisel PROMPT "" +da.atext(43)+""
	DEFINE BAR 16 OF m_k_cisel PROMPT "" +da.atext(76)+""
	DEFINE BAR 17 OF m_k_cisel PROMPT "\-"
	DEFINE BAR 18 OF m_k_cisel PROMPT "" +da.atext(168)+""
	DEFINE BAR 19 OF m_k_cisel PROMPT "" +da.atext(468)+""
	DEFINE BAR 20 OF m_k_cisel PROMPT "" +da.atext(189)+""
	DEFINE BAR 21 OF m_k_cisel PROMPT "\-"
	DEFINE BAR 22 OF m_k_cisel PROMPT "" +da.atext(69)+""
	ON  BAR 3 OF kongres ACTIVATE POPUP m_k_cisel

	ON SELECTION BAR 1 OF m_k_cisel sy.do_formo('kl')
	ON SELECTION BAR 2 OF m_k_cisel sy.do_formo('ko')
	ON SELECTION BAR 3 OF m_k_cisel sy.do_formo('do')
	ON SELECTION BAR 4 OF m_k_cisel sy.do_formo('vy')
	ON SELECTION BAR 5 OF m_k_cisel sy.do_formo('zo')
	ON SELECTION BAR 7 OF m_k_cisel sy.do_form(14)
	ON SELECTION BAR 8 OF m_k_cisel sy.do_form(22)
	ON SELECTION BAR 10 OF m_k_cisel sy.do_form(52)
	ON SELECTION BAR 11 OF m_k_cisel sy.do_form(49)
	ON SELECTION BAR 13 OF m_k_cisel sy.do_form(2)
	ON SELECTION BAR 15 OF m_k_cisel sy.do_form(6)
	ON SELECTION BAR 16 OF m_k_cisel sy.do_form(20)
	ON SELECTION BAR 18 OF m_k_cisel sy.do_form(64)
	ON SELECTION BAR 19 OF m_k_cisel sy.do_form(165)
	ON SELECTION BAR 20 OF m_k_cisel sy.do_form(72)
	ON SELECTION BAR 22 OF m_k_cisel sy.do_form(168)

	DEFINE POPUP m_k_tlac MARGIN RELATIVE SHADOW COLOR SCHEME 4

	ON SELECTION  BAR 4 OF kongres do form tf_congress


	DEFINE POPUP m_k_sys MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 3 OF m_k_sys PROMPT "" +da.atext(197)+""
	DEFINE BAR 4 OF m_k_sys PROMPT "" +da.atext(182)+""

	ON  BAR 5 OF kongres ACTIVATE POPUP m_k_sys
	ON SELECTION BAR 3 OF m_k_sys do form appar_de
	ON SELECTION BAR 4 OF m_k_sys sy.do_form(70)
ENDIF
************************************************************************
PROC prepni_archiv
z_archivu = ! m.z_archivu
IF m.z_archivu
	DEFINE BAR 85 OF sestavy PROMPT jaz("m_ses prepni aktualni data") MESSAGE ""
ELSE
	DEFINE BAR 85 OF sestavy PROMPT jaz("m_ses prepni archivni data") MESSAGE ""
ENDIF

IF m.z_archivu
	fn_dokl_s = m.fn_dokl_a
	fn_obra_s = m.fn_obra_a
ELSE
	fn_dokl_s = m.fn_doklady
	fn_obra_s = m.fn_obraty
ENDIF

************************************************************************
PROCEDURE aktualni_a_archivni
had_aaa = CREATEOBJECT("had", "spojovani archivnich a aktualnich dat")
had_aaa.SHOW()
fn_dokl_s = m.gcpri_path + "dokl_aaa"
fn_obra_s = m.gcpri_path + "obra_aaa"
COPY FILE (m.fn_dokl_a + ".dbf") TO (m.fn_dokl_s + ".dbf")
COPY FILE (m.fn_dokl_a + ".cdx") TO (m.fn_dokl_s + ".cdx")
had_aaa.set_had(33)
COPY FILE (m.fn_obra_a + ".dbf") TO (m.fn_obra_s + ".dbf")
COPY FILE (m.fn_obra_a + ".cdx") TO (m.fn_obra_s + ".cdx")
had_aaa.set_had(55)
USE (m.fn_dokl_s)
APPEND FROM (m.fn_doklady) FOR operace # "PR"
had_aaa.set_had(88)
USE (m.fn_obra_s)
APPEND FROM (m.fn_obraty)  FOR operace # "PR"
USE
z_archivu = .T.
DEFINE BAR 85 OF sestavy PROMPT jaz("m_ses prepni aktualni data") MESSAGE ""
RELEASE had_aaa

************************************************************************
PROCEDURE exi_to_fox
PARAMETERS archivuj, nasilu
IF EMPTY(m.nasilu)
	IF m.is_revenueman
		DO FORM revenueman WITH "spotreba",m.gcpgm_id, m.uctobd
	ENDIF 
	IF VARTYPE(m.hor_verzia)="C" AND LOWER(m.hor_verzia)="hores9" AND m.issql
		DO FORM z_horesu
	ENDIF 
	DO FORM autoexec WITH "Z"
	DO zalohovac with m.archivuj
	DO zurnal_log WITH "UZAVE"
ENDIF 
IF TYPE('_screen.label') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label')
ENDIF
IF TYPE('_screen.label1') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label1')
ENDIF
IF TYPE('_screen.label2') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label2')
ENDIF
IF TYPE('_screen.logo') = 'O' THEN
	_SCREEN.REMOVEOBJECT('logo')
ENDIF
IF TYPE('_screen.label3') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label3')
ENDIF
IF TYPE('_screen.label4') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label4')
ENDIF
IF TYPE('_screen.label5') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label5')
ENDIF
IF TYPE('_screen.infobox') = 'O' THEN
	_SCREEN.REMOVEOBJECT('infobox')
ENDIF
IF TYPE('tbscreen') = 'O' THEN
	RELEASE tbscreen
ENDIF
IF TYPE('tbscreenskl') = 'O' THEN
	RELEASE tbscreenskl
ENDIF
CLEAR EVENTS

************************************************************************
PROCEDURE vyber_sklad
LPARAM defa_stred
PRIVATE m.hladajcstredisk
CLOSE DATABASES




m.vysledoktestu=n_checkall("UPDATE_STRUKTUR")
IF ! EMPTY(m.vysledoktestu)
	TRY 
		MESSAGEBOX(jaz("ted nelze, zkuste pozdeji") + CHR(13) + jaz("form_bezi_stru_upd")+ CHR(13)+ m.vysledoktestu, 16+256, "FoodMan", 3333)
	CATCH
		MESSAGEBOX(jaz("ted nelze, zkuste pozdeji") + CHR(13) + jaz("form_bezi_stru_upd"), 16+256, "FoodMan", 3333)
	ENDTRY 
	RETURN .f.
ENDIF 



had_vs = CREATEOBJECT("had", "vyber_sklad")
had_vs.SHOW()
IF gic_stredisk # 0
	DO zurnal_log WITH "UZAVE"
ENDIF
IF !EMPTY(m.gcpgm_id) AND m.is_revenueman
	DO FORM revenueman WITH "spotreba", m.gcpgm_id, m.uctobd
ENDIF 

sqlsuffix=""
IF TYPE('_screen.label') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label')
ENDIF
IF TYPE('_screen.label1') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label1')
ENDIF
IF TYPE('_screen.label2') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label2')
ENDIF
IF TYPE('_screen.label3') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label3')
ENDIF
IF TYPE('_screen.label4') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label4')
ENDIF
IF TYPE('_screen.label5') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label5')
ENDIF
IF TYPE('_screen.infobox') = 'O' THEN
	_SCREEN.REMOVEOBJECT('infobox')
ENDIF
IF TYPE('_screen.logo') = 'O' THEN
	_SCREEN.REMOVEOBJECT('logo')
ENDIF
*IF TYPE('tbscreenskl') = 'O' THEN
*	RELEASE tbscreenskl
*ENDIF
IF VARTYPE(m.fn_hesla)<>"C" OR EMPTY(m.fn_hesla)
	fn_hesla     = gcpri_path + "hesla"
ENDIF 
fn_buffer    = gcpri_path + "buffer"
fn_bufdokl   = gcpri_path + "buf_dokl"
STORE "" TO neprijate_prijemky, neprijate_prijemky_txt
IF EMPTY(m.defa_stred)
	m.defa_stred = 91827346
ENDIF
SELECT 0
DO pozavirej WITH "food_dat"
IF m.issql
	TRY 
		rv("fooddat_edikody","fooddatedi")
	CATCH
	ENDTRY 
	rv("fooddat","food_dat")
ELSE
    USE (m.gcpri_path + "strediska") ALIAS food_dat
*	USE (m.fn_food_dat) ALIAS food_dat
ENDIF
IF m.kontrolujservisy
	LOCATE FOR c_stredisk = m.defa_stred AND servis>0
	IF ! FOUND()
		GO TOP 
		LOCATE FOR c_stredisk = -71 AND servis>0
		IF ! FOUND()
			GO TOP 
			LOCATE FOR pgm = "MAN" AND servis>0
		ENDIF
	ENDIF
ELSE
	LOCATE FOR c_stredisk = m.defa_stred
	IF ! FOUND()
		GO TOP 
		LOCATE FOR c_stredisk = -71
		IF ! FOUND()
			GO TOP 
			LOCATE FOR pgm = "MAN"
		ENDIF
	ENDIF
ENDIF 

***********  ***********  ***********  ***********  ***********
***********  ***********  ***********  ***********  ***********
IF FOUND()
	IF ALLTRIM(food_dat.pgm)="KONGRES"
		m.iba_kongres=.t.
	ELSE
		m.iba_kongres=.f.
	ENDIF

    had_vs.set_txt2("found_servisy")
	DO prepni_sklad WITH .t.
    had_vs.set_txt2("prepnuto")
	rcdat_path   = m.gcdat_path
	rccen_path   = m.gccen_path
	rcpgm_id     = m.gcpgm_id
	rcpgm		 = m.gcpgm
	rcid_zkratka = m.gcid_zkratka
	rcpgm_param  = m.gcpgm_param
	rcsetup_skup = m.gcsetup_skup
	rcbour_skup  = m.gcbour_skup
	rcpgmskupina = m.gcpgmskupina
	rcstredskup  = m.gcstredskup
	rczadan_prn = m.gczadan_prn
	rcera_cen	 = m.gcera_cen
	ric_stredisk = m.gic_stredisk
	rcprava_skup = m.gcprava_skup
	rn_cas_hlav = m.fn_cas_hlav
	rn_cas_pol = m.fn_cas_pol
	rn_hh_hlav = m.fn_hh_hlav
	rn_hh_druhy = m.fn_hh_druhy
	rn_hh_kalky = m.fn_hh_kalky
	rn_eany = m.fn_eany
	rn_karty = m.fn_karty
	rn_kkarty = m.fn_kkarty
	rn_kceny = m.fn_kceny
	rn_ktexty = m.fn_ktexty
	rn_krest = m.fn_krest
	rn_ktried = m.fn_ktried
	rn_tried = m.fn_tried
	rn_edihlav = m.fn_edihlav
	rn_edipol = m.fn_edipol
	rn_skupiny = m.fn_skupiny
	rn_vypocty = m.fn_vypocty
	rn_bourak = m.fn_bourak
	rn_umisteni = m.fn_umisteni
	rn_partneri = m.fn_partneri
	rn_polozky = m.fn_polozky
	rn_listovanie = m.fn_listovanie
	rn_sklad = m.fn_sklad
	rn_doklady = m.fn_doklady
	rn_obraty = m.fn_obraty
	rn_obr_alk = m.fn_obr_alk
	rn_dokl_a = m.fn_dokl_a
	rn_obra_a = m.fn_obra_a
	rn_dokl_sto = m.fn_dokl_sto
	rn_obra_sto = m.fn_obra_sto
	rn_buff_d = fn_buff_d
	rn_buff_r = fn_buff_r
	rn_davky = m.fn_davky
	rn_dluhy = m.fn_dluhy
	rn_uzav = m.fn_uzav
	rn_uzav_pohyby = m.fn_uzav_pohyby
	rn_parovaky = m.fn_parovaky
	rn_sk_sez = m.fn_sk_sez
	rn_sk_pol = m.fn_sk_pol
	rn_sk_fin = m.fn_sk_fin
	rn_sk_plt = m.fn_sk_plt
	rn_sk_txt = m.fn_sk_txt
	rn_sk_fis = m.fn_sk_fis
	rn_sk_vklvy = m.fn_sk_vklvy
	rn_sk_sez_a = m.fn_sk_sez_a
	rn_sk_pol_a = m.fn_sk_pol_a
	rn_sk_fin_a = m.fn_sk_fin_a
	rn_sk_plt_a = m.fn_sk_plt_a
	rn_sk_txt_a = m.fn_sk_txt_a
	rn_sk_fis_a = m.fn_sk_fis_a
	rn_sk_vklvy_a = m.fn_sk_vklvy_a
	rn_limity   = m.fn_limity
	rn_limitdni = m.fn_limitdni
	rn_limitstrava = m.fn_limitstrava
	rn_limitstravnici = m.fn_limitstravnici
	rn_limitstatus = m.fn_limitstatus
	rn_limitrov = m.fn_limitrov
	rn_limit_hl = m.fn_limit_hl
	rn_limitchody = m.fn_limitchody
	rn_limittypy = m.fn_limittypy
	rn_limittypchody = m.fn_limittypchody
	rn_limitsablhl = m.fn_limitsablhl
	rn_limitsablpol = m.fn_limitsablpol
	rn_limitsabldni = m.fn_limitsabldni
	rn_limithladiny = m.fn_limithladiny
	rn_limitrovhladiny = m.fn_limitrovhladiny
	rn_expfaktura = m.fn_expfaktura

	rn_spotrebnadan = m.fn_spotrebnadan
	rn_umdruhy = m.fn_umdruhy
	rcid_klapky = m.gcid_klapky
	rcman_edi_kod=m.man_edi_kod

	***********  ***********  ***********  ***********  ***********
	***********  ***********  ***********  ***********  ***********

	*** M.B. ***
	*** Potrebujem mat uz tu nacitane niektore premenne
	IF m.prvespustenie
        had_vs.set_txt2("prvespustenie")
		IF m.issql
			DO sql_set_scat WITH m.gcpgm_path + "food_set.dbf",UPPER("food_set"),""
		ELSE
			DO set_scat WITH m.gcpgm_path + "food_set.dbf", m.gchom_path + "food_set.dbf"
		ENDIF
	ENDIF 
	IF VARTYPE(m.typ_konca)<>"C"
		IF m.slovenskaverzia
			typ_konca = "UZAVIERKA"
		ELSE
			typ_konca = "KONIEC"
		ENDIF
	ENDIF 
	IF m.slovenskaverzia
		hotel_krajina="SVK"
		IF EMPTY(m.hotel_krajina)
			hotel_krajina="SVK"
		ELSE
			IF UPPER(m.hotel_krajina)="CZE"
				DO CASE 
					CASE m.gcjazyk="0"
						gcjazyk="1"
					CASE m.gcjazyk="1"
						gcjazyk="0"
				ENDCASE 
			ENDIF
		ENDIF
	ELSE
		IF EMPTY(m.hotel_krajina)
			hotel_krajina="CZE"
		ENDIF
	ENDIF
    nastav_meny(m.hotel_krajina)

	SELECT 0
	IF m.issql
		USE (m.sqlprefix+"ructobd") ALIAS uctobd
		=CURSORSETPROP("Buffering" ,5,"uctobd")
	ELSE
		USE (m.fn_uctobd) ALIAS uctobd
	ENDIF
	LOCATE FOR c_stredisk=m.gic_stredisk
	IF FOUND()
		m.uctobd=uctobd.uctobd
		IF !m.slovenskaverzia
        	IF m.uctobd < DTOS(DATE()-99)
            	m.uctobd = LEFT(DTOS(DATE()),6)
	        ENDIF 
		ENDIF
	ELSE
		m.uctobd=LEFT(DTOS(DATE()),6)
	ENDIF
	IF m.slovenskaverzia
		IF m.sleduj_alko
			m.is_alko474=(m.uctobd>=m.alko474start)
		ELSE
			m.is_alko474=.F.
		ENDIF
	ELSE
		m.is_alko474=.F.
	ENDIF
	DO setmeny
	USE IN uctobd



	IF !USED("food_dat")
		SELECT 0
		IF m.issql
			rv("fooddat","food_dat")
		ELSE
			USE (m.fn_food_dat) ALIAS food_dat
		ENDIF
		LOCATE FOR c_stredisk = m.defa_stred
	ENDIF 
	SELECT food_dat
	DO setscreen


	DO n_sunlock
	DO n_slock WITH "IS_ACTIVE_" + gcpgm_id + m.machine_semaf

	IF EMPTY(m.xml_export_path) OR !DIRECTORY(m.xml_export_path)
		xml_export_path = m.gcdat_path
	ENDIF 
    WAIT "cekam na xml_export_path " + m.xml_export_path WINDOW AT 22,22 NOWAIT 
    IF !DIRECTORY(m.xml_export_path)
        xml_export_path = m.gcdat_path
    ENDIF 
    WAIT CLEAR 
	IF m.slovenskaverzia
		IF m.prvespustenie 
*			IF .t.
			m.lic_foodie_verzia="1.5.8"
			IF !(".FXP"$UPPER(SYS(16,0)))
				IF VARTYPE(m.hotel_id)="N" AND m.hotel_id<>0 
					DO prispusteni IN vtiger
					IF !EMPTY(m.lic_pokec) OR !EMPTY(m.lic_sprava)
						DO FORM infoform
					ENDIF 
					IF !EMPTY(m.lic_pokec)
						_SCREEN.ADDOBJECT('label5','f_label')
						_SCREEN.label5.FONTSIZE = 15
						_SCREEN.label5.FONTBOLD = .T.
						_SCREEN.label5.FONTSHADOW = .T.
						_SCREEN.label5.BACKSTYLE = 0
						_SCREEN.label5.FORECOLOR=RGB(255,0,0)
						TRY
							_SCREEN.label5.CAPTION=m.lic_pokec
						CATCH
							_SCREEN.label5.CAPTION=""
						ENDTRY
						_SCREEN.label5.FONTNAME=m.label_font
						DO WHILE TXTWIDTH(_SCREEN.label5.CAPTION,_SCREEN.label5.FONTNAME,_SCREEN.label5.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.label5.FONTNAME,_SCREEN.label5.FONTSIZE,"BS")  > (_SCREEN.WIDTH-20)
							IF _SCREEN.label5.FONTSIZE>5
								_SCREEN.label5.FONTSIZE=_SCREEN.label5.FONTSIZE-1
							ELSE
								EXIT
							ENDIF
						ENDDO
						_SCREEN.label5.WIDTH=_screen.width-_screen.infobox.width
						
						_SCREEN.label5.LEFT=10
						_SCREEN.label5.TOP=10
						_SCREEN.label5.HEIGHT=FONTMETRIC(1,_SCREEN.label5.FONTNAME,_SCREEN.label5.FONTSIZE,"BS")
						_SCREEN.label5.ALIGNMENT = 0
						_SCREEN.label5.VISIBLE=.T.
					ENDIF 
				ELSE
					=MESSAGEBOX(jaz("form_nulove_id"),64,"FoodMan",5000)
					DO nastavnuloveid IN vtiger				
				ENDIF 
			ENDIF 
		ENDIF
	ELSE
		IF VARTYPE("hotline_id")<>"C"
			PUBLIC hotline_id
			m.hotline_id=""
		ENDIF
	ENDIF
	IF !m.cts_enabled
		m.cts_act_instaled=.f.
	ENDIF
	*** M.B. ***
	IF m.prvespustenie
		DO stru_upd
		IF m.issql
			DO FORM chk_migracie WITH .t.
		ENDIF 
	ENDIF
	DO nastavpocetedikodov
	IF !m.iba_kongres
		IF m.issql
			DO sql_set_scat WITH m.gcpgm_path + PADR(m.gcpgm, 5, "_") + "set.dbf",m.gcpgm,m.gcsetup_skup
		ELSE
			DO set_scat WITH m.gcpgm_path + PADR(m.gcpgm, 5, "_") + "set.dbf", ;
				m.gchom_path + "s_" + PADR(m.gcpgm, 4, "_") + m.gcsetup_skup + ".dbf"
		ENDIF
		DO FORM kartyskl
		IF m.prvespustenie .AND. m.calc_ceny
			DO FORM calcceny
		ENDIF
		IF m.issql
			DO open_database
			m.hladajcstredisk=m.gic_stredisk
			USE (m.sqlprefix+"rneprijatevv1") ALIAS vyber1
		ELSE
            TRY 
			SELE d.c_dokl, datum_dokl, SUM(o.mnozstvi) AS mnozstvi ;
				WHERE d.operace = "VV" AND d.c_partner = m.gic_stredisk AND EMPT(d.pz2) ;
				GROUP BY 1 HAVING mnozstvi # 0;
				FROM (m.fn_doklady) d LEFT JOIN (m.fn_obraty) o ON o.c_dokl = d.c_dokl ;
				INTO cursor vyber1 readwrite && TABLE (m.gcpri_path + "vyber1")
            CATCH 
                CREATE CURSOR vyber1 (c_dokl I)
                neprijate_prijemky = ""
            ENDTRY 
		ENDIF
		had_vs.set_had(33)
		SELECT vyber1
		IF prazdna()
			neprijate_prijemky = "-"
		ELSE
			neprijate_prijemky = "P"
			SCAN
				neprijate_prijemky_txt = m.neprijate_prijemky_txt + CHR(13) + DTOC(datum_dokl) + STR(c_dokl) + "  P"
			ENDSCAN
		ENDIF
		had_vs.set_had(55)
		IF m.issql
			DO pozavirej WITH "vyber1"
			USE (m.sqlprefix+"rnevydanezv") ALIAS vyber1
		ELSE
            TRY 
			SELE d.c_dokl, datum_dokl, SUM(o.mnozstvi) AS mnozstvi ;
				WHERE d.operace = "ZV" AND d.c_stredisk = m.gic_stredisk AND EMPT(d.pz2) ;
				GROUP BY 1 HAVING mnozstvi # 0;
				FROM (m.fn_doklady) d LEFT JOIN (m.fn_obraty) o ON o.c_dokl = d.c_dokl ;
				INTO cursor vyber1 readwrite && INTO TABLE (m.gcpri_path + "vyber1")
            CATCH 
                CREATE CURSOR vyber1 (c_dokl I)
            ENDTRY 
		ENDIF
		had_vs.set_had(88)
		IF prazdna()
			neprijate_prijemky = neprijate_prijemky + "-"
		ELSE
			neprijate_prijemky = neprijate_prijemky + "Z"
			SCAN
				neprijate_prijemky_txt = m.neprijate_prijemky_txt + CHR(13) + DTOC(datum_dokl) + STR(c_dokl) + "  Z"
			ENDSCAN
		ENDIF
	ELSE
		IF m.issql
			DO open_database
			m.hladajcstredisk=m.gic_stredisk
			USE (m.sqlprefix+"rneprijatevv1") ALIAS vyber1
		ENDIF
	ENDIF
	RELEASE had

	IF m.issql
		m.vysledok=sql_exec("SELECT food600.doplnstrediskadopartnerov()", "vyber1")
	ELSE
		USE (m.fn_partneri) ALIAS partneri ORDER c_partner
		SELE 0
		USE (m.gcpri_path + "strediska") ORDER ID
		IF FSIZE("edi_kod")=0
			SCAN
				SCATTER FIELD c_stredisk, id_zkratka, stredskup, zadan_prn, a1 MEMVAR
				SELECT partneri
				SET ORDER TO c_partner
				IF SEEK(m.c_stredisk)
					REPLACE partner WITH m.id_zkratka, ico WITH m.stredskup
				ELSE
					INSERT INTO (m.fn_partneri) (c_partner , partner     , ico        , dic    , cen_hlad) ;
	                                   VALUES (m.c_stredisk, m.id_zkratka, m.stredskup, m.zadan_prn, m.a1)
				ENDIF
				SELECT strediska
			ENDSCAN
		ELSE
			SCAN
				SCATTER FIELD c_stredisk, id_zkratka, stredskup, zadan_prn, a1, edi_kod MEMVAR
				SELECT partneri
				SET ORDER TO c_partner
				IF SEEK(m.c_stredisk)
					REPLACE partner WITH m.id_zkratka, ico WITH m.stredskup, edi_kod WITH m.edi_kod
				ELSE
					INSERT INTO (m.fn_partneri) (c_partner , partner     , ico        , dic    , cen_hlad,   edi_kod) ;
	                                   VALUES (m.c_stredisk, m.id_zkratka, m.stredskup, m.zadan_prn, m.a1, m.edi_kod)
				ENDIF
				SELECT strediska
			ENDSCAN
		ENDIF 
	ENDIF
	DO jazykini
ELSE
	WAIT "Neexistuje default sklad" WIND TIME 1
	DO jazykini
ENDIF
clos_data()

IF m.prvespustenie
    had_vs.set_txt2("s_o_l")
	DO s_o_lic
 
   had_vs.set_txt2("dalsi prve spustenie 2")
	IF m.gityp_inst=1 AND !m.issql
		SELECT 0
		USE (m.fn_obraty)
		DELETE ALL
		USE
		USE (m.fn_doklady)
		DELETE ALL
		USE
		USE (m.fn_obra_a)
		DELETE ALL
		USE
		USE (m.fn_dokl_a)
		DELETE ALL
		USE
		USE (m.fn_sklad)
		DELETE ALL
		USE
		USE (m.fn_karty) ALIAS fnkarty
		DELETE FOR EMPTY(druh_kalk)
		SELECT 0
		USE (m.fn_polozky) ALIAS fnpolozky
		DELETE from fnpolozky WHERE !(c_poloz IN (SELECT c_karty from fnkarty))
		DO pozavirej WITH "fnpolozky, fnkarty"
		USE (m.fn_skupiny)
		DELETE FOR EMPTY(typ_kalk)
		REPLACE ALL typ_kalk WITH "K"
		USE
	ENDIF
	IF ATC("menuland", m.wi_zakaz) > 0
		DO citajmenuland
	ENDIF 
	prvespustenie=.F.
ELSE
	IF !naozajspustit
		DO pozavirej WITH "fn_h" + "esla"
		UPDATE (m.fn_hesla) SET j = "\" + j WHERE LEFT(klic, 3) = "m" + "m_" AND ("y" $ klic OR "ul" $ klic OR "ed" $ klic) AND LEFT(j,1)<>"\"
		USE
	ENDIF
ENDIF


DO titulek
IF m.iba_kongres
	DO menukongres
ELSE
    had_vs.set_txt2("menu-def")
	DO menu_def
    had_vs.set_txt2("max-maxima")
	DO max_maxima IN indexy
	DO zurnal_log WITH "START"

    DO FORM autoexec WITH "S"
    
    
    
    IF .not. m.slovenskaverzia
        DO depehacka
    ENDIF

    
    

	DO CASE
        CASE BETWEEN(m.jen_autoexec,"e", "i")
            * nehlasi se nic
		CASE m.neprijate_prijemky = "P-"
			= MESSAGEBOX(m.neprijate_prijemky_txt , 0+64+256, jaz("mssg mate neprijate prijemky"), m.mssg_time)
		CASE m.neprijate_prijemky = "-Z"
			= MESSAGEBOX(m.neprijate_prijemky_txt , 0+64+256, jaz("mssg mate nevydane zadanky"), m.mssg_time)
		CASE m.neprijate_prijemky = "PZ"
			= MESSAGEBOX(m.neprijate_prijemky_txt , 0+64+256, jaz("mssg mate neprijate prij/zad"), m.mssg_time)
	ENDCASE
ENDIF
day_of_weak(1)= jaz("dow_Po")
day_of_weak(2)= jaz("dow_Ut")
day_of_weak(3)= jaz("dow_St")
day_of_weak(4)= jaz("dow_Ct")
day_of_weak(5)= jaz("dow_Pa")
day_of_weak(6)= jaz("dow_So")
day_of_weak(7)= jaz("dow_Ne")

IF TYPE('tbscreen') = 'O' 
	IF VARTYPE(m.hotel_edikod)=="C" AND !EMPTY(m.hotel_edikod)
		tbscreen.timer1.interval=1000
		tbscreen.naposledy=0
	ENDIF 
	tbscreen.prekresli()
ENDIF 

*** L.L. (28.11.2005) Licencia ********************************************************************
IF m.slovenskaverzia
	IF !EMPTY(m.lic_pokec)
		LOCAL casteraz
		m.casteraz=SECONDS()
		DO WHILE .t.
			=MESSAGEBOX(m.lic_pokec,64,"FoodMan",5000)
			IF SECONDS()-m.casteraz>30
				EXIT
			ENDIF
		ENDDO
	ENDIF
	IF m.is_licenc
		m.dico_len=LEN(m.hotel_ico)
		m.smer=1
		m.tw=""
		m.dw=""
		m.hd=""
		FOR i=1 TO LEN(m.hotel_ico)+8
			IF m.smer=1
				m.tw=m.tw+SUBSTR(m.valid_thru,i,1)
				IF m.dico_len>0
					m.smer=2
				ENDIF
			ELSE
				m.hd=m.hd+SUBSTR(m.valid_thru,i,1)
				m.dico_len=m.dico_len-1
				IF LEN(m.tw)<8
					m.smer=1
				ENDIF
			ENDIF
		ENDFOR
		m.dw=RIGHT(m.tw,2)+"."+SUBSTR(m.tw,5,2)+"."+LEFT(m.tw,4)
		IF (SYS(2007, LEFT(m.valid_thru,LEN(m.tw)+LEN(m.hd))) = SUBSTR(m.valid_thru, LEN(m.tw)+LEN(m.hd)+1) .AND. DTOS(DATE()) < m.tw .AND. m.hotel_ico=m.hd)
			IF VAL(SYS(11,m.dw))-VAL(SYS(1))<5
				MESSAGEBOX(jaz("prg lic platna iba")+" "+ALLTRIM(STR(VAL(SYS(11,m.dw))-VAL(SYS(1))));
					+ " "+IIF(VAL(SYS(11,m.dw))-VAL(SYS(1))=1, jaz("prg den"), jaz("prg dni"))+".", jaz("form Licencia"), 0+48+0)
			ENDIF
			m.is_expired = .F.
		ELSE
			m.is_expired = .T.
		ENDIF
		RELEASE m.tw,m.hd,m.dw,m.dico_len,m.smer
	ELSE
		m.is_expired = .F.
	ENDIF

	IF m.is_expired
		MESSAGEBOX(jaz("prg lic neplatna")+"!", jaz("form licencia"), 0+48+0)
		DO FORM licencia
	ENDIF
ELSE
	m.is_expired=.F.
ENDIF

IF m.is_expired
	DO exi_to_fox IN menu_def
	DO shut_dn
ENDIF


*** L.L. (28.11.2005) Koniec: Licencia ***********************************************************


************************************************************************
PROC dod_list
DO clos_data
USE (m.fn_partneri) ALIAS partneri ORDER partner
SET FILTER TO c_partner > 0
DEFI POPU ppp PROMPT FIELD partner FONT (m.gcdefa_font) STYLE "B"
ON SELE POPUP ppp DEACTI POPUP
ACTI POPUP ppp
IF ! EMPT(PROMPT())
	gic_partner = partneri.c_partner
	gc_partner = partneri.partner
	DO FORM dod_list
ENDIF

DO clos_data

************************************************************************
PROCEDURE prij_int
IF n_slock("POHYBY_PV" + m.gcpgm_id)
	DO FORM prij_int
	= n_sunlock("POHYBY_PV" + m.gcpgm_id)

ELSE
	= MESSAGEBOX(jaz("form_prijima_niekto_iny"),0+16+256, jaz("m_poh_prijem_int"), 3333)
ENDIF



************************************************************************
PROCEDURE aboutbox
LOCAL loaboutbox
SET CLASSLIB TO about ADDITIVE
TRY 
	loaboutbox = CREATEOBJECT("About_Food", ;
		"FoodMan", ;
		"6.01", ;
		"Alto Praha, s.r.o. + Alto Slovakia, s.r.o.", ;
		"Evzen a Milan", ;
		"BITMAPS\food600.BMP")
CATCH
	RETURN
ENDTRY 
loaboutbox.SHOW()
RELEASE CLASSLIB about.vcx
RELEASE loaboutbox

*!*****************************************************************************
PROCEDURE relog
PARAMETERS s_navratom
IF m.is_revenueman
	DO FORM revenueman WITH "spotreba",m.gcpgm_id, m.uctobd
ENDIF 
IF TYPE('_screen.label') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label')
ENDIF
IF TYPE('_screen.label1') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label1')
ENDIF
IF TYPE('_screen.label2') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label2')
ENDIF
IF TYPE('_screen.label3') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label3')
ENDIF
IF TYPE('_screen.label4') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label4')
ENDIF
IF TYPE('_screen.label5') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label5')
ENDIF
IF TYPE('_screen.logo') = 'O' THEN
	_SCREEN.REMOVEOBJECT('logo')
ENDIF
IF TYPE('_screen.infobox') = 'O' THEN
	_SCREEN.REMOVEOBJECT('infobox')
ENDIF
IF TYPE('tbscreen') = 'O' THEN
	RELEASE tbscreen
ENDIF
IF TYPE('tbscreenskl') = 'O' THEN
	RELEASE tbscreenskl
ENDIF
_SCREEN.PICTURE = m.gcini_path + "BITMAPS\pozadi.gif"
SET SYSMENU TO
CLOSE DATABASES 
IF EMPTY(m.s_navratom)
	m.gcuser_id=""
ENDIF
DO FORM login

*!*****************************************************************************
PROCEDURE setscreen
PRIVATE xxl, koeficient, oldx, oldy, m.bolfooddat
LOCAL naslosa, label_farba
m.naslosa=.f.
_SCREEN.PICTURE = ""
IF TYPE('_screen.label') = 'O' THEN
_SCREEN.REMOVEOBJECT('label')
ENDIF
IF TYPE('_screen.label1') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label1')
ENDIF
IF TYPE('_screen.label2') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label2')
ENDIF
IF TYPE('_screen.logo') = 'O' THEN
	_SCREEN.REMOVEOBJECT('logo')
ENDIF
IF TYPE('_screen.label3') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label3')
ENDIF
IF TYPE('_screen.label4') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label4')
ENDIF
IF TYPE('_screen.label5') = 'O' THEN
	_SCREEN.REMOVEOBJECT('label5')
ENDIF
IF TYPE('_screen.infobox') = 'O' THEN
	_SCREEN.REMOVEOBJECT('infobox')
ENDIF
IF !USED("food_dat")
	SELECT 0
	IF m.issql
		rv("fooddat","food_dat")
	ELSE
		USE (m.fn_food_dat) ALIAS food_dat
	ENDIF
	LOCATE FOR c_stredisk = m.gic_stredisk
	m.bolfooddat=.f.
ELSE 
	m.bolfooddat=.t.
ENDIF 

TRY
	uctobdtxt=setucttxt(m.uctobd)
CATCH
	uctobdtxt=""
ENDTRY

IF VARTYPE(m.label_font)="C" AND !EMPTY(m.label_font)
	=AFONT(fontypole)
	FOR m.i=1 TO ALEN(fontypole)
		IF ALLTRIM(LOWER(m.label_font))=ALLTRIM(LOWER(fontypole(m.i)))
			m.label_font=ALLTRIM(m.fontypole(m.i))
			m.naslosa=.t.
			EXIT
		ENDIF 
	ENDFOR 
ENDIF 
IF !m.naslosa
	m.label_font="Arial"
ENDIF 
IF VARTYPE(m.l_farbar)="N" AND VARTYPE(m.l_farbag)="N" AND VARTYPE(m.l_farbab)="N" AND BETWEEN(m.l_farbar,0,255) AND BETWEEN(m.l_farbag,0,255) AND BETWEEN(m.l_farbab,0,255)
	m.label_farba=RGB(m.l_farbar,m.l_farbag,m.l_farbab)
ELSE
	IF m.slovenskaverzia
		IF "buf"$m.fn_doklady .or. !EMPTY(m.sqlsuffix)
			m.label_farba=RGB(0,0,0)
		ELSE 
*			m.label_farba=RGB(205,255,204)
			m.label_farba=RGB(0,0,0)
		ENDIF 
	ELSE
		m.label_farba=RGB(255,255,255)
	ENDIF	
ENDIF 

DO CASE
	CASE VAL(ALLTRIM(food_dat.pozadi)) # 0
		_SCREEN.BACKCOLOR = VAL(ALLTRIM(food_dat.pozadi))

	CASE "RGB" $ UPPER(food_dat.pozadi)
		_SCREEN.BACKCOLOR = EVALUATE(food_dat.pozadi)

	CASE "FOODMAN" $ UPPER(food_dat.pozadi) OR "FOODLOGO" $ UPPER(food_dat.pozadi) OR EMPTY(food_dat.pozadi)
		_SCREEN.ADDOBJECT('logo','_image')
		IF m.slovenskaverzia
			IF "buf"$m.fn_doklady .or. !EMPTY(m.sqlsuffix)
				_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman_cervene.jpg")
			ELSE 
				DO CASE 
					CASE m.gcfarba_pozadia="SIVE"
						_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman_sive.jpg")
					CASE m.gcfarba_pozadia="MODRE"
						_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman_modre.jpg")
					CASE m.gcfarba_pozadia="ZELENE"
						_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman_zelene.jpg")
					OTHERWISE 
						_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman.jpg")
				ENDCASE 
			ENDIF 
		ELSE
			IF m.issql
				IF FILE(m.gcini_path+"bitmaps\foodman_cz_sql.jpg")
					_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman_cz_sql.jpg")
				ELSE
					_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman.jpg")
				ENDIF 
			ELSE 
				IF FILE(m.gcini_path+"bitmaps\foodman_cz.jpg")
					_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman_cz.jpg")
				ELSE
					_SCREEN.LOGO.PICTURE=(m.gcini_path+"bitmaps\foodman.jpg")
				ENDIF 
			ENDIF 
		ENDIF	
		m.oldx=_screen.logo.width
		IF m.oldx=0
			m.oldx=2000
		ENDIF
		m.oldy=_screen.logo.height
		IF m.oldy=0
			m.oldy=1244
		ENDIF
		
		m.koeficient=_screen.width/m.oldx
		_SCREEN.LOGO.HEIGHT=m.oldy*m.koeficient
		_SCREEN.LOGO.WIDTH=m.oldx*m.koeficient
		_SCREEN.LOGO.STRETCH= 1
		IF _SCREEN.LOGO.HEIGHT<_screen.height
			_SCREEN.LOGO.HEIGHT=_screen.height
			_SCREEN.LOGO.STRETCH= 2
		ENDIF 
		_SCREEN.LOGO.TOP=_screen.Height-_screen.logo.height
		_SCREEN.LOGO.VISIBLE=.T.
		_screen.AddObject("infobox","f_container")
		_screen.infobox.width=_screen.width/3
		_screen.infobox.backstyle=0
*		_screen.infobox.backcolor=RGB(185,185,185)
		_screen.infobox.borderwidth=0
		_screen.infobox.height=_screen.height
		_screen.infobox.top=0
		_screen.infobox.left=_screen.width-_screen.infobox.width
		_SCREEN.infobox.ADDOBJECT('label','f_label')
		_SCREEN.infobox.LABEL.FONTSIZE = 36
		_SCREEN.infobox.LABEL.FONTBOLD = .F.
		IF m.slovenskaverzia
			_SCREEN.infobox.LABEL.BACKSTYLE = 1
			IF "buf"$m.fn_doklady .or. !EMPTY(m.sqlsuffix)
				_SCREEN.infobox.LABEL.BACKCOLOR=RGB(255,128,128)
			ELSE 
				DO CASE 
					CASE m.gcfarba_pozadia="SIVE"
						_SCREEN.infobox.LABEL.BACKSTYLE = 0
					CASE m.gcfarba_pozadia="MODRE"
						_SCREEN.infobox.LABEL.BACKSTYLE = 0
					CASE m.gcfarba_pozadia="ZELENE"
						_SCREEN.infobox.LABEL.BACKSTYLE = 0
					OTHERWISE 
						_SCREEN.infobox.LABEL.BACKCOLOR=RGB(165,165,165)
				ENDCASE 
			ENDIF 
		ELSE
			_SCREEN.infobox.LABEL.BACKSTYLE = 0
		ENDIF	
		_SCREEN.infobox.LABEL.FORECOLOR=m.label_farba
		_SCREEN.infobox.LABEL.CAPTION=IIF(AT("-",m.rcid_zkratka)>0,ALLTRIM(SUBSTR(m.rcid_zkratka,AT("-",m.rcid_zkratka)+1)),ALLTRIM(m.rcid_zkratka))+"  "
		_SCREEN.infobox.LABEL.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.LABEL.CAPTION,_SCREEN.infobox.LABEL.FONTNAME,_SCREEN.infobox.LABEL.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.LABEL.FONTNAME,_SCREEN.infobox.LABEL.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.LABEL.FONTSIZE>10
				_SCREEN.infobox.LABEL.FONTSIZE=_SCREEN.infobox.LABEL.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.LABEL.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.LABEL.FONTNAME,_SCREEN.infobox.LABEL.FONTSIZE,"BS")
		_SCREEN.infobox.LABEL.WIDTH=_SCREEN.infobox.WIDTH-20
		_SCREEN.infobox.label.LEFT=10
		_SCREEN.infobox.LABEL.TOP=20
		_screen.infobox.label.alignment=1
		_SCREEN.infobox.LABEL.VISIBLE=.T.

		IF !m.iba_kongres
			*** Uctovne obdobie
			_SCREEN.infobox.ADDOBJECT('label3','f_label')
			_SCREEN.infobox.label3.FONTSIZE = 15
			_SCREEN.infobox.label3.FONTBOLD = .T.
			_SCREEN.infobox.label3.FONTSHADOW = .T.
			_SCREEN.infobox.label3.BACKSTYLE = 0
			_SCREEN.infobox.label3.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
			IF "buf"$m.fn_doklady .or. !EMPTY(m.sqlsuffix)
				_SCREEN.infobox.label3.CAPTION="ZÁSOBA  "
			ELSE
				_SCREEN.infobox.label3.CAPTION=m.uctobdtxt+"  "
			ENDIF 
			_SCREEN.infobox.label3.FONTNAME=m.label_font
			DO WHILE TXTWIDTH(_SCREEN.infobox.label3.CAPTION,_SCREEN.infobox.label3.FONTNAME,_SCREEN.infobox.label3.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label3.FONTNAME,_SCREEN.infobox.label3.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
				IF _SCREEN.infobox.label3.FONTSIZE>5
					_SCREEN.infobox.label3.FONTSIZE=_SCREEN.infobox.label3.FONTSIZE-1
				ELSE
					EXIT
				ENDIF
			ENDDO
			_SCREEN.infobox.label3.WIDTH=_SCREEN.infobox.WIDTH-20
			_SCREEN.infobox.label3.LEFT=10
*			_SCREEN.label3.TOP=_SCREEN.LABEL.TOP
			_SCREEN.infobox.label3.TOP=_SCREEN.infobox.LABEL.TOP+_SCREEN.infobox.LABEL.height+10
			_SCREEN.infobox.label3.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label3.FONTNAME,_SCREEN.infobox.label3.FONTSIZE,"BS")
			_SCREEN.infobox.label3.ALIGNMENT = 1
			_SCREEN.infobox.label3.VISIBLE=.T.
		ENDIF
		*** Hotline ID
		_SCREEN.infobox.ADDOBJECT('label4','f_label')
		_SCREEN.infobox.label4.FONTSIZE = 15
		_SCREEN.infobox.label4.FONTBOLD = .T.
		_SCREEN.infobox.label4.FONTSHADOW = .T.
		_SCREEN.infobox.label4.BACKSTYLE = 0
		_SCREEN.infobox.label4.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		TRY
			IF !EMPTY(m.hotline_id)
				_SCREEN.infobox.label4.CAPTION="HOT Line ID:"+ALLTRIM(m.hotline_id)+"  "
			ELSE 
				_SCREEN.infobox.label4.CAPTION=""
			ENDIF 
		CATCH
			_SCREEN.infobox.label4.CAPTION=""
		ENDTRY
		_SCREEN.infobox.label4.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label4.CAPTION,_SCREEN.infobox.label4.FONTNAME,_SCREEN.infobox.label4.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label4.FONTNAME,_SCREEN.infobox.label4.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label4.FONTSIZE>5
				_SCREEN.infobox.label4.FONTSIZE=_SCREEN.infobox.label4.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label4.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label4.LEFT=10
		_SCREEN.infobox.label4.TOP=_SCREEN.infobox.LABEL3.TOP+_SCREEN.infobox.LABEL3.height+10
		_SCREEN.infobox.label4.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label4.FONTNAME,_SCREEN.infobox.label4.FONTSIZE,"BS")
		_SCREEN.infobox.label4.ALIGNMENT = 1
		_SCREEN.infobox.label4.VISIBLE=.T.

		*** Príjemky
		_SCREEN.infobox.ADDOBJECT('label5','f_labelinfobox')
		_SCREEN.infobox.label5.akcia = "PV"
		_SCREEN.infobox.label5.FONTSIZE = 10
		_SCREEN.infobox.label5.FONTBOLD = .T.
		_SCREEN.infobox.label5.FONTSHADOW = .T.
		_SCREEN.infobox.label5.BACKSTYLE = 0
		_SCREEN.infobox.label5.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label5.CAPTION=""
		_SCREEN.infobox.label5.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label5.CAPTION,_SCREEN.infobox.label5.FONTNAME,_SCREEN.infobox.label5.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label5.FONTNAME,_SCREEN.infobox.label5.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label5.FONTSIZE>5
				_SCREEN.infobox.label5.FONTSIZE=_SCREEN.infobox.label5.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label5.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label5.LEFT=10
		_SCREEN.infobox.label5.TOP=_SCREEN.infobox.LABEL4.TOP+_SCREEN.infobox.LABEL4.height+60
		_SCREEN.infobox.label5.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label5.FONTNAME,_SCREEN.infobox.label5.FONTSIZE,"BS")
		_SCREEN.infobox.label5.ALIGNMENT = 1
		_SCREEN.infobox.label5.VISIBLE=.T.
		*** Žiadanky
		_SCREEN.infobox.ADDOBJECT('label6','f_labelinfobox')
		_SCREEN.infobox.label6.akcia = "ZV"
		_SCREEN.infobox.label6.FONTSIZE = 10
		_SCREEN.infobox.label6.FONTBOLD = .T.
		_SCREEN.infobox.label6.FONTSHADOW = .T.
		_SCREEN.infobox.label6.BACKSTYLE = 0
		_SCREEN.infobox.label6.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label6.CAPTION=""
		_SCREEN.infobox.label6.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label6.CAPTION,_SCREEN.infobox.label6.FONTNAME,_SCREEN.infobox.label6.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label6.FONTNAME,_SCREEN.infobox.label6.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label6.FONTSIZE>5
				_SCREEN.infobox.label6.FONTSIZE=_SCREEN.infobox.label6.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label6.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label6.LEFT=10
		_SCREEN.infobox.label6.TOP=_SCREEN.infobox.LABEL5.TOP+_SCREEN.infobox.LABEL5.height+5
		_SCREEN.infobox.label6.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label6.FONTNAME,_SCREEN.infobox.label6.FONTSIZE,"BS")
		_SCREEN.infobox.label6.ALIGNMENT = 1
		_SCREEN.infobox.label6.VISIBLE=.T.
		*** Odpočty
		_SCREEN.infobox.ADDOBJECT('label7','f_labelinfobox')
		_SCREEN.infobox.label7.akcia = "VK"
		_SCREEN.infobox.label7.FONTSIZE = 10
		_SCREEN.infobox.label7.FONTBOLD = .T.
		_SCREEN.infobox.label7.FONTSHADOW = .T.
		_SCREEN.infobox.label7.BACKSTYLE = 0
		_SCREEN.infobox.label7.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label7.CAPTION=""
		_SCREEN.infobox.label7.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label7.CAPTION,_SCREEN.infobox.label7.FONTNAME,_SCREEN.infobox.label7.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label7.FONTNAME,_SCREEN.infobox.label7.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label7.FONTSIZE>5
				_SCREEN.infobox.label7.FONTSIZE=_SCREEN.infobox.label7.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label7.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label7.LEFT=10
		_SCREEN.infobox.label7.TOP=_SCREEN.infobox.LABEL6.TOP+_SCREEN.infobox.LABEL6.height+5
		_SCREEN.infobox.label7.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label7.FONTNAME,_SCREEN.infobox.label7.FONTSIZE,"BS")
		_SCREEN.infobox.label7.ALIGNMENT = 1
		_SCREEN.infobox.label7.VISIBLE=.T.
		*** Inventúra
		_SCREEN.infobox.ADDOBJECT('label8','f_label')
		_SCREEN.infobox.label8.FONTSIZE = 10
		_SCREEN.infobox.label8.FONTBOLD = .T.
		_SCREEN.infobox.label8.FONTSHADOW = .T.
		_SCREEN.infobox.label8.BACKSTYLE = 0
		_SCREEN.infobox.label8.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label8.CAPTION=""
		_SCREEN.infobox.label8.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label8.CAPTION,_SCREEN.infobox.label8.FONTNAME,_SCREEN.infobox.label8.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label8.FONTNAME,_SCREEN.infobox.label8.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label8.FONTSIZE>5
				_SCREEN.infobox.label8.FONTSIZE=_SCREEN.infobox.label8.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label8.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label8.LEFT=10
		_SCREEN.infobox.label8.TOP=_SCREEN.infobox.LABEL7.TOP+_SCREEN.infobox.LABEL7.height+5
		_SCREEN.infobox.label8.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label8.FONTNAME,_SCREEN.infobox.label8.FONTSIZE,"BS")
		_SCREEN.infobox.label8.ALIGNMENT = 1
		_SCREEN.infobox.label8.VISIBLE=.T.
		*** Info zásoby
		_SCREEN.infobox.ADDOBJECT('label9','f_label')
		_SCREEN.infobox.label9.FONTSIZE = 10
		_SCREEN.infobox.label9.FONTBOLD = .T.
		_SCREEN.infobox.label9.FONTSHADOW = .T.
		_SCREEN.infobox.label9.BACKSTYLE = 0
		_SCREEN.infobox.label9.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label9.CAPTION=""
		_SCREEN.infobox.label9.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label9.CAPTION,_SCREEN.infobox.label9.FONTNAME,_SCREEN.infobox.label9.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label9.FONTNAME,_SCREEN.infobox.label9.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label9.FONTSIZE>5
				_SCREEN.infobox.label9.FONTSIZE=_SCREEN.infobox.label9.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label9.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label9.LEFT=10
		_SCREEN.infobox.label9.TOP=_SCREEN.infobox.LABEL8.TOP+_SCREEN.infobox.LABEL8.height+5
		_SCREEN.infobox.label9.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label9.FONTNAME,_SCREEN.infobox.label9.FONTSIZE,"BS")
		_SCREEN.infobox.label9.ALIGNMENT = 1
		_SCREEN.infobox.label9.VISIBLE=.T.

		*** Ceny pod pozadovanym rozpatim
		_SCREEN.infobox.ADDOBJECT('label10','f_labelinfobox')
		_SCREEN.infobox.label10.akcia = "RP"
		_SCREEN.infobox.label10.FONTSIZE = 10
		_SCREEN.infobox.label10.FONTBOLD = .T.
		_SCREEN.infobox.label10.FONTSHADOW = .T.
		_SCREEN.infobox.label10.BACKSTYLE = 0
		_SCREEN.infobox.label10.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label10.CAPTION=""
		_SCREEN.infobox.label10.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label10.CAPTION,_SCREEN.infobox.label10.FONTNAME,_SCREEN.infobox.label10.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label10.FONTNAME,_SCREEN.infobox.label10.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label10.FONTSIZE>5
				_SCREEN.infobox.label10.FONTSIZE=_SCREEN.infobox.label10.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label10.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label10.LEFT=10
		_SCREEN.infobox.label10.TOP=_SCREEN.infobox.LABEL9.TOP+_SCREEN.infobox.LABEL9.height+60
		_SCREEN.infobox.label10.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label10.FONTNAME,_SCREEN.infobox.label10.FONTSIZE,"BS")
		_SCREEN.infobox.label10.ALIGNMENT = 1
		_SCREEN.infobox.label10.VISIBLE=.T.
		*** Stavy objednavok
		_SCREEN.infobox.ADDOBJECT('label11','f_labelinfobox')
		_SCREEN.infobox.label11.akcia = "SO"
		_SCREEN.infobox.label11.FONTSIZE = 10
		_SCREEN.infobox.label11.FONTBOLD = .T.
		_SCREEN.infobox.label11.FONTSHADOW = .T.
		_SCREEN.infobox.label11.BACKSTYLE = 0
		_SCREEN.infobox.label11.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label11.CAPTION=""
		_screen.infobox.label11.wordwrap=.t.
		_SCREEN.infobox.label11.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label11.CAPTION,_SCREEN.infobox.label11.FONTNAME,_SCREEN.infobox.label11.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label11.FONTNAME,_SCREEN.infobox.label11.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label11.FONTSIZE>5
				_SCREEN.infobox.label11.FONTSIZE=_SCREEN.infobox.label11.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label11.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label11.LEFT=10
		_SCREEN.infobox.label11.TOP=_SCREEN.infobox.LABEL10.TOP+_SCREEN.infobox.LABEL10.height+10
		_SCREEN.infobox.label11.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label11.FONTNAME,_SCREEN.infobox.label11.FONTSIZE,"BS")
		_SCREEN.infobox.label11.HEIGHT=_SCREEN.infobox.label11.HEIGHT*(OCCURS(CHR(13)+CHR(10), _SCREEN.infobox.label11.caption)+1)
		_SCREEN.infobox.label11.ALIGNMENT = 1
		_SCREEN.infobox.label11.VISIBLE=.T.
		*** Informácie
		_SCREEN.infobox.ADDOBJECT('label12','f_labelinfobox')
		_SCREEN.infobox.label12.akcia = "IF"
		_SCREEN.infobox.label12.FONTSIZE = 15
		_SCREEN.infobox.label12.FONTBOLD = .T.
		_SCREEN.infobox.label12.FONTSHADOW = .T.
		_SCREEN.infobox.label12.BACKSTYLE = 0
		_SCREEN.infobox.label12.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label12.CAPTION=""
		_SCREEN.infobox.label12.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label12.CAPTION,_SCREEN.infobox.label12.FONTNAME,_SCREEN.infobox.label12.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label12.FONTNAME,_SCREEN.infobox.label12.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label12.FONTSIZE>5
				_SCREEN.infobox.label12.FONTSIZE=_SCREEN.infobox.label12.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label12.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label12.LEFT=10
		_SCREEN.infobox.label12.TOP=_SCREEN.infobox.LABEL11.TOP+_SCREEN.infobox.LABEL11.height+10
		_SCREEN.infobox.label12.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label12.FONTNAME,_SCREEN.infobox.label12.FONTSIZE,"BS")
		_SCREEN.infobox.label12.ALIGNMENT = 1
		_SCREEN.infobox.label12.VISIBLE=.T.
		*** Zásoby pod/nad limitom
		_SCREEN.infobox.ADDOBJECT('label13','f_labelinfobox')
		_SCREEN.infobox.label13.akcia = "PN"
		_SCREEN.infobox.label13.FONTSIZE = 10
		_SCREEN.infobox.label13.FONTBOLD = .T.
		_SCREEN.infobox.label13.FONTSHADOW = .T.
		_SCREEN.infobox.label13.BACKSTYLE = 0
		_SCREEN.infobox.label13.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label13.CAPTION=""
		_SCREEN.infobox.label13.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label13.CAPTION,_SCREEN.infobox.label13.FONTNAME,_SCREEN.infobox.label13.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label13.FONTNAME,_SCREEN.infobox.label13.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label13.FONTSIZE>5
				_SCREEN.infobox.label13.FONTSIZE=_SCREEN.infobox.label13.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label13.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label13.LEFT=10
		_SCREEN.infobox.label13.TOP=_SCREEN.infobox.LABEL12.TOP+_SCREEN.infobox.LABEL12.height+10
		_SCREEN.infobox.label13.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label13.FONTNAME,_SCREEN.infobox.label13.FONTSIZE,"BS")
		_SCREEN.infobox.label13.ALIGNMENT = 1
		_SCREEN.infobox.label13.VISIBLE=.T.
		*** Info o foodie apk
		_SCREEN.infobox.ADDOBJECT('label14','f_labelinfobox')
		_SCREEN.infobox.label14.akcia = "FI"
		_SCREEN.infobox.label14.FONTSIZE = 10
		_SCREEN.infobox.label14.FONTBOLD = .T.
		_SCREEN.infobox.label14.FONTSHADOW = .T.
		_SCREEN.infobox.label14.BACKSTYLE = 0
		_SCREEN.infobox.label14.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label14.CAPTION=""
		_SCREEN.infobox.label14.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label14.CAPTION,_SCREEN.infobox.label14.FONTNAME,_SCREEN.infobox.label14.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label14.FONTNAME,_SCREEN.infobox.label14.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label14.FONTSIZE>5
				_SCREEN.infobox.label14.FONTSIZE=_SCREEN.infobox.label14.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label14.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label14.LEFT=10
		_SCREEN.infobox.label14.TOP=_SCREEN.infobox.LABEL12.TOP+_SCREEN.infobox.LABEL12.height+10
		_SCREEN.infobox.label14.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label14.FONTNAME,_SCREEN.infobox.label14.FONTSIZE,"BS")
		_SCREEN.infobox.label14.ALIGNMENT = 1
		_SCREEN.infobox.label14.VISIBLE=.T.

		IF m.slovenskaverzia
			LOCAL suborslogom
			IF "buf"$m.fn_doklady .or. !EMPTY(m.sqlsuffix)
				m.suborslogom=(m.gcini_path+"bitmaps\foodlogo730_cervene.jpg")
			ELSE 
				DO CASE 
					CASE m.gcfarba_pozadia="SIVE"
						m.suborslogom=(m.gcini_path+"bitmaps\foodlogo730_sive.jpg")
					CASE m.gcfarba_pozadia="MODRE"
						m.suborslogom=(m.gcini_path+"bitmaps\foodlogo730_modre.jpg")
					CASE m.gcfarba_pozadia="ZELENE"
						m.suborslogom=(m.gcini_path+"bitmaps\foodlogo730_zelene.jpg")
					OTHERWISE 
						m.suborslogom=(m.gcini_path+"bitmaps\foodlogo730.jpg")
				ENDCASE 
			ENDIF 
			IF FILE(m.suborslogom)
				_SCREEN.infobox.ADDOBJECT('logo','_image')
				_SCREEN.infobox.LOGO.PICTURE=m.suborslogom
				_SCREEN.infobox.LOGO.WIDTH=_screen.infobox.width-20
				_SCREEN.infobox.LOGO.HEIGHT=_SCREEN.infobox.LOGO.WIDTH/500*139
				_SCREEN.infobox.LOGO.STRETCH= 1
				_SCREEN.infobox.LOGO.TOP=_screen.infobox.Height-_screen.infobox.logo.height-20
				_SCREEN.infobox.LOGO.left=10
				_SCREEN.infobox.LOGO.VISIBLE=.T.
			ENDIF 
		ENDIF	
		_SCREEN.infobox.VISIBLE=.T.
	CASE (! EMPTY(food_dat.pozadi) .AND. FILE(food_dat.pozadi)) .OR. INLIST(LOWER(ALLTRIM(food_dat.pozadi)),"white","yellow","orange","red","pink","green","blue","violet","braun","gray")
		IF (! EMPTY(food_dat.pozadi) .AND. FILE(food_dat.pozadi))
			_SCREEN.ADDOBJECT('logo','_image')
			_SCREEN.LOGO.PICTURE=ALLTRIM(food_dat.pozadi)
			_SCREEN.LOGO.HEIGHT=_SCREEN.HEIGHT
			_SCREEN.LOGO.WIDTH=_SCREEN.WIDTH
			_SCREEN.LOGO.STRETCH= 2
			_SCREEN.LOGO.TOP=0
			_SCREEN.LOGO.LEFT=0
			_SCREEN.LOGO.VISIBLE=.T.
		ENDIF

		_screen.AddObject("infobox","f_container")
		_screen.infobox.width=_screen.width/3
		_screen.infobox.backstyle=0
*		_screen.infobox.backcolor=RGB(185,185,185)
		_screen.infobox.borderwidth=0
		_screen.infobox.height=_screen.height
		_screen.infobox.top=0
		_screen.infobox.left=_screen.width-_screen.infobox.width
		_SCREEN.infobox.ADDOBJECT('label','f_label')
		_SCREEN.infobox.LABEL.FONTSIZE = 36
		_SCREEN.infobox.LABEL.FONTBOLD = .F.
		_SCREEN.infobox.LABEL.BACKSTYLE = 0
		_SCREEN.infobox.LABEL.FORECOLOR=m.label_farba
		_SCREEN.infobox.LABEL.CAPTION=IIF(AT("-",m.rcid_zkratka)>0,ALLTRIM(SUBSTR(m.rcid_zkratka,AT("-",m.rcid_zkratka)+1)),ALLTRIM(m.rcid_zkratka))+"  "
		_SCREEN.infobox.LABEL.FONTNAME=m.label_font



		IF INLIST(LOWER(ALLTRIM(food_dat.pozadi)),"white","yellow","orange","red","pink","green","blue","violet","braun","gray")
			_SCREEN.infobox.LABEL.CAPTION=IIF(AT("-",m.rcid_zkratka)>0,ALLTRIM(SUBSTR(m.rcid_zkratka,AT("-",m.rcid_zkratka)+1)),m.rcid_zkratka)+"  "
		ELSE
			_SCREEN.infobox.LABEL.CAPTION=""
		ENDIF
		DO CASE
			CASE LOWER(ALLTRIM(food_dat.pozadi))="white"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(200,200,200)
					_SCREEN.BACKCOLOR=RGB(255,255,255)
				ELSE
					m.label_farba=RGB(255,255,255)
					_SCREEN.BACKCOLOR=RGB(200,200,200)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="yellow"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(240,225,180)
					_SCREEN.BACKCOLOR=RGB(240,225,100)
				ELSE
					m.label_farba=RGB(240,225,100)
					_SCREEN.BACKCOLOR=RGB(240,225,180)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="orange"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(240,185,110)
					_SCREEN.BACKCOLOR=RGB(230,100,30)
				ELSE
					m.label_farba=RGB(230,100,30)
					_SCREEN.BACKCOLOR=RGB(240,185,110)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="pink"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(255,200,230)
					_SCREEN.BACKCOLOR=RGB(255,180,180)
				ELSE
					m.label_farba=RGB(255,180,180)
					_SCREEN.BACKCOLOR=RGB(255,200,230)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="red"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(255,180,180)
					_SCREEN.BACKCOLOR=RGB(255,50,50)
				ELSE
					m.label_farba=RGB(255,50,50)
					_SCREEN.BACKCOLOR=RGB(255,180,180)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="green"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(48,208,114)
					_SCREEN.BACKCOLOR=RGB(0,128,0)
				ELSE
					m.label_farba=RGB(0,128,0)
					_SCREEN.BACKCOLOR=RGB(48,208,114)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="blue"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(149,191,242)
					_SCREEN.BACKCOLOR=RGB(89,89,250)
				ELSE
					m.label_farba=RGB(89,89,250)
					_SCREEN.BACKCOLOR=RGB(149,191,242)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="violet"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(180,150,180)
					_SCREEN.BACKCOLOR=RGB(180,100,180)
				ELSE
					m.label_farba=RGB(180,100,180)
					_SCREEN.BACKCOLOR=RGB(180,150,180)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="braun"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(250,230,170)
					_SCREEN.BACKCOLOR=RGB(230,200,150)
				ELSE
					m.label_farba=RGB(230,200,150)
					_SCREEN.BACKCOLOR=RGB(250,230,170)
				ENDIF
			CASE LOWER(ALLTRIM(food_dat.pozadi))="gray"
				IF LOWER(ALLTRIM(food_dat.pozadi))=ALLTRIM(food_dat.pozadi)
					m.label_farba=RGB(200,200,200)
					_SCREEN.BACKCOLOR=RGB(100,100,100)
				ELSE
					m.label_farba=RGB(100,100,100)
					_SCREEN.BACKCOLOR=RGB(200,200,200)
				ENDIF
			OTHERWISE
				_SCREEN.BACKCOLOR=RGB(104,104,104)
		ENDCASE
		_screen.infobox.label.forecolor=m.label_farba
		DO WHILE TXTWIDTH(_SCREEN.infobox.LABEL.CAPTION,_SCREEN.infobox.LABEL.FONTNAME,_SCREEN.infobox.LABEL.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.LABEL.FONTNAME,_SCREEN.infobox.LABEL.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.LABEL.FONTSIZE>10
				_SCREEN.infobox.LABEL.FONTSIZE=_SCREEN.infobox.LABEL.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.LABEL.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.LABEL.FONTNAME,_SCREEN.infobox.LABEL.FONTSIZE,"BS")
		_SCREEN.infobox.LABEL.WIDTH=_SCREEN.infobox.WIDTH-20
		_SCREEN.infobox.label.LEFT=10
		_SCREEN.infobox.LABEL.TOP=20
		_screen.infobox.label.alignment=1
		_SCREEN.infobox.LABEL.VISIBLE=.T.

		IF !m.iba_kongres
			*** Uctovne obdobie
			_SCREEN.infobox.ADDOBJECT('label3','f_label')
			_SCREEN.infobox.label3.FONTSIZE = 15
			_SCREEN.infobox.label3.FONTBOLD = .T.
			_SCREEN.infobox.label3.FONTSHADOW = .T.
			_SCREEN.infobox.label3.BACKSTYLE = 0
			_SCREEN.infobox.label3.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
			IF "buf"$m.fn_doklady .or. !EMPTY(m.sqlsuffix)
				_SCREEN.infobox.label3.CAPTION="ZÁSOBA  "
			ELSE
				_SCREEN.infobox.label3.CAPTION=m.uctobdtxt+"  "
			ENDIF 
			_SCREEN.infobox.label3.FONTNAME=m.label_font
			DO WHILE TXTWIDTH(_SCREEN.infobox.label3.CAPTION,_SCREEN.infobox.label3.FONTNAME,_SCREEN.infobox.label3.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label3.FONTNAME,_SCREEN.infobox.label3.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
				IF _SCREEN.infobox.label3.FONTSIZE>5
					_SCREEN.infobox.label3.FONTSIZE=_SCREEN.infobox.label3.FONTSIZE-1
				ELSE
					EXIT
				ENDIF
			ENDDO
			_SCREEN.infobox.label3.WIDTH=_SCREEN.infobox.WIDTH-20
			_SCREEN.infobox.label3.LEFT=10
*			_SCREEN.label3.TOP=_SCREEN.LABEL.TOP
			_SCREEN.infobox.label3.TOP=_SCREEN.infobox.LABEL.TOP+_SCREEN.infobox.LABEL.height+10
			_SCREEN.infobox.label3.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label3.FONTNAME,_SCREEN.infobox.label3.FONTSIZE,"BS")
			_SCREEN.infobox.label3.ALIGNMENT = 1
			_SCREEN.infobox.label3.VISIBLE=.T.
		ENDIF
		*** Hotline ID
		_SCREEN.infobox.ADDOBJECT('label4','f_label')
		_SCREEN.infobox.label4.FONTSIZE = 15
		_SCREEN.infobox.label4.FONTBOLD = .T.
		_SCREEN.infobox.label4.FONTSHADOW = .T.
		_SCREEN.infobox.label4.BACKSTYLE = 0
		_SCREEN.infobox.label4.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		TRY
			IF !EMPTY(m.hotline_id)
				_SCREEN.infobox.label4.CAPTION="HOT Line ID:"+ALLTRIM(m.hotline_id)+"  "
			ELSE 
				_SCREEN.infobox.label4.CAPTION=""
			ENDIF 
		CATCH
			_SCREEN.infobox.label4.CAPTION=""
		ENDTRY
		_SCREEN.infobox.label4.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label4.CAPTION,_SCREEN.infobox.label4.FONTNAME,_SCREEN.infobox.label4.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label4.FONTNAME,_SCREEN.infobox.label4.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label4.FONTSIZE>5
				_SCREEN.infobox.label4.FONTSIZE=_SCREEN.infobox.label4.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label4.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label4.LEFT=10
		_SCREEN.infobox.label4.TOP=_SCREEN.infobox.LABEL3.TOP+_SCREEN.infobox.LABEL3.height+10
		_SCREEN.infobox.label4.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label4.FONTNAME,_SCREEN.infobox.label4.FONTSIZE,"BS")
		_SCREEN.infobox.label4.ALIGNMENT = 1
		_SCREEN.infobox.label4.VISIBLE=.T.

		*** Príjemky
		_SCREEN.infobox.ADDOBJECT('label5','f_labelinfobox')
		_SCREEN.infobox.label5.akcia = "PV"
		_SCREEN.infobox.label5.FONTSIZE = 10
		_SCREEN.infobox.label5.FONTBOLD = .T.
		_SCREEN.infobox.label5.FONTSHADOW = .T.
		_SCREEN.infobox.label5.BACKSTYLE = 0
		_SCREEN.infobox.label5.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label5.CAPTION=""
		_SCREEN.infobox.label5.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label5.CAPTION,_SCREEN.infobox.label5.FONTNAME,_SCREEN.infobox.label5.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label5.FONTNAME,_SCREEN.infobox.label5.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label5.FONTSIZE>5
				_SCREEN.infobox.label5.FONTSIZE=_SCREEN.infobox.label5.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label5.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label5.LEFT=10
		_SCREEN.infobox.label5.TOP=_SCREEN.infobox.LABEL4.TOP+_SCREEN.infobox.LABEL4.height+60
		_SCREEN.infobox.label5.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label5.FONTNAME,_SCREEN.infobox.label5.FONTSIZE,"BS")
		_SCREEN.infobox.label5.ALIGNMENT = 1
		_SCREEN.infobox.label5.VISIBLE=.T.
		*** Žiadanky
		_SCREEN.infobox.ADDOBJECT('label6','f_labelinfobox')
		_SCREEN.infobox.label6.akcia = "ZV"
		_SCREEN.infobox.label6.FONTSIZE = 10
		_SCREEN.infobox.label6.FONTBOLD = .T.
		_SCREEN.infobox.label6.FONTSHADOW = .T.
		_SCREEN.infobox.label6.BACKSTYLE = 0
		_SCREEN.infobox.label6.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label6.CAPTION=""
		_SCREEN.infobox.label6.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label6.CAPTION,_SCREEN.infobox.label6.FONTNAME,_SCREEN.infobox.label6.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label6.FONTNAME,_SCREEN.infobox.label6.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label6.FONTSIZE>5
				_SCREEN.infobox.label6.FONTSIZE=_SCREEN.infobox.label6.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label6.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label6.LEFT=10
		_SCREEN.infobox.label6.TOP=_SCREEN.infobox.LABEL5.TOP+_SCREEN.infobox.LABEL5.height+5
		_SCREEN.infobox.label6.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label6.FONTNAME,_SCREEN.infobox.label6.FONTSIZE,"BS")
		_SCREEN.infobox.label6.ALIGNMENT = 1
		_SCREEN.infobox.label6.VISIBLE=.T.
		*** Odpočty
		_SCREEN.infobox.ADDOBJECT('label7','f_labelinfobox')
		_SCREEN.infobox.label7.akcia = "VK"
		_SCREEN.infobox.label7.FONTSIZE = 10
		_SCREEN.infobox.label7.FONTBOLD = .T.
		_SCREEN.infobox.label7.FONTSHADOW = .T.
		_SCREEN.infobox.label7.BACKSTYLE = 0
		_SCREEN.infobox.label7.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label7.CAPTION=""
		_SCREEN.infobox.label7.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label7.CAPTION,_SCREEN.infobox.label7.FONTNAME,_SCREEN.infobox.label7.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label7.FONTNAME,_SCREEN.infobox.label7.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label7.FONTSIZE>5
				_SCREEN.infobox.label7.FONTSIZE=_SCREEN.infobox.label7.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label7.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label7.LEFT=10
		_SCREEN.infobox.label7.TOP=_SCREEN.infobox.LABEL6.TOP+_SCREEN.infobox.LABEL6.height+5
		_SCREEN.infobox.label7.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label7.FONTNAME,_SCREEN.infobox.label7.FONTSIZE,"BS")
		_SCREEN.infobox.label7.ALIGNMENT = 1
		_SCREEN.infobox.label7.VISIBLE=.T.
		*** Inventúra
		_SCREEN.infobox.ADDOBJECT('label8','f_label')
		_SCREEN.infobox.label8.FONTSIZE = 10
		_SCREEN.infobox.label8.FONTBOLD = .T.
		_SCREEN.infobox.label8.FONTSHADOW = .T.
		_SCREEN.infobox.label8.BACKSTYLE = 0
		_SCREEN.infobox.label8.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label8.CAPTION=""
		_SCREEN.infobox.label8.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label8.CAPTION,_SCREEN.infobox.label8.FONTNAME,_SCREEN.infobox.label8.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label8.FONTNAME,_SCREEN.infobox.label8.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label8.FONTSIZE>5
				_SCREEN.infobox.label8.FONTSIZE=_SCREEN.infobox.label8.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label8.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label8.LEFT=10
		_SCREEN.infobox.label8.TOP=_SCREEN.infobox.LABEL7.TOP+_SCREEN.infobox.LABEL7.height+5
		_SCREEN.infobox.label8.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label8.FONTNAME,_SCREEN.infobox.label8.FONTSIZE,"BS")
		_SCREEN.infobox.label8.ALIGNMENT = 1
		_SCREEN.infobox.label8.VISIBLE=.T.
		*** Info zásoby
		_SCREEN.infobox.ADDOBJECT('label9','f_label')
		_SCREEN.infobox.label9.FONTSIZE = 10
		_SCREEN.infobox.label9.FONTBOLD = .T.
		_SCREEN.infobox.label9.FONTSHADOW = .T.
		_SCREEN.infobox.label9.BACKSTYLE = 0
		_SCREEN.infobox.label9.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label9.CAPTION=""
		_SCREEN.infobox.label9.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label9.CAPTION,_SCREEN.infobox.label9.FONTNAME,_SCREEN.infobox.label9.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label9.FONTNAME,_SCREEN.infobox.label9.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label9.FONTSIZE>5
				_SCREEN.infobox.label9.FONTSIZE=_SCREEN.infobox.label9.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label9.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label9.LEFT=10
		_SCREEN.infobox.label9.TOP=_SCREEN.infobox.LABEL8.TOP+_SCREEN.infobox.LABEL8.height+5
		_SCREEN.infobox.label9.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label9.FONTNAME,_SCREEN.infobox.label9.FONTSIZE,"BS")
		_SCREEN.infobox.label9.ALIGNMENT = 1
		_SCREEN.infobox.label9.VISIBLE=.T.

		*** Ceny pod pozadovanym rozpatim
		_SCREEN.infobox.ADDOBJECT('label10','f_labelinfobox')
		_SCREEN.infobox.label10.akcia = "RP"
		_SCREEN.infobox.label10.FONTSIZE = 10
		_SCREEN.infobox.label10.FONTBOLD = .T.
		_SCREEN.infobox.label10.FONTSHADOW = .T.
		_SCREEN.infobox.label10.BACKSTYLE = 0
		_SCREEN.infobox.label10.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label10.CAPTION=""
		_SCREEN.infobox.label10.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label10.CAPTION,_SCREEN.infobox.label10.FONTNAME,_SCREEN.infobox.label10.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label10.FONTNAME,_SCREEN.infobox.label10.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label10.FONTSIZE>5
				_SCREEN.infobox.label10.FONTSIZE=_SCREEN.infobox.label10.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label10.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label10.LEFT=10
		_SCREEN.infobox.label10.TOP=_SCREEN.infobox.LABEL9.TOP+_SCREEN.infobox.LABEL9.height+60
		_SCREEN.infobox.label10.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label10.FONTNAME,_SCREEN.infobox.label10.FONTSIZE,"BS")
		_SCREEN.infobox.label10.ALIGNMENT = 1
		_SCREEN.infobox.label10.VISIBLE=.T.
		*** Stav objednávok
		_SCREEN.infobox.ADDOBJECT('label11','f_labelinfobox')
		_SCREEN.infobox.label11.akcia = "SO"
		_SCREEN.infobox.label11.FONTSIZE = 10
		_SCREEN.infobox.label11.FONTBOLD = .T.
		_SCREEN.infobox.label11.FONTSHADOW = .T.
		_SCREEN.infobox.label11.BACKSTYLE = 0
		_SCREEN.infobox.label11.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label11.CAPTION=""
		_SCREEN.infobox.label11.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label11.CAPTION,_SCREEN.infobox.label11.FONTNAME,_SCREEN.infobox.label11.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label11.FONTNAME,_SCREEN.infobox.label11.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label11.FONTSIZE>5
				_SCREEN.infobox.label11.FONTSIZE=_SCREEN.infobox.label11.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label11.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label11.LEFT=10
		_SCREEN.infobox.label11.TOP=_SCREEN.infobox.LABEL10.TOP+_SCREEN.infobox.LABEL10.height+10
		_SCREEN.infobox.label11.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label11.FONTNAME,_SCREEN.infobox.label11.FONTSIZE,"BS")
		_SCREEN.infobox.label11.ALIGNMENT = 1
		_SCREEN.infobox.label11.VISIBLE=.T.
		*** Informácie
		_SCREEN.infobox.ADDOBJECT('label12','f_labelinfobox')
		_SCREEN.infobox.label11.akcia = "IF"
		_SCREEN.infobox.label12.FONTSIZE = 15
		_SCREEN.infobox.label12.FONTBOLD = .T.
		_SCREEN.infobox.label12.FONTSHADOW = .T.
		_SCREEN.infobox.label12.BACKSTYLE = 0
		_SCREEN.infobox.label12.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label12.CAPTION=""
		_SCREEN.infobox.label12.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label12.CAPTION,_SCREEN.infobox.label12.FONTNAME,_SCREEN.infobox.label12.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label12.FONTNAME,_SCREEN.infobox.label12.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label12.FONTSIZE>5
				_SCREEN.infobox.label12.FONTSIZE=_SCREEN.infobox.label12.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label12.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label12.LEFT=10
		_SCREEN.infobox.label12.TOP=_SCREEN.infobox.LABEL11.TOP+_SCREEN.infobox.LABEL11.height+10
		_SCREEN.infobox.label12.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label12.FONTNAME,_SCREEN.infobox.label12.FONTSIZE,"BS")
		_SCREEN.infobox.label12.ALIGNMENT = 1
		_SCREEN.infobox.label12.VISIBLE=.T.

		*** Zásoby pod/nad limitom
		_SCREEN.infobox.ADDOBJECT('label13','f_labelinfobox')
		_SCREEN.infobox.label13.akcia = "PN"
		_SCREEN.infobox.label13.FONTSIZE = 10
		_SCREEN.infobox.label13.FONTBOLD = .T.
		_SCREEN.infobox.label13.FONTSHADOW = .T.
		_SCREEN.infobox.label13.BACKSTYLE = 0
		_SCREEN.infobox.label13.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.label13.CAPTION=""
		_SCREEN.infobox.label13.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.label13.CAPTION,_SCREEN.infobox.label13.FONTNAME,_SCREEN.infobox.label13.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.label13.FONTNAME,_SCREEN.infobox.label13.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.label13.FONTSIZE>5
				_SCREEN.infobox.label13.FONTSIZE=_SCREEN.infobox.label13.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.label13.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.label13.LEFT=10
		_SCREEN.infobox.label13.TOP=_SCREEN.infobox.LABEL12.TOP+_SCREEN.infobox.LABEL12.height+10
		_SCREEN.infobox.label13.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.label13.FONTNAME,_SCREEN.infobox.label13.FONTSIZE,"BS")
		_SCREEN.infobox.label13.ALIGNMENT = 1
		_SCREEN.infobox.label13.VISIBLE=.T.

		_SCREEN.infobox.ADDOBJECT('labelfoodman','f_label')
		IF !EMPTY(_screen.infobox.label.Caption)
			_SCREEN.infobox.labelfoodman.FONTSIZE = 100
		ELSE
			_SCREEN.infobox.labelfoodman.FONTSIZE = 36
		ENDIF 
		_SCREEN.infobox.labelfoodman.FONTBOLD = .T.
		_SCREEN.infobox.labelfoodman.FONTSHADOW = .T.
		_SCREEN.infobox.labelfoodman.BACKSTYLE = 0
		_SCREEN.infobox.labelfoodman.FORECOLOR=_SCREEN.infobox.LABEL.FORECOLOR
		_SCREEN.infobox.labelfoodman.CAPTION=IIF(m.iba_kongres,"KongresMan","FoodMan")+"  "
		_SCREEN.infobox.labelfoodman.FONTNAME=m.label_font
		DO WHILE TXTWIDTH(_SCREEN.infobox.labelfoodman.CAPTION,_SCREEN.infobox.labelfoodman.FONTNAME,_SCREEN.infobox.labelfoodman.FONTSIZE,"BS")* FONTMETRIC(6,_SCREEN.infobox.labelfoodman.FONTNAME,_SCREEN.infobox.labelfoodman.FONTSIZE,"BS")  > (_SCREEN.infobox.WIDTH-20)
			IF _SCREEN.infobox.labelfoodman.FONTSIZE>5
				_SCREEN.infobox.labelfoodman.FONTSIZE=_SCREEN.infobox.labelfoodman.FONTSIZE-1
			ELSE
				EXIT
			ENDIF
		ENDDO
		_SCREEN.infobox.labelfoodman.WIDTH=_screen.infobox.width-20
		_SCREEN.infobox.labelfoodman.LEFT=10
		_SCREEN.infobox.labelfoodman.HEIGHT=FONTMETRIC(1,_SCREEN.infobox.labelfoodman.FONTNAME,_SCREEN.infobox.labelfoodman.FONTSIZE,"BS")
		_SCREEN.infobox.labelfoodman.TOP=_screen.infobox.Height-_screen.infobox.labelfoodman.height-20
		_SCREEN.infobox.labelfoodman.ALIGNMENT = 1
		_SCREEN.infobox.labelfoodman.VISIBLE=.T.

		_SCREEN.infobox.VISIBLE=.T.
	OTHERWISE
		_SCREEN.PICTURE = m.gcini_path + "bitmaps\pozadi.gif"

ENDCASE
IF !m.bolfooddat
	DO pozavirej WITH "food_dat"
ENDIF 
IF TYPE('_screen.label') = 'O'
	_screen.label.refresh()
ENDIF 
IF TYPE('_screen.label1') = 'O'
	_screen.label1.refresh()
ENDIF 
IF TYPE('_screen.label2') = 'O'
	_screen.label2.refresh()
ENDIF 
IF TYPE('_screen.label3') = 'O'
	_screen.label3.refresh()
ENDIF 
IF TYPE('_screen.label4') = 'O'
	_screen.label4.refresh()
ENDIF 
IF TYPE("tbscreen")="O" AND TYPE("_screen.infobox")="O" AND tbscreen.timer1.enabled
	tbscreen.timer1.interval=1000
ENDIF 


*!*****************************************************************************
PROCEDURE setmeny
PRIVATE m.hladajcstredisk
m.hladajcstredisk=m.gic_stredisk
IF LOWER(m.typ_konca)="uzavierka"
	SELECT 0
	IF m.issql
		DO open_database
		USE (m.sqlprefix+'ruzavstredisko') ALIAS uzaverka IN 0
	ELSE
		USE (m.fn_uzav)               ALIAS uzaverka IN 0
	ENDIF

	SELECT MAX(rok+mesiac) AS uctobd WHERE c_stredisk=m.gic_stredisk FROM uzaverka INTO CURSOR zuzaverky
	IF RECCOUNT()>0
		IF zuzaverky.uctobd>m.uctobd
			m.uctobd=LEFT(DTOS(GOMONTH(CTOD("01."+SUBSTR(zuzaverky.uctobd,5,2)+"."+LEFT(zuzaverky.uctobd,4)),1)),6)
		ENDIF
	ENDIF
	USE IN uzaverka
	USE IN zuzaverky
	SELECT uctobd
	LOCATE FOR c_stredisk=m.gic_stredisk
	IF FOUND()
		REPLACE uctobd.uctobd WITH m.uctobd
	ELSE
		IF m.issql
			INSERT INTO uctobd (c_stredisk,uctobd, c_data) VALUES (m.gic_stredisk,m.uctobd, IIF(m.cdata=0,1,m.cdata))
		ELSE
			INSERT INTO uctobd (c_stredisk,uctobd) VALUES (m.gic_stredisk,m.uctobd)
		ENDIF
	ENDIF
	FOR m.giakt_mena=1 TO ALEN(en_meny,1)
		IF m.uctobd<=en__meny(m.giakt_mena,4)
			EXIT
		ENDIF
	ENDFOR
	IF m.giakt_mena=1
		IF m.uctobd>=LEFT(DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-5)),6) .OR. DTOS(DATE())>=DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-5))
			m.giref_mena=2
		ELSE
			m.giref_mena=m.giakt_mena
		ENDIF
	ELSE
		IF m.uctobd<=LEFT(DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena-1,4),2)+"."+LEFT(en__meny(m.giakt_mena-1,4),4)),12)),6) .OR. DTOS(DATE())<=DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena-1,4),2)+"."+LEFT(en__meny(m.giakt_mena-1,4),4)),12))
			m.giref_mena=m.giakt_mena-1
		ELSE
			IF m.uctobd>=LEFT(DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-5)),6) .OR. DTOS(DATE())>=DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-5))
				m.giref_mena=m.giakt_mena+1
			ELSE
				m.giref_mena=m.giakt_mena
			ENDIF
		ENDIF
	ENDIF
	IF m.giref_mena=m.giakt_mena
		m.girep_mena=m.giakt_mena
	ENDIF
ELSE
	SELECT 0
	IF m.issql
		USE (m.sqlprefix+"rdokladyczuctobd") IN 0 ALIAS doklady
	ELSE 
		USE (m.fn_doklady) ALIAS doklady ORDER c_dokl
	ENDIF 
	SELECT c_dokl, pz1, SPACE(6) AS uctobd FROM doklady INTO CURSOR zuzaverky WHERE c_stredisk=m.gic_stredisk .AND. operace="KK" .AND. LEFT(LOWER(pz1),5)="konec" READWRITE
	IF RECCOUNT()>0
		GO BOTTOM
		IF VAL(RIGHT(ALLTRIM(zuzaverky.pz1),2))>0
			DO CASE
				CASE jaz("konec_mesiac_1")$zuzaverky.pz1 
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"01"
				CASE jaz("konec_mesiac_2")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"02"
				CASE jaz("konec_mesiac_3")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"03"
				CASE jaz("konec_mesiac_4")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"04"
				CASE jaz("konec_mesiac_5")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"05"
				CASE jaz("konec_mesiac_6")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"06"
				CASE jaz("konec_mesiac_7")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"07"
				CASE jaz("konec_mesiac_8")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"08"
				CASE jaz("konec_mesiac_9")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"09"
				CASE jaz("konec_mesiac_10")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"10"
				CASE jaz("konec_mesiac_11")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"11"
				CASE jaz("konec_mesiac_12")$zuzaverky.pz1
					REPLACE uctobd WITH "20"+RIGHT(ALLTRIM(zuzaverky.pz1),2)+"12"
				OTHERWISE
					REPLACE uctobd WITH m.uctobd
			ENDCASE
		ELSE
			REPLACE uctobd WITH m.uctobd
		ENDIF
		IF zuzaverky.uctobd>m.uctobd
			m.uctobd=LEFT(DTOS(GOMONTH(CTOD("01."+SUBSTR(zuzaverky.uctobd,5,2)+"."+LEFT(zuzaverky.uctobd,4)),1)),6)
		ENDIF
	ENDIF
	DO pozavirej WITH "zuzaverky, doklady"
	SELECT uctobd
	LOCATE FOR c_stredisk=m.gic_stredisk
	IF FOUND()
		REPLACE uctobd.uctobd WITH m.uctobd
	ELSE
		IF m.issql
			INSERT INTO uctobd (c_stredisk,uctobd,c_data) VALUES (m.gic_stredisk,m.uctobd, m.cdata)
		ELSE 
			INSERT INTO uctobd (c_stredisk,uctobd) VALUES (m.gic_stredisk,m.uctobd)
		ENDIF 
	ENDIF
	SELECT uctobd
	IF CURSORGETPROP("Buffering","uctobd")>1
		=tux(.t.,.t.,"uctobd", "REQUERY")
	ENDIF
	FOR m.giakt_mena=1 TO ALEN(en_meny,1)
		IF m.uctobd<=en__meny(m.giakt_mena,4)
			EXIT
		ENDIF
	ENDFOR
	IF m.giakt_mena=1
		IF m.uctobd>=LEFT(DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-6)),6) .OR. DTOS(DATE())>=DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-6))
			m.giref_mena=2
		ELSE
			m.giref_mena=m.giakt_mena
		ENDIF
	ELSE
		IF m.uctobd<=LEFT(DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena-1,4),2)+"."+LEFT(en__meny(m.giakt_mena-1,4),4)),6)),6) .OR. DTOS(DATE())<=DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena-1,4),2)+"."+LEFT(en__meny(m.giakt_mena-1,4),4)),6))
			m.giref_mena=m.giakt_mena-1
		ELSE
			IF m.uctobd>=LEFT(DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-6)),6) .OR. DTOS(DATE())>=DTOS(GOMONTH(CTOD("01."+RIGHT(en__meny(m.giakt_mena,4),2)+"."+LEFT(en__meny(m.giakt_mena,4),4)),-6))
				m.giref_mena=m.giakt_mena+1
			ELSE
				m.giref_mena=m.giakt_mena
			ENDIF
		ENDIF
	ENDIF
ENDIF

FOR m.i=1 TO ALEN(en_meny,1)
	IF LEFT(DTOS(DATE()),6)<=en__meny(m.i,4)
		m.gicennik_mena=m.i
		EXIT
	ENDIF
ENDFOR





*!*****************************************************************************
PROCEDURE spust_form
PARAMETERS meno, prvok, riadok
PRIVATE pokracuj
IF EMPTY(m.riadok)
	m.riadok=m.meno
ENDIF
m.pokracuj=.t.
LOCAL m.vysledoktestu
m.vysledoktestu=n_checkall("UPDATE_STRUKTUR")
IF ! EMPTY(m.vysledoktestu)
	TRY 
		MESSAGEBOX(jaz("ted nelze, zkuste pozdeji") + CHR(13) + jaz("form_bezi_stru_upd")+ CHR(13)+ m.vysledoktestu, 16, jaz("m_ost stru_upda"), 3333)
	CATCH
		MESSAGEBOX(jaz("ted nelze, zkuste pozdeji") + CHR(13) + jaz("form_bezi_stru_upd"), 16, jaz("m_ost stru_upda"), 3333)
	ENDTRY 
	RETURN .f.
ENDIF 

FOR m.i=1 TO _screen.FormCount
	IF UPPER(_screen.Forms(m.i).name)="RYCHLFRM"
		m.pokracuj=.f.
		EXIT
	ENDIF 
	IF UPPER(_screen.Forms(m.i).name)=UPPER(m.meno)
		_screen.Forms(m.i).windowstate=0
		IF !EMPTY(m.prvok)
			_screen.Forms(m.i).&prvok..setfocus()
		ENDIF
		m.pokracuj=.f.
		EXIT
	ELSE
		m.pokracuj=.t.
	ENDIF
ENDFOR
IF m.pokracuj
	_screen.activate()
	DO FORM &riadok
ENDIF


*!*****************************************************************************
PROCEDURE menukongres
SET SYSMENU TO
SET SYSMENU AUTOMATIC
DEFINE PAD k1 OF _MSYSMENU PROMPT "" +da.atext(131)+"" COLOR SCHEME 3
DEFINE PAD k2 OF _MSYSMENU PROMPT "" +da.atext(185)+"" COLOR SCHEME 3
DEFINE PAD k3 OF _MSYSMENU PROMPT "" +da.atext(186)+"" COLOR SCHEME 3
DEFINE PAD k4 OF _MSYSMENU PROMPT "" +da.atext(167)+"" COLOR SCHEME 3
DEFINE PAD k5 OF _MSYSMENU PROMPT "" +da.atext(65) +"" COLOR SCHEME 3
DEFINE PAD k6 OF _MSYSMENU PROMPT jaz("mm_konec")	   COLOR SCHEME 3 MESS jaz("mm_konec_mssg")

ON				PAD k1 OF _MSYSMENU ACTI POPUP kong1
ON				PAD k2 OF _MSYSMENU ACTI POPUP m_k_plachty
ON				PAD k3 OF _MSYSMENU ACTI POPUP m_k_cisel
ON	SELECTION	PAD k4 OF _MSYSMENU DO FORM tf_congress
ON				PAD k5 OF _MSYSMENU ACTI POPUP m_k_sys
ON				PAD k6 OF _MSYSMENU ACTI POPUP konec


DEFINE POPUP kong1 MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF kong1 PROMPT "" +da.atext(131)+""
DEFINE BAR 2 OF kong1 PROMPT "" +da.atext(146)+""
ON SELECTION BAR 1 OF kong1 sy.do_form(41)
ON SELECTION BAR 2 OF kong1 sy.do_form(65)

DEFINE POPUP m_k_plachty MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF m_k_plachty PROMPT "" +da.atext(67)+""
DEFINE BAR 2 OF m_k_plachty PROMPT "" +da.atext(155)+""
DEFINE BAR 3 OF m_k_plachty PROMPT "" +da.atext(146)+""
*DEFINE BAR 4 OF m_k_plachty PROMPT "" +da.atext(184)+""
DEFINE BAR 5 OF m_k_plachty PROMPT "" +da.atext(139)+""
ON SELECTION BAR 1 OF m_k_plachty do form pl_sluzby
ON SELECTION BAR 2 OF m_k_plachty do form pl_priestory
ON SELECTION BAR 3 OF m_k_plachty do form pl_akcie
*ON SELECTION BAR 4 OF m_k_plachty sy.do_form_p('pl_kongres')
ON SELECTION BAR 5 OF m_k_plachty do form pl_vykon


DEFINE POPUP m_k_cisel MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF m_k_cisel PROMPT "" +da.atext(299)+""
DEFINE BAR 2 OF m_k_cisel PROMPT "" +da.atext(132)+""
DEFINE BAR 3 OF m_k_cisel PROMPT "" +da.atext(140)+""
DEFINE BAR 4 OF m_k_cisel PROMPT "" +da.atext(139)+""
DEFINE BAR 5 OF m_k_cisel PROMPT "" +da.atext(135)+""
DEFINE BAR 6 OF m_k_cisel PROMPT "\-"
DEFINE BAR 7 OF m_k_cisel PROMPT "" +da.atext(67)+""
DEFINE BAR 8 OF m_k_cisel PROMPT "" +da.atext(85)+""
DEFINE BAR 9 OF m_k_cisel PROMPT "\-"
DEFINE BAR 10 OF m_k_cisel PROMPT "" +da.atext(155)+""
DEFINE BAR 11 OF m_k_cisel PROMPT "" +da.atext(142)+""
DEFINE BAR 12 OF m_k_cisel PROMPT "\-"
DEFINE BAR 13 OF m_k_cisel PROMPT "" +da.atext(9)+""
DEFINE BAR 14 OF m_k_cisel PROMPT "\-"
DEFINE BAR 15 OF m_k_cisel PROMPT "" +da.atext(43)+""
DEFINE BAR 16 OF m_k_cisel PROMPT "" +da.atext(76)+""
DEFINE BAR 17 OF m_k_cisel PROMPT "\-"
DEFINE BAR 18 OF m_k_cisel PROMPT "" +da.atext(168)+""
DEFINE BAR 19 OF m_k_cisel PROMPT "" +da.atext(468)+""
DEFINE BAR 20 OF m_k_cisel PROMPT "" +da.atext(189)+""
DEFINE BAR 21 OF m_k_cisel PROMPT "\-"
DEFINE BAR 22 OF m_k_cisel PROMPT "" +da.atext(69)+""


ON SELECTION BAR 1 OF m_k_cisel sy.do_formo('kl')
ON SELECTION BAR 2 OF m_k_cisel sy.do_formo('ko')
ON SELECTION BAR 3 OF m_k_cisel sy.do_formo('do')
ON SELECTION BAR 4 OF m_k_cisel sy.do_formo('vy')
ON SELECTION BAR 5 OF m_k_cisel sy.do_formo('zo')
ON SELECTION BAR 7 OF m_k_cisel sy.do_form(14)
ON SELECTION BAR 8 OF m_k_cisel sy.do_form(22)
ON SELECTION BAR 10 OF m_k_cisel sy.do_form(52)
ON SELECTION BAR 11 OF m_k_cisel sy.do_form(49)
ON SELECTION BAR 13 OF m_k_cisel sy.do_form(2)
ON SELECTION BAR 15 OF m_k_cisel sy.do_form(6)
ON SELECTION BAR 16 OF m_k_cisel sy.do_form(20)
ON SELECTION BAR 18 OF m_k_cisel sy.do_form(64)
ON SELECTION BAR 19 OF m_k_cisel sy.do_form(165)
ON SELECTION BAR 20 OF m_k_cisel sy.do_form(72)
ON SELECTION BAR 22 OF m_k_cisel sy.do_form(168)

DEFINE POPUP m_k_sys MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF m_k_sys PROMPT "" +da.atext(197)+""
DEFINE BAR 2 OF m_k_sys PROMPT "" +da.atext(182)+""

ON SELECTION BAR 1 OF m_k_sys do form appar_de
ON SELECTION BAR 2 OF m_k_sys sy.do_form(70)


DEFINE POPUP konec MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 10 OF konec PROMPT jaz("m_kon_konec") MESSAGE jaz("m_kon_kon_mssg")
DEFINE BAR 20 OF konec PROMPT jaz("m_kon_konec_arch") MESSAGE jaz("m_kon_kon_mssg")
DEFINE BAR 30 OF konec PROMPT jaz("m_kon_relogin") MESSAGE ""
DEFINE BAR 35 OF konec PROMPT "\-"
DEFINE BAR  40 OF konec PROMPT "About"
IF m.slovenskaverzia
	DEFINE BAR 50 OF konec PROMPT jaz("m_kon_licencia")
ENDIF
DEFINE BAR 81 OF konec PROMPT jaz("m_kon_setup") MESSAGE ""
DEFINE BAR 98 OF konec PROMPT "\-"
DEFINE BAR 99 OF konec PROMPT "\-"

ON SELECTION BAR 10 OF konec DO exi_to_fox IN menu_def
ON SELECTION BAR 20 OF konec DO exi_to_fox with .t. IN menu_def
ON SELECTION BAR 30 OF konec DO relog in menu_def
ON SELECTION BAR 40 OF konec DO aboutbox IN menu_def
IF m.slovenskaverzia
	ON SELECTION BAR 50 OF konec DO FORM licencia
ENDIF
ON SELECTION BAR 81 OF konec DO FORM setup


*!*****************************************************************************
PROCEDURE vytvor_grafytexty
IF VARTYPE(grafytexty)="U"
	PUBLIC ARRAY grafytexty (181)
ENDIF
grafytexty(1)=jaz('grafy_objekt_7')
grafytexty(2)=jaz('grafy_objekt_8')
grafytexty(3)=jaz('grafy_objekt_10')
grafytexty(4)=jaz('grafy_objekt_11')
grafytexty(5)=jaz('grafy_objekt_12')
grafytexty(6)=jaz('grafy_objekt_13')
grafytexty(7)=jaz('grafy_objekt_14')
grafytexty(8)=jaz('grafy_objekt_16')
grafytexty(9)=jaz('grafy_objekt_18')
grafytexty(10)=jaz('grafy_objekt_19')
grafytexty(11)=jaz('grafy_objekt_21')
grafytexty(12)=jaz('grafy_objekt_22')
grafytexty(13)=jaz('grafy_objekt_23')
grafytexty(14)=jaz('grafy_objekt_25')
grafytexty(15)=jaz('grafy_objekt_27')
grafytexty(16)=jaz('grafy_objekt_29')
grafytexty(17)=jaz('grafy_objekt_30_1')
grafytexty(18)=jaz('grafy_objekt_30_2')
grafytexty(19)=jaz('grafy_objekt_30_3')
grafytexty(20)=jaz('grafy_objekt_31_1')
grafytexty(21)=jaz('grafy_objekt_31_2')
grafytexty(22)=jaz('grafy_objekt_31_3')
grafytexty(23)=jaz('grafy_objekt_32')
grafytexty(24)=jaz('grafy_objekt_33')
grafytexty(25)=jaz('grafy_objekt_34_1')
grafytexty(26)=jaz('grafy_objekt_34_2')
grafytexty(27)=jaz('grafy_objekt_35')
grafytexty(28)=jaz('grafy_objekt_37')
grafytexty(29)=jaz('grafy_objekt_38')
grafytexty(30)=jaz('grafy_objekt_39')
grafytexty(31)=jaz('grafy_objekt_41')
grafytexty(32)=jaz('grafy_objekt_42')
grafytexty(33)=jaz('grafy_objekt_44')
grafytexty(34)=jaz('grafy_objekt_46')
grafytexty(35)=jaz('grafy_objekt_47')
grafytexty(36)=jaz('grafy_objekt_48')
grafytexty(37)=jaz('grafy_objekt_49')
grafytexty(38)=jaz('grafy_objekt_51')
grafytexty(39)=jaz('grafy_objekt_54')
grafytexty(40)=jaz('grafy_objekt_55')
grafytexty(41)=jaz('grafy_objekt_56')
grafytexty(42)=jaz('grafy_objekt_58')
grafytexty(43)=jaz('grafy_objekt_59')
grafytexty(44)=jaz('grafy_objekt_60')
grafytexty(45)=jaz('grafy_objekt_62_1')
grafytexty(46)=jaz('grafy_objekt_62_2')
grafytexty(47)=jaz('grafy_objekt_62_3')
grafytexty(48)=jaz('grafy_objekt_62_4')
grafytexty(49)=jaz('grafy_objekt_62_5')
grafytexty(50)=jaz('grafy_objekt_62_6')
grafytexty(51)=jaz('grafy_objekt_62_7')
grafytexty(52)=jaz('grafy_objekt_62_8')
grafytexty(53)=jaz('grafy_objekt_63')
grafytexty(54)=jaz('grafy_objekt_64')
grafytexty(55)=jaz('grafy_objekt_65')
grafytexty(56)=jaz('grafy_objekt_66')
grafytexty(57)=jaz('grafy_objekt_67')
grafytexty(58)=jaz('grafy_objekt_75')
grafytexty(59)=jaz('grafy_objekt_77')
grafytexty(60)=jaz('grafy_objekt_78')
grafytexty(61)=jaz('grafy_objekt_79')
grafytexty(62)=jaz('grafy_objekt_81')
grafytexty(63)=jaz('grafy_objekt_84')
grafytexty(64)=jaz('grafy_objekt_86')
grafytexty(65)=jaz('grafy_objekt_88')
grafytexty(66)=jaz('grafy_objekt_89')
grafytexty(67)=jaz('grafy_objekt_91')
grafytexty(68)=jaz('grafy_objekt_92')
grafytexty(69)=jaz('grafy_objekt_102')
grafytexty(70)=jaz('grafy_objekt_104')
grafytexty(71)=jaz('grafy_objekt_106')
grafytexty(72)=jaz('grafy_objekt_109')
grafytexty(73)=jaz('grafy_objekt_111')
grafytexty(74)=jaz('grafy_objekt_112')
grafytexty(75)=jaz('grafy_objekt_114')
grafytexty(76)=jaz('grafy_objekt_115_1')
grafytexty(77)=jaz('grafy_objekt_115_2')
grafytexty(78)=jaz('grafy_objekt_115_3')
grafytexty(79)=jaz('grafy_objekt_116_1')
grafytexty(80)=jaz('grafy_objekt_116_2')
grafytexty(81)=jaz('grafy_objekt_116_3')
grafytexty(82)=jaz('grafy_objekt_116_4')
grafytexty(83)=jaz('grafy_objekt_116_5')
grafytexty(84)=jaz('grafy_objekt_117')
grafytexty(85)=jaz('grafy_objekt_118')
grafytexty(86)=jaz('grafy_objekt_119')
grafytexty(87)=jaz('grafy_objekt_120')
grafytexty(88)=jaz('grafy_objekt_123')
grafytexty(89)=jaz('grafy_objekt_125')
grafytexty(90)=jaz('grafy_objekt_126')
grafytexty(91)=jaz('grafy_objekt_127')
grafytexty(92)=jaz('grafy_objekt_128_1')
grafytexty(93)=jaz('grafy_objekt_128_2')
grafytexty(94)=jaz('grafy_objekt_129')
grafytexty(95)=jaz('grafy_objekt_145')
grafytexty(96)=jaz('grafy_objekt_151')
grafytexty(97)=jaz('grafy_objekt_152')
grafytexty(98)=jaz('grafy_objekt_155')
grafytexty(99)=jaz('grafy_objekt_157')
grafytexty(100)=jaz('grafy_objekt_159')
grafytexty(101)=jaz('grafy_objekt_161')
grafytexty(102)=jaz('grafy_objekt_163')
grafytexty(103)=jaz('grafy_objekt_164')
grafytexty(104)=jaz('grafy_objekt_167')
grafytexty(105)=jaz('grafy_objekt_169')
grafytexty(106)=jaz('grafy_objekt_171')
grafytexty(107)=jaz('grafy_objekt_173')
grafytexty(108)=jaz('grafy_objekt_177')
grafytexty(109)=jaz('grafy_objekt_178')
grafytexty(110)=jaz('grafy_objekt_180')
grafytexty(111)=jaz('grafy_objekt_187_1')
grafytexty(112)=jaz('grafy_objekt_187_2')
grafytexty(113)=jaz('grafy_objekt_187_3')
grafytexty(114)=jaz('grafy_objekt_187_4')
grafytexty(115)=jaz('grafy_objekt_187_5')
grafytexty(116)=jaz('grafy_objekt_188_1')
grafytexty(117)=jaz('grafy_objekt_188_2')
grafytexty(118)=jaz('grafy_objekt_188_3')
grafytexty(119)=jaz('grafy_objekt_188_4')
grafytexty(120)=jaz('grafy_objekt_188_5')
grafytexty(121)=jaz('grafy_objekt_188_6')
grafytexty(122)=jaz('grafy_objekt_189')
grafytexty(123)=jaz('grafy_objekt_190')
grafytexty(124)=jaz('grafy_objekt_191')
grafytexty(125)=jaz('grafy_objekt_193_1')
grafytexty(126)=jaz('grafy_objekt_193_2')
grafytexty(127)=jaz('grafy_objekt_193_3')
grafytexty(128)=jaz('grafy_objekt_193_4')
grafytexty(129)=jaz('grafy_objekt_193_5')
grafytexty(130)=jaz('grafy_objekt_194')
grafytexty(131)=jaz('grafy_objekt_195')
grafytexty(132)=jaz('grafy_objekt_200')
grafytexty(133)=jaz('grafy_objekt_206')
grafytexty(134)=jaz('grafy_objekt_208')
grafytexty(135)=jaz('grafy_objekt_212')
grafytexty(136)=jaz('grafy_objekt_pf41')
grafytexty(137)=jaz('grafy_objekt_pf42')
grafytexty(138)=jaz('grafy_objekt_pf43')
grafytexty(139)=jaz('grafy_objekt_pf44')
grafytexty(140)=jaz('grafy_objekt_pf45')
grafytexty(141)=jaz('grafy_objekt_pf46')
grafytexty(142)=jaz('grafy_objekt_pf47')
grafytexty(143)=jaz('grafy_objekt_pf48')
grafytexty(144)=jaz('grafy_objekt_pf49')
grafytexty(145)=jaz('grafy_objekt_pf50')
grafytexty(146)=jaz('grafy_objekt_pf51')
grafytexty(147)=jaz('grafy_typ_01')
grafytexty(148)=jaz('grafy_typ_02')
grafytexty(149)=jaz('grafy_typ_03')
grafytexty(150)=jaz('grafy_typ_04')
grafytexty(151)=jaz('grafy_typ_05')
grafytexty(152)=jaz('grafy_typ_06')
grafytexty(153)=jaz('grafy_typ_07')
grafytexty(154)=jaz('grafy_typ_08')
grafytexty(155)=jaz('grafy_typ_09')
grafytexty(156)=jaz('grafy_typ_10')
grafytexty(157)=jaz('grafy_typ_11')
grafytexty(158)=jaz('grafy_typ_12')
grafytexty(159)=jaz('grafy_typ_13')
grafytexty(160)=jaz('grafy_typ_14')
grafytexty(161)=jaz('grafy_typ_15')
grafytexty(162)=jaz('grafy_typ_16')
grafytexty(163)=jaz('grafy_typ_17')
grafytexty(164)=jaz('grafy_typ_18')
grafytexty(165)=jaz('grafy_legenda_01')
grafytexty(166)=jaz('grafy_legenda_02')
grafytexty(167)=jaz('grafy_legenda_03')
grafytexty(168)=jaz('grafy_legenda_04')
grafytexty(169)=jaz('grafy_legenda_05')
grafytexty(170)=jaz('grafy_legenda_06')
grafytexty(171)=jaz('grafy_legenda_07')
grafytexty(172)=jaz('grafy_legenda_08')
grafytexty(173)=jaz('grafy_legenda_09')
grafytexty(174)=jaz('grafy_legenda_10')
grafytexty(175)=jaz('grafy_legenda_11')
grafytexty(176)=jaz('grafy_legenda_12')
grafytexty(177)=jaz('grafy_legenda_13')
grafytexty(178)=jaz('grafy_zarovnanie')
grafytexty(179)=jaz("grafy_backlines")
grafytexty(180)=jaz("grafy_backbars")
grafytexty(181)=jaz("grafy_gradient")


