есть такой кусок кода
Код: Выделить всё
_loop katsopr
{
if getfirst tkatpodr=tsOk and getfirst tkatorg=tsOk and getfirst tmanager=tsok then 
_loop spsopr
{
if getfirst tkatmc1=tsOk then
	{
	insert into tKatsSPSopr set
	tKatsSPSopr.nrec:=spsopr.nrec,
	tKatsSPSopr.data:=katsopr.dsopr,
	tKatsSPSopr.corg:=katsopr.corg,
	tKatsSPSopr.cpodrfrom:=katsopr.cpodrfrom,
	tKatsSPSopr.cmcusl:=spsopr.cmcusl,
	tKatsSPSopr.cproizw:=exclassseg.nrec,
	tKatsSPSopr.kol:=spsopr.kolfact,
	tKatsSPSopr.descr:=basedoc.descr,
	tKatsSPSopr.sum:=If (KatSopr.vHodNal=1,(SpSopr.Price*SpSopr.KolFact-SpSopr.SumNDS),SpSopr.Price*SpSopr.KolFact),
	tKatsSPsopr.partyname:=katparty.name;
	
        
             tKatsSpsopr.cenaprih:=sporder.rsrprice?????????????????????
    }
}
sporder я вроде привязала
Код: Выделить всё
and katsopr.nrec==sklorder.csopr
and sklorder.nrec==sporder.csklorder