LPARAMETERS mistecko

IF m.slovenskaverzia
    RETURN 
ENDIF 

IF m.issql
    RETURN 
ENDIF 

IF ATC("d_donna", m.gchom_path) + ATC("d_televize", m.gchom_path) + ATC("d_XXXX_globus", m.gchom_path) = 0
    RETURN 
ENDIF 


prog_chain = progchain()

mistecko = STRTRAN(m.mistecko, "_pred", "")
mistecko = STRTRAN(m.mistecko, "_click", "_clk")

konec_jmena_souboru = SUBSTR(STRTRAN(ttoc(DATETIME(),3), ":", "-"), 3, 15) ;
                    + m.gcuser_id +  "_"  + RIGHT(STRTRAN(m.machine, "@", ""), 11) + "_"  + m.mistecko

DO mk_dir WITH m.gccen_path + "bouraky"

DO CASE ATC("BOUR", m.prog_chain) > 0
    IF USED("bourak.dbf")
        WAIT "ukladam bourak" WINDOW NOWAIT 
        SELECT *                                                       FROM bourak INTO TABLE (m.gccen_path + "bouraky\b" + m.konec_jmena_souboru)
        USE 
    ENDIF 

CASE ATC("CALCCEN", m.prog_chain) > 0 .and. ATC("d_globus", m.gchom_path) > 0
    WAIT "ukladam globusovy ceny" WINDOW NOWAIT 

    SELECT disti c_karty FROM polozky INTO CURSOR recepturyyy
    INDEX on c_karty TAG c_karty
    SELECT c_karty, nazev, idriadok, cena_prum, pocet, " " AS receptura FROM karty INTO TABLE (m.gccen_path + "bouraky\k" + m.konec_jmena_souboru)
    SET RELATION TO c_karty INTO recepturyyy
    REPLACE ALL receptura WITH IIF(EMPTY(recepturyyy.c_karty), "", "R")
    USE 
    USE IN recepturyyy

OTHERWISE 
    IF USED("sklad")
        WAIT "ukladam sklad.dbf" WINDOW NOWAIT 
        SELECT c_stredisk, c_karty, vycisleni, idriadok                 FROM sklad INTO TABLE (m.gccen_path + "bouraky\s" + m.konec_jmena_souboru)
        USE 
    ENDIF 

ENDCASE 

WAIT CLEAR 
