CREATE VIEW "SBODEMODE"."SRI1_LINK" ( "LogEntry", "ItemCode", "SysSerial", "BaseType", "BaseEntry", "BaseNum", "BaseLinNum", "DocDate", "WhsCode", "CardCode", "CardName", "Direction", "CreateDate", "ItemName", "DataSource", "UserSign", "BsDocType", "BsDocEntry", "BsDocLine" ) AS SELECT b."LogEntry" as "LogEntry", b."ItemCode" as "ItemCode", c."SysNumber"		as "SysSerial", b."ApplyType"		as "BaseType", b."ApplyEntry"	as "BaseEntry", b."AppDocNum"		as "BaseNum", b."ApplyLine"		as "BaseLinNum", b."DocDate"		as "DocDate", b."LocCode"		as "WhsCode", b."CardCode"		as "CardCode", b."CardName"		as "CardName", ( CASE WHEN a."Quantity" > 0 THEN 0  ELSE 1 END ) as "Direction", b."CreateDate"	as "CreateDate", b."ItemName"		as "ItemName", 'N'				as "DataSource", NULL			as "UserSign", b."BaseType"		as "BsDocType", b."BaseEntry"		as "BsDocEntry", b."BaseLine"		as "BsDocLine" FROM		"SBODEMODE".ITL1 a INNER JOIN	"SBODEMODE".OITL b ON a."LogEntry" = b."LogEntry" INNER JOIN	OSRN c ON a."ItemCode" = c."ItemCode" and a."SysNumber" = c."SysNumber" WITH READ ONLY