CREATE VIEW "SBODEMODE"."B1_DocInstallmentsView" ( "DocEntry", "InstlmntID", "ObjType", "CardCode", "CardName", "NumAtCard", "SlpCode", "InsTotal", "InsTotalFC", "InsTotalSy", "BlockDunn", "DunnLevel", "IsSales", "IsDunnable", "PeyMethod" ) AS ((((((((((SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'Y' AS "IsSales", 'Y' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."INV6" T0  INNER  JOIN "SBODEMODE"."OINV" T1  ON  T1."DocEntry" = T0."DocEntry") UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'Y' AS "IsSales", 'N' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."RIN6" T0  INNER  JOIN "SBODEMODE"."ORIN" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'N' AS "IsSales", 'N' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."PCH6" T0  INNER  JOIN "SBODEMODE"."OPCH" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'N' AS "IsSales", 'N' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."RPC6" T0  INNER  JOIN "SBODEMODE"."ORPC" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'Y' AS "IsSales", 'Y' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."DPI6" T0  INNER  JOIN "SBODEMODE"."ODPI" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'N' AS "IsSales", 'N' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."DPO6" T0  INNER  JOIN "SBODEMODE"."ODPO" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'Y' AS "IsSales", 'Y' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."CSI6" T0  INNER  JOIN "SBODEMODE"."OCSI" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'N' AS "IsSales", 'N' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."CPI6" T0  INNER  JOIN "SBODEMODE"."OCPI" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'Y' AS "IsSales", 'Y' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."CSV6" T0  INNER  JOIN "SBODEMODE"."OCSV" T1  ON  T1."DocEntry" = T0."DocEntry")) UNION ALL (SELECT T0."DocEntry", T0."InstlmntID", T0."ObjType", T1."CardCode", T1."CardName", T1."NumAtCard", T1."SlpCode", T0."InsTotal", T0."InsTotalFC", T0."InsTotalSy", T1."BlockDunn", T0."DunnLevel", 'N' AS "IsSales", 'N' AS "IsDunnable", T1."PeyMethod" FROM  "SBODEMODE"."CPV6" T0  INNER  JOIN "SBODEMODE"."OCPV" T1  ON  T1."DocEntry" = T0."DocEntry")) WITH READ ONLY