** odmazani starych zadanek, ktere nebyly prijaty
IF m.issql
	PRIVATE m.hladajdatum
	m.hladajdatum=DATE() - dny_smazani_objednav
	SELECT 0
	USE (m.sqlprefix+"rexitofoxdoklady") ALIAS dokl
	=CURSORSETPROP("Buffering",5,"dokl")
	REPLACE ALL pz2 WITH "ZRUS " + DTOS(DATE())
	=TABLEUPDATE(.T.,.T.,"dokl")
	USE IN dokl
ELSE
	USE (m.fn_doklady)
	SET FILTER TO "Z" $ operace .AND. EMPTY(pz2) .AND. datum_dokl < DATE() - dny_smazani_objednav
	REPLACE ALL pz2 WITH "ZRUS " + DTOS(DATE())
	USE
ENDIF

