*!*****************************************************************************
PROCEDURE chk_ceny
IF .T.		&&daj_dat()
	DO working
	= f_acc('(m.gccen_path + "karty") ORDER nazev')
	dd1 = DTOS(m.datum1) + SPACE(9)
	dd2 = DTOS(m.datum2) + " ZZZZZZZZ"
	SELE nazev, ROUND(AVG(cena), 2) AS prumer, ROUND(MIN(cena), 2) AS nejmensi, ROUND(MAX(cena), 2) AS nejvetsi, ;
		0.0 AS min_koef, 000.0 AS max_koef, SPACE(m.sirkastlpcadruh) AS druh, "   " AS mensitka, "   " AS vetsitka ;
		WHERE BETWEEN (datum, m.dd1, m.dd2) .AND. stornovano = .F. GROUP BY 1 ;
		FROM (m.gcdat_path + "obraty") INTO TABLE (m.gcpri_path + "mm")
	REPL FOR ! EMPT(prumer) min_koef WITH nejmensi/prumer, max_koef WITH nejvetsi/prumer

	REPL FOR min_koef < 0.9 mensitka WITH "  -"
	REPL FOR min_koef < 0.8 mensitka WITH "  <"
	REPL FOR min_koef < 0.7 mensitka WITH " <<"
	REPL FOR min_koef < 0.6 mensitka WITH "<<<"

	REPL FOR max_koef > 1.1 vetsitka WITH "-  "
	REPL FOR max_koef > 1.2 vetsitka WITH ">  "
	REPL FOR max_koef > 1.3 vetsitka WITH ">> "
	REPL FOR max_koef > 1.4 vetsitka WITH ">>>"

	REPL FOR prumer   < 0.1 vetsitka WITH "**", mensitka WITH "**"

	REPL FOR min_koef > 0.9 min_koef WITH 0
	REPL FOR max_koef < 1.1 max_koef WITH 0
	SET RELA TO nazev INTO mkahlc
	REPL ALL druh WITH mkahlc.druh
	SET RELA OFF INTO mkahlc
	INDEX ON druh + nazev TAG dn
	DO pr_report WITH "chk_ceny"

	SET FILT TO ! EMPT(mensitka + vetsitka)
	view_mssg = jaz("prg_rep_jen_podezrele")
	DO pr_report WITH "chk_ceny@podezrele"

	SELE datum + STR(poradi,4) AS dp, ROUND(SUM(mnozstvi * cena), 0) AS prachy ;
		WHERE BETWEEN (datum, m.dd1, m.dd2) .AND. operace = "PRI-B" GROUP BY 1 ;
		FROM (m.dat_path + "obraty") INTO TABLE (m.gcpri_path + "blbbour1")
	DELE FOR ABS(prachy) < 5
	IF ! prazdna(.T.)
		SELE datum + STR(poradi,4) AS dp, nazev + "   " AS nazev, mnozstvi, cena ;
			WHERE datum + STR(poradi,4) IN (SELE dp FROM (m.gcpri_path + "blbbour1")) ;
			FROM (m.dat_path + "obraty") INTO TABLE (m.gcpri_path + "blbbour2")
		REPL FOR mnozstvi > 0 nazev WITH "   " + nazev
		INDEX ON dp + STR(SIGN(mnozstvi)+2, 3) TAG dpm
		DO pr_report WITH "chk_bour"
	ENDIF

ENDIF
DO clos_data


