SET DELETED ON
clear
SET DEFAULT TO d:\2011\robno\baze
OPEN DATABASE belcar SHARED
USE kalkstav ALIAS kalkstav shared IN 0
sET DEVICE TO printer
SET PRINTER TO b.lst
USE d:\2010\robno\baze\zalihe ALIAS zalihe shared IN 0
SELECT zalihe
GOTO top
DO WHILE !EOF()
IF zalihe.magacin="01   "
	A1=zalihe.sifra
	a2=zalihe.ukol-zalihe.ikol
	a3=zalihe.nabcen
	SELECT kalkstav
	SET ORDER TO TAG sifrob
	GOTO TOP
	SEEK A1
	mkol=0
	mnce=0
	DO WHILE !EOF()
	IF kalkstav.sifrob<>a1
		EXIT
	ENDIF
	IF kalkstav.brdok<>"PS"
		SKIP
		LOOP
	endif		
		mkol=kalkstav.kolicina
		mnce=kalkstav.ncena
	**	IF a2<>mkol .or. a3<>mnce
			@PROW()+1,1 say a1 picture "99999999"
			@PROW(),10 say a2
			@PROW(),25 say a3
			@PROW(),40 say mkol
			@PROW(),55 say mnce
	**	endif	
	EXIT
	enddo
*!*			SELECT KALKSTAV
*!*			REPLACE KALKSTAV.NCENA WITH A2
*!*			REPLACE KALKSTAV.PCENA WITH A3
*!*			REPLACE KALKSTAV.DOBCEN WITH A2
ENDIF
SELECT zalihe
SKIP
ENDDO
SET PRINTER to
SET DEVICE TO screen

RETURN
