CREATE VIEW "SBODEMODE"."B1_DeferredDocTotalsView" ( "ObjType", "AbsEntry", "BaseSum", "VatSum", "EqSum", "DeductSum", "TotalSum" ) AS SELECT T0."SrcObjType" AS "ObjType", T0."SrcObjAbs" AS "AbsEntry", SUM(T1."BaseSum") AS "BaseSum", SUM(T1."VatSum") AS "VatSum", SUM(T1."EqSum") AS "EqSum", SUM(T1."DeductSum") AS "DeductSum", SUM((T1."BaseSum" + T1."VatSum")) AS "TotalSum" FROM  "SBODEMODE"."OTAX" T0  INNER  JOIN "SBODEMODE"."TAX1" T1  ON  T1."AbsEntry" = T0."AbsEntry"    LEFT OUTER  JOIN "SBODEMODE"."B1_MarketingDocumentsView" T2  ON  T2."DocType" = T0."SrcObjType"  AND  T2."DocEntry" = T0."SrcObjAbs"  AND  T2."CANCELED" = 'Y'   WHERE T1."Isdeferred" = ('Y' )  AND  T0."Cancelled" = ('N' )  AND  T2."DocEntry" IS NULL   AND  T0."SrcObjType" NOT IN('24' ,'46' ,'321' )   AND  (T1."BaseAbs" <= (0 )  OR  T1."BaseAbs" IS NULL   OR   NOT EXISTS (SELECT U0.*  FROM  "SBODEMODE"."OTAX" U0  WHERE U0."SrcObjType" = T1."BaseObjTyp"  AND  U0."SrcObjAbs" = T1."BaseAbs"  ) )  GROUP BY T0."SrcObjType", T0."SrcObjAbs" WITH READ ONLY