*       *       *       *       *       *       *       *       *       *       *       *       *       *       *       *       *       *       
*
*  2021-06-09 - 
*
*       *       *       *       *       *     #> ver. 2022-04-22 <#     *       *       *       *       *       *       *       *       *      


DO stahni_webovej_jidelak

SELECT *, " " as s_o_v, {} as datum, number as cislojidla, LEFT(name, 30) as nazev ;
       FROM (m.gchom_path + "jidelak_web") INTO TABLE (m.gcpri_path + "jidelak_web_2")

DELETE FOR BETWEEN(RIGHT(ALLTRIM(course), 1), "0", "9")

SCAN
    TRY  
        REPLACE datum WITH DATE(VAL(LEFT(date, 4)), VAL(SUBSTR(date,6,2)), VAL(SUBSTR(date,9,2)))
    CATCH
    ENDTRY 
ENDSCAN 

REPLACE s_o_v WITH "S" FOR course = m.course_S
REPLACE s_o_v WITH "O" FOR course = m.course_O
REPLACE s_o_v WITH "P" FOR course = m.course_P
REPLACE s_o_v WITH "V" FOR course = m.course_V

small_log ("prg  " + m.gchom_path, "create_jidelak")
CREATE TABLE (m.gchom_path + "jidelak") FREE (datum D, s_o_v C(1), cislojidla N(2), c_karty I, nazev C(30), spart C(3), canteen I, cislopril N(2), name C(250), descript C(250))
APPEND FROM (m.gcpri_path + "jidelak_web_2")

clos_data()

oznam_hotovo()
