CREATE VIEW "SBODEMODE"."B1_OinmWithResources" ( "TransNum", "TransType", "CreatedBy", "BASE_REF", "DocLineNum", "DocDate", "DocDueDate", "CardCode", "CardName", "Ref1", "Ref2", "Comments", "JrnlMemo", "DocTime", "ItemCode", "Dscription", "InQty", "OutQty", "Price", "Currency", "Rate", "VendorNum", "SerialNum", "Warehouse", "TreeType", "SlpCode", "TaxDate", "DataSource", "PrjCode", "UserSign", "BlockNum", "ImportLog", "UseDocPric", "Location", "CalcPrice", "OpenQty", "Instance", "LastInst", "RevalTotal", "BaseCurr", "ApplObj", "AppObjAbs", "AppObjType", "StockAct", "TrnsfrAct", "PriceDifAc", "VarianceAc", "ReturnAct", "ExcRateAct", "ClearAct", "CostAct", "WipAct", "Balance", "CreateDate", "BaseLine", "TransValue", "PriceDiff", "TransSeq", "InvntAct", "RemMethod", "OpenValue", "SubLineNum", "AppObjLine", "Expenses", "OpenExp", "Allocation", "OpenAlloc", "ExpAlloc", "OExpAlloc", "OpenPDiff", "ExchDiff", "OpenEDiff", "NegInvAdjs", "OpenNegInv", "NegStckAct", "BTransVal", "VarVal", "BExpVal", "CogsVal", "BNegAVal", "IOffIncAcc", "IOffIncVal", "DOffDecAcc", "DOffDecVal", "DecAcc", "DecVal", "WipVal", "WipVarAcc", "WipVarVal", "IncAct", "IncVal", "ExpCAcc", "CostMethod", "OcrCode", "BaseQty", "PrevTrans", "HTransSeq", "OcrCode2", "OcrCode3", "OcrCode4", "OcrCode5", "StgSeqNum", "StgEntry", "StgDesc" ) AS SELECT T0."LogEntry" AS "TransNum", T0."DocType" AS "TransType", T0."DocEntry" AS "CreatedBy", '' AS "BASE_REF", T0."DocLine" AS "DocLineNum", T0."PostDate" AS "DocDate", T0."PostDate" AS "DocDueDate", '' AS "CardCode", '' AS "CardName", T0."DocNum" AS "Ref1", '' AS "Ref2", '' AS "Comments", '' AS "JrnlMemo", T0."CreateTime" AS "DocTime", T3."ResCode" AS "ItemCode", T3."ResName" AS "Dscription", T2."DocQty" AS "InQty", T1."DocQty" AS "OutQty", T0."Price" AS "Price", '' AS "Currency", 0 AS "Rate", '' AS "VendorNum", '' AS "SerialNum", T0."LocCode" AS "Warehouse", '' AS "TreeType", 0 AS "SlpCode", T0."PostDate" AS "TaxDate", '' AS "DataSource", '' AS "PrjCode", 0 AS "UserSign", '' AS "BlockNum", '' AS "ImportLog", '' AS "UseDocPric", 0 AS "Location", 0 AS "CalcPrice", 0 AS "OpenQty", -1 AS "Instance", 0 AS "LastInst", 0 AS "RevalTotal", '' AS "BaseCurr", T0."BaseType" AS "ApplObj", T0."BaseEntry" AS "AppObjAbs", 'R' AS "AppObjType", '' AS "StockAct", '' AS "TrnsfrAct", '' AS "PriceDifAc", '' AS "VarianceAc", '' AS "ReturnAct", '' AS "ExcRateAct", '' AS "ClearAct", '' AS "CostAct", '' AS "WipAct", 0 AS "Balance", T0."CreateDate" AS "CreateDate", T0."BaseLine" AS "BaseLine", 0 AS "TransValue", 0 AS "PriceDiff", -1 AS "TransSeq", '' AS "InvntAct", '' AS "RemMethod", 0 AS "OpenValue", 0 AS "SubLineNum", T0."BaseLine" AS "AppObjLine", 0 AS "Expenses", 0 AS "OpenExp", 0 AS "Allocation", 0 AS "OpenAlloc", 0 AS "ExpAlloc", 0 AS "OExpAlloc", 0 AS "OpenPDiff", 0 AS "ExchDiff", 0 AS "OpenEDiff", 0 AS "NegInvAdjs", 0 AS "OpenNegInv", '' AS "NegStckAct", 0 AS "BTransVal", 0 AS "VarVal", 0 AS "BExpVal", 0 AS "CogsVal", 0 AS "BNegAVal", '' AS "IOffIncAcc", 0 AS "IOffIncVal", '' AS "DOffDecAcc", 0 AS "DOffDecVal", '' AS "DecAcc", 0 AS "DecVal", 0 AS "WipVal", '' AS "WipVarAcc", 0 AS "WipVarVal", '' AS "IncAct", 0 AS "IncVal", '' AS "ExpCAcc", '' AS "CostMethod", '' AS "OcrCode", 0 AS "BaseQty", 0 AS "PrevTrans", 0 AS "HTransSeq", '' AS "OcrCode2", '' AS "OcrCode3", '' AS "OcrCode4", '' AS "OcrCode5", T0."StgSeqNum" AS "StgSeqNum", T0."StgEntry" AS "StgEntry", T0."StgDesc" AS "StgDesc" FROM  "SBODEMODE"."ORTL" T0   LEFT OUTER  JOIN "SBODEMODE"."ORTL" T1  ON  T0."LogEntry" = T1."LogEntry"  AND  T1."ActionType" = 2    LEFT OUTER  JOIN "SBODEMODE"."ORTL" T2  ON  T0."LogEntry" = T2."LogEntry"  AND  T2."ActionType" = 1   INNER  JOIN "SBODEMODE"."ORSC" T3  ON  T0."ResCode" = T3."ResCode"    LEFT OUTER  JOIN "SBODEMODE"."OILM" T4  ON  T0."ResCode" = T4."ItemCode"    LEFT OUTER  JOIN "SBODEMODE"."OIVL" T5  ON  T0."ResCode" = T5."ItemCode"    LEFT OUTER  JOIN "SBODEMODE"."IVL1" T6  ON  T5."TransSeq" = T6."TransSeq" WITH READ ONLY