CREATE VIEW "SBODEMODE"."B1_DeferredDocAppliedTotalsView" ( "ObjType", "AbsEntry", "BaseSum", "VatSum", "EqSum", "DeductSum", "TotalSum" ) AS SELECT T1."BaseObjTyp" AS "ObjType", T1."BaseAbs" 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" = T1."BaseObjTyp"  AND  T2."DocEntry" = T1."BaseAbs"  AND  T2."CANCELED" = 'Y'   WHERE T1."Isdeferred" = ('Y' )  AND  T0."Cancelled" = ('N' )  AND  T2."DocEntry" IS NULL   AND  T1."BaseAbs" > (0 )  AND  (T1."TaxType" = ('D' )  OR  T0."SrcObjType" NOT IN('24' ,'46' ,'321' )  ) AND   NOT EXISTS (SELECT U0.*  FROM  "SBODEMODE"."OTAX" U0  WHERE U0."SrcObjType" = T0."SrcObjType"  AND  U0."SrcObjAbs" = T0."SrcObjAbs"  AND  U0."AbsEntry" <> T0."AbsEntry"  AND  U0."Cancelled" = ('Y' )  )   GROUP BY T1."BaseObjTyp", T1."BaseAbs" WITH READ ONLY