    insert_edihlav()
    DO WHILE !FEOF(m.edisubor)
        txtriadok=FGETS(m.edisubor,8192)
        DO CASE 
            CASE LEFT(m.txtriadok,3)="HDR"
                SELECT edihlav
                REPLACE c_faktury WITH alsu(4,15), dat_vyst WITH CTOD(SUBSTR(m.txtriadok,25,2)+"."+SUBSTR(m.txtriadok,23,2)+"."+SUBSTR(m.txtriadok,19,4))
                REPLACE ico WITH "E" + alsu(27,17), is_order WITH .t.
            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, valsu(4,6), alsu(10,25), alsu(35,25), valsu(60,12), 0, 0, 0, alsu(87,45))            
        ENDCASE 
    ENDDO
    SELECT edipol
    druhy_doklad_z_minusu()
    uloz_a_zavri("SYS ORDERS")
