#DEFINE PNT  "."
    dodavatel="Gastro Star s.r.o."
    insert_edihlav()
    DO WHILE !FEOF(m.edisubor) OR !EMPTY(m.txtriadok)
        DO CASE 
            CASE LEFT(m.txtriadok,3)="HDR"
                SELECT edihlav
                REPLACE c_faktury WITH SUBSTR(m.txtriadok,AT(";",m.txtriadok,1)+1,AT(";",m.txtriadok,2)-AT(";",m.txtriadok,1)-1)
                REPLACE dat_vyst WITH CTOD(SUBSTR(m.txtriadok,AT(";",m.txtriadok,2)+1,AT(";",m.txtriadok,3)-AT(";",m.txtriadok,2)-1))
                REPLACE icdph WITH "SK2022439837"
                REPLACE dic WITH "2022439837"
                REPLACE ico WITH "36831867"
                REPLACE partner WITH "Gastro Star s.r.o."
                REPLACE ulica WITH "Banská 4"
                REPLACE mesto WITH "Nové Mesto nad Váhom"
                REPLACE psc WITH "91501"
            CASE LEFT(m.txtriadok,3)="LIN"
                INSERT INTO edipol (id_edi, c_data, riadok, ean, kod_zak, mnozstvo, cena, cena_celk, dan, nazov) VALUES ;
                    (m.hladajidedi, m.cdata, ;
                    VAL(SUBSTR(m.txtriadok,ATC(";",m.txtriadok,1)+1,ATC(";",m.txtriadok,2)-ATC(";",m.txtriadok,1)-1)),;
                    "",;
                    SUBSTR(m.txtriadok,ATC(";",m.txtriadok,3)+1,ATC(";",m.txtriadok,4)-ATC(";",m.txtriadok,3)-1),;
                    VAL(STRTRAN(SUBSTR(m.txtriadok,ATC(";",m.txtriadok,6)+1,ATC(";",m.txtriadok,7)-ATC(";",m.txtriadok,6)-1),",",PNT)),;
                    VAL(STRTRAN(SUBSTR(m.txtriadok,ATC(";",m.txtriadok,7)+1,ATC(";",m.txtriadok,8)-ATC(";",m.txtriadok,7)-1),",",PNT)),;
                    VAL(STRTRAN(SUBSTR(m.txtriadok,ATC(";",m.txtriadok,8)+1),",",PNT)),;
                    VAL(STRTRAN(SUBSTR(m.txtriadok,ATC(";",m.txtriadok,5)+1,ATC(";",m.txtriadok,6)-ATC(";",m.txtriadok,5)-1),",",PNT)),;
                    SUBSTR(m.txtriadok,ATC(";",m.txtriadok,2)+1,ATC(";",m.txtriadok,3)-ATC(";",m.txtriadok,2)-1))
                IF m.hotel_platca_dph
                    REPLACE suma WITH suma+VAL(STRTRAN(SUBSTR(m.txtriadok,AT(";",m.txtriadok,8)+1),",",PNT))
                ELSE
                    REPLACE suma WITH suma+VAL(STRTRAN(SUBSTR(m.txtriadok,AT(";",m.txtriadok,8)+1),",",PNT))*(VAL(STRTRAN(SUBSTR(m.txtriadok,ATC(";",m.txtriadok,5)+1,ATC(";",m.txtriadok,6)-ATC(";",m.txtriadok,5)-1),",",PNT))/100+1)
                ENDIF  
        ENDCASE 
        txtriadok=FGETS(m.edisubor)
    ENDDO
    SELECT edipol
    IF !m.hotel_platca_dph
        REPLACE ALL cena WITH cena*(dan/100+1), cena_celk WITH cena_celk*(dan/100+1)
        REPLACE ALL dan WITH 0
    ENDIF 
    druhy_doklad_z_minusu()
    uloz_a_zavri()
