SET DELETED ON
OPEN DATABASE f:\belcar\baze\belcar SHARED

USE f:\belcar\baze\fakstav ALIAS fakstav shared IN 0
USE f:\belcar\baze\roba ALIAS roba shared IN 0
USE d:\belcar\karrob ALIAS karrob exclusive IN 0

SELECT karrob
SET ORDER TO tag datum
ZAP

SELECT fakstav
SET order to tag KUPDOB
GOTO top
SEEK "0505A"
DO WHILE !EOF()
IF kupdob="0505A"
a=datum
b=sifrob
c=brdok
d=kolicina
e=cenasapor
f=euro

SELECT roba
SET ORDER TO tag sifrob
GOTO top
SEEK b
g=roba.naziv
h=roba.jm

	SELECT karrob
	APPEND BLANK
	replace datum WITH a
	replace sifrob WITH b
	replace nazrob with g
*	replace jm WITH roba.jm
	replace brdok WITH c
	replace ukolicina WITH d
	replace pcena WITH e
	replace marza WITH f
ENDIF
SELECT fakstav

SKIP
ENDDO
return