*       *       *       *       *       *       *       *       *       *       *       *       *       *       *       *       *       *       
*
*  2021-08-22 - name a descript pripravi uz editacni formular jidelaku
*  2021-10-31 - dinner se neduplikuje, to jsou ta jejich jidla po limitu
*
*       *       *       *       *       *     #> ver. 2022-11-11 <#     *       *       *       *       *       *       *       *       *      


USE (m.gchom_path + "jidelak") IN 0 noupdate

SELECT LEFT(TTOC(datum, 3), 10) as date, canteen, s_o_v2course(s_o_v) as course, cislojidla as number, cislopril, c_karty, name, descript, m.course_P + " " as add_course ;
       WHERE datum >= DATE() AND BETWEEN(cislojidla, 1, 19) FROM jidelak INTO CURSOR jidelak_local READWRITE 

SELECT * FROM jidelak_local INTO TABLE (m.gcpri_path + "jidelak_local2")
DELETE FOR course = "dinner "
REPLACE ALL course WITH ALLTRIM(course) + "2", add_course WITH ALLTRIM(add_course) + "2"

SELECT * FROM jidelak_local INTO TABLE (m.gcpri_path + "jidelak_local3")
DELETE FOR course = "dinner "
REPLACE ALL course WITH ALLTRIM(course) + "3", add_course WITH ALLTRIM(add_course) + "3"

SELECT * FROM jidelak_local INTO TABLE (m.gcpri_path + "jidelak_local4")
DELETE FOR course = "dinner "
REPLACE ALL course WITH ALLTRIM(course) + "4", add_course WITH ALLTRIM(add_course) + "4"

SELECT * FROM jidelak_local INTO TABLE (m.gcpri_path + "jidelak_local5")
DELETE FOR course = "dinner "
REPLACE ALL course WITH ALLTRIM(course) + "5", add_course WITH ALLTRIM(add_course) + "5"

SELECT jidelak_local 
APPEND FROM (m.gcpri_path + "jidelak_local2")
** APPEND FROM (m.gcpri_path + "jidelak_local3")
** APPEND FROM (m.gcpri_path + "jidelak_local4")
** APPEND FROM (m.gcpri_path + "jidelak_local5")

jidelak_export_odeslani()
