SELECT CASE 
		WHEN (
				(
					(NOT T1."MAKE" IN ('OP', 'PE'))
					OR (T1."MAKE" IS NULL)
					)
				OR (T1."MAKE" = ' ')
				)
			THEN (
					(
						CASE 
							WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
								THEN ('OP')
							WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
								THEN ('PE')
							ELSE ('00')
							END
						)
					)
		ELSE (T1."MAKE")
		END + '-' + (
		CASE 
			WHEN (
					(((rtrim(T2."ACCT_NR"))) LIKE '2%')
					AND (T1."SITE" IS NULL)
					)
				THEN ('01')
			ELSE ((right('00' + (left(T1."SITE", 2)), 2)))
			END
		) + '-' + ((rtrim(T2."ACCT_NR"))) + '-' + (
		CASE 
			WHEN (
					(T1."DEPARTMENT" IS NULL)
					OR ((rtrim(T1."DEPARTMENT")) = '')
					)
				THEN ('00')
			ELSE ((rtrim(T1."DEPARTMENT")))
			END
		) + '-' + (
		CASE 
			WHEN (
					(T1."DESTINATION" = '00')
					AND (T1."PRICE_CODE" <> '')
					)
				THEN (T1."PRICE_CODE")
			WHEN (
					(
						(T1."DESTINATION" = '00')
						AND (T1."PRICE_CODE" = '')
						)
					AND (T3."CUSTOMER_GROUP" <> '')
					)
				THEN (T3."CUSTOMER_GROUP")
			WHEN ((rtrim(T1."DESTINATION")) = '')
				THEN ('00')
			ELSE (T1."DESTINATION")
			END
		) + '-' + (
		(
			rtrim(CASE 
					WHEN (
							(T4."MODEL_LINE" IS NOT NULL)
							AND (T4."MODEL_LINE" <> '')
							)
						THEN (T4."MODEL_LINE")
					WHEN (
							(T1."PRODUCT_GROUP" IS NOT NULL)
							AND (T1."PRODUCT_GROUP" <> '')
							)
						THEN (T1."PRODUCT_GROUP")
					WHEN (
							(T1."REPAIR_GROUP" IS NOT NULL)
							AND (T1."REPAIR_GROUP" <> '')
							)
						THEN (T1."REPAIR_GROUP")
					ELSE ('00')
					END)
			)
		) AS "Acct Nr",
	T2."LEDGER_ACCTS_NAME" AS "Ledger Accts Name",
	T2."LEDGER_ACCTS_NAME2" AS "Ledger Accts Name2",
	T2."HANDLER" AS "Handler_2",
	T2."DEPT_SPLIT" AS "Dept Split",
	T2."TYPE_ACCTT" AS "Type Acctt",
	T1."ACCT_NO" AS "Acct No",
	T1."BOOKKEEP_DATE" AS "Bookkeep Date",
	T1."BOOKKEEP_PERIOD" AS "Bookkeep Period",
	T1."DOCUMENT_NO" AS "Document No",
	T1."ORIGIN" AS "Origin",
	T1."STATUS" AS "Status",
	T1."DEBIT_AMOUNT" AS "Debit Amount",
	T1."CREDIT_AMOUNT" AS "Credit Amount",
	T1."DEBIT_QUANTITY" AS "Debit Quantity",
	T1."CREDIT_QUANTITY" AS "Credit Quantity",
	T1."AA_TRTYPE" AS "Aa Trtype",
	T1."DEPARTMENT" AS "Department",
	T1."STOCK" AS "Stock",
	T1."MAKE_FAMILY" AS "Make Family",
	T1."MAKE" AS "Make",
	T1."VEHICLE_TYPE" AS "Vehicle Type",
	T1."MODEL_LINE" AS "Model Line",
	T1."FACTORY_MODEL" AS "Factory Model",
	T1."WORKSHOP_MODEL" AS "Workshop Model",
	T1."PRODUCT_GROUP" AS "Product Group",
	T1."REPAIR_GROUP" AS "Repair Group",
	T1."KIT_GROUP" AS "Kit Group",
	T1."TIME_CODE" AS "Time Code",
	T1."INT_VOUCHER_NO" AS "Int Voucher No",
	T1."BALANCING_MARK" AS "Balancing Mark",
	T1."USED_VEH_DEST_CODE" AS "Used Veh Dest Code",
	T1."USE_OF_VEHICLE" AS "Use Of Vehicle",
	T1."ACCT_NO_NEXT_CHART" AS "Acct No Next Chart",
	T5."REFERENCE_IDENT" AS "Reference Ident",
	T5."TRANSACT_DATE" AS "Transact Date",
	T5."HANDLER" AS "Handler",
	T5."PROGRAM" AS "Program",
	T5."FUNCTION_CODE" AS "Function Code",
	T5."MODUL" AS "Modul",
	T5."DOCUMENT_KEY" AS "Document Key",
	T5."COMMENT" AS "Comment",
	T6."DEPARTMENT_TYPE_ID" AS "Department Type Id",
	T6."DESCRIPTION" AS "Description_2",
	T6."DEPARTMENT_GROUP" AS "Department Group",
	T7."AA_TRTYPE_ID" AS "Aa Trtype Id",
	T7."DESCRIPTION" AS "Description",
	T7."OWN_DESCRIPTION" AS "Own Description",
	'1' AS "Rechtseinheit",
	CASE 
		WHEN (
				(
					(
						CASE 
							WHEN (
									(
										(NOT T1."MAKE" IN ('OP', 'PE'))
										OR (T1."MAKE" IS NULL)
										)
									OR (T1."MAKE" = ' ')
									)
								THEN (
										(
											CASE 
												WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
													THEN ('OP')
												WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
													THEN ('PE')
												ELSE ('00')
												END
											)
										)
							ELSE (T1."MAKE")
							END + '-' + (
							CASE 
								WHEN (
										(((rtrim(T2."ACCT_NR"))) LIKE '2%')
										AND (T1."SITE" IS NULL)
										)
									THEN ('01')
								ELSE ((right('00' + (left(T1."SITE", 2)), 2)))
								END
							) + '-' + ((rtrim(T2."ACCT_NR"))) + '-' + (
							CASE 
								WHEN (
										(T1."DEPARTMENT" IS NULL)
										OR ((rtrim(T1."DEPARTMENT")) = '')
										)
									THEN ('00')
								ELSE ((rtrim(T1."DEPARTMENT")))
								END
							) + '-' + (
							CASE 
								WHEN (
										(T1."DESTINATION" = '00')
										AND (T1."PRICE_CODE" <> '')
										)
									THEN (T1."PRICE_CODE")
								WHEN (
										(
											(T1."DESTINATION" = '00')
											AND (T1."PRICE_CODE" = '')
											)
										AND (T3."CUSTOMER_GROUP" <> '')
										)
									THEN (T3."CUSTOMER_GROUP")
								WHEN ((rtrim(T1."DESTINATION")) = '')
									THEN ('00')
								ELSE (T1."DESTINATION")
								END
							) + '-' + (
							(
								rtrim(CASE 
										WHEN (
												(T4."MODEL_LINE" IS NOT NULL)
												AND (T4."MODEL_LINE" <> '')
												)
											THEN (T4."MODEL_LINE")
										WHEN (
												(T1."PRODUCT_GROUP" IS NOT NULL)
												AND (T1."PRODUCT_GROUP" <> '')
												)
											THEN (T1."PRODUCT_GROUP")
										WHEN (
												(T1."REPAIR_GROUP" IS NOT NULL)
												AND (T1."REPAIR_GROUP" <> '')
												)
											THEN (T1."REPAIR_GROUP")
										ELSE ('00')
										END)
								)
							)
						) LIKE '2%'
					)
				AND (T1."SITE" IS NULL)
				)
			THEN ('01')
		ELSE ((left(T1."SITE", 2)))
		END AS "Betrieb",
	CASE 
		WHEN (
				(
					(NOT T1."MAKE" IN ('OP', 'PE'))
					OR (T1."MAKE" IS NULL)
					)
				OR (T1."MAKE" = ' ')
				)
			THEN (
					(
						CASE 
							WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
								THEN ('OP')
							WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
								THEN ('PE')
							ELSE ('00')
							END
						)
					)
		ELSE (T1."MAKE")
		END AS "Marke",
	T1."DEBIT_AMOUNT" + T1."CREDIT_AMOUNT" AS "Betrag",
	'1' AS "Mandant",
	(T1."DEBIT_QUANTITY" + T1."CREDIT_QUANTITY") AS "Menge",
	CASE 
		WHEN ((- 1 * datediff(day, (getdate()), T1."BOOKKEEP_DATE")) <= 120)
			THEN ((left((((T1."DOCUMENT_NO"))), 7)) + ' - ' + T5."COMMENT")
		ELSE NULL
		END AS "Text",
	(left(T1."ACCT_NO", 1)) AS "Susa_2",
	T8."ORDER_NUMBER" AS "Order Number",
	T8."LINE_NUMBER" AS "Line Number",
	T8."INV_TIME" AS "Inv Time",
	T8."INV_TIME_INT" AS "Inv Time Int",
	T8."MAKE_TIME_UNIT" AS "Make Time Unit",
	T1."SITE" AS "Site",
	CASE 
		WHEN (T1."DEPARTMENT" = '    ')
			THEN ('00')
		ELSE (T1."DEPARTMENT")
		END AS "KST",
	T4."MODEL_LINE" AS "Model Line_vpp5q",
	T4."MOD_LIN_SPECIFY" AS "Mod Lin Specify_vpp5q",
	CASE 
		WHEN (T4."MODEL_LINE" IS NOT NULL)
			THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
		WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
			THEN (T1."PRODUCT_GROUP")
		WHEN (T1."REPAIR_GROUP" IS NOT NULL)
			THEN (T1."REPAIR_GROUP")
		ELSE ('00 - ohne')
		END AS "Kostentr�ger_mit_Bez_",
	(
		substring((
				CASE 
					WHEN (T4."MODEL_LINE" IS NOT NULL)
						THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
					WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
						THEN (T1."PRODUCT_GROUP")
					WHEN (T1."REPAIR_GROUP" IS NOT NULL)
						THEN (T1."REPAIR_GROUP")
					ELSE ('00 - ohne')
					END
				), 1, 2)
		) AS "Kostentr�ger",
	T9."CUSTOMER_NUMBER" AS "Customer Number",
	T3."CUSTOMER_GROUP" AS "Customer Group",
	CASE 
		WHEN (
				(T1."DESTINATION" = '00')
				AND (T1."PRICE_CODE" <> '')
				)
			THEN (T1."PRICE_CODE")
		WHEN (
				(
					(T1."DESTINATION" = '00')
					AND (T1."PRICE_CODE" = '')
					)
				AND (T3."CUSTOMER_GROUP" <> '')
				)
			THEN (T3."CUSTOMER_GROUP")
		WHEN ((rtrim(T1."DESTINATION")) = '')
			THEN ('00')
		ELSE (T1."DESTINATION")
		END AS "Absatzkanal",
	T2."TYPE_ACCTT" AS "GuV_Bilanz",
	(left(T1."ACCT_NO", 1)) AS "Susa",
	CASE 
		WHEN (
				(
					(
						substring((
								CASE 
									WHEN (T1."DEPARTMENT" = '    ')
										THEN ('00')
									ELSE (T1."DEPARTMENT")
									END
								), 1, 1)
						) = '1'
					)
				AND (
					NOT (
						(
							substring((
									CASE 
										WHEN (T4."MODEL_LINE" IS NOT NULL)
											THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
										WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
											THEN (T1."PRODUCT_GROUP")
										WHEN (T1."REPAIR_GROUP" IS NOT NULL)
											THEN (T1."REPAIR_GROUP")
										ELSE ('00 - ohne')
										END
									), 1, 2)
							)
						) IN ('00')
					)
				)
			THEN ('Neuwagen')
		WHEN (
				(
					(
						substring((
								CASE 
									WHEN (T1."DEPARTMENT" = '    ')
										THEN ('00')
									ELSE (T1."DEPARTMENT")
									END
								), 1, 1)
						) = '2'
					)
				AND (
					NOT (
						(
							substring((
									CASE 
										WHEN (T4."MODEL_LINE" IS NOT NULL)
											THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
										WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
											THEN (T1."PRODUCT_GROUP")
										WHEN (T1."REPAIR_GROUP" IS NOT NULL)
											THEN (T1."REPAIR_GROUP")
										ELSE ('00 - ohne')
										END
									), 1, 2)
							)
						) IN ('00')
					)
				)
			THEN ('Gebrauchtwagen')
		WHEN (
				(
					(
						substring((
								CASE 
									WHEN (T1."DEPARTMENT" = '    ')
										THEN ('00')
									ELSE (T1."DEPARTMENT")
									END
								), 1, 1)
						) = '3'
					)
				AND (
					NOT (
						(
							substring((
									CASE 
										WHEN (T4."MODEL_LINE" IS NOT NULL)
											THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
										WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
											THEN (T1."PRODUCT_GROUP")
										WHEN (T1."REPAIR_GROUP" IS NOT NULL)
											THEN (T1."REPAIR_GROUP")
										ELSE ('00 - ohne')
										END
									), 1, 2)
							)
						) IN ('00')
					)
				)
			THEN ('Teile & Zubeh�r')
		WHEN (
				(
					(
						substring((
								CASE 
									WHEN (T1."DEPARTMENT" = '    ')
										THEN ('00')
									ELSE (T1."DEPARTMENT")
									END
								), 1, 1)
						) = '4'
					)
				AND (
					NOT (
						(
							substring((
									CASE 
										WHEN (T4."MODEL_LINE" IS NOT NULL)
											THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
										WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
											THEN (T1."PRODUCT_GROUP")
										WHEN (T1."REPAIR_GROUP" IS NOT NULL)
											THEN (T1."REPAIR_GROUP")
										ELSE ('00 - ohne')
										END
									), 1, 2)
							)
						) IN ('00')
					)
				)
			THEN ('Service')
		ELSE ('Ohne Kostentr�ger')
		END AS "Ebene31",
	CASE 
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) IN ('OP')
				)
			THEN ('OP')
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) IN ('VW')
				)
			THEN ('VW')
		ELSE NULL
		END AS "Marke f�r Kostentr�ger",
	CASE 
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) IN ('OP')
				)
			THEN (
					(
						CASE 
							WHEN (
									(
										CASE 
											WHEN (
													(
														(NOT T1."MAKE" IN ('OP', 'PE'))
														OR (T1."MAKE" IS NULL)
														)
													OR (T1."MAKE" = ' ')
													)
												THEN (
														(
															CASE 
																WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
																	THEN ('OP')
																WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
																	THEN ('PE')
																ELSE ('00')
																END
															)
														)
											ELSE (T1."MAKE")
											END
										) IN ('OP')
									)
								THEN ('OP')
							WHEN (
									(
										CASE 
											WHEN (
													(
														(NOT T1."MAKE" IN ('OP', 'PE'))
														OR (T1."MAKE" IS NULL)
														)
													OR (T1."MAKE" = ' ')
													)
												THEN (
														(
															CASE 
																WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
																	THEN ('OP')
																WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
																	THEN ('PE')
																ELSE ('00')
																END
															)
														)
											ELSE (T1."MAKE")
											END
										) IN ('VW')
									)
								THEN ('VW')
							ELSE NULL
							END
						) + (
						CASE 
							WHEN (T4."MODEL_LINE" IS NOT NULL)
								THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
							WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
								THEN (T1."PRODUCT_GROUP")
							WHEN (T1."REPAIR_GROUP" IS NOT NULL)
								THEN (T1."REPAIR_GROUP")
							ELSE ('00 - ohne')
							END
						)
					)
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) IN ('VW')
				)
			THEN (
					(
						CASE 
							WHEN (
									(
										CASE 
											WHEN (
													(
														(NOT T1."MAKE" IN ('OP', 'PE'))
														OR (T1."MAKE" IS NULL)
														)
													OR (T1."MAKE" = ' ')
													)
												THEN (
														(
															CASE 
																WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
																	THEN ('OP')
																WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
																	THEN ('PE')
																ELSE ('00')
																END
															)
														)
											ELSE (T1."MAKE")
											END
										) IN ('OP')
									)
								THEN ('OP')
							WHEN (
									(
										CASE 
											WHEN (
													(
														(NOT T1."MAKE" IN ('OP', 'PE'))
														OR (T1."MAKE" IS NULL)
														)
													OR (T1."MAKE" = ' ')
													)
												THEN (
														(
															CASE 
																WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
																	THEN ('OP')
																WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
																	THEN ('PE')
																ELSE ('00')
																END
															)
														)
											ELSE (T1."MAKE")
											END
										) IN ('VW')
									)
								THEN ('VW')
							ELSE NULL
							END
						) + (
						CASE 
							WHEN (T4."MODEL_LINE" IS NOT NULL)
								THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
							WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
								THEN (T1."PRODUCT_GROUP")
							WHEN (T1."REPAIR_GROUP" IS NOT NULL)
								THEN (T1."REPAIR_GROUP")
							ELSE ('00 - ohne')
							END
						)
					)
		ELSE (
				(
					CASE 
						WHEN (T4."MODEL_LINE" IS NOT NULL)
							THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
						WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
							THEN (T1."PRODUCT_GROUP")
						WHEN (T1."REPAIR_GROUP" IS NOT NULL)
							THEN (T1."REPAIR_GROUP")
						ELSE ('00 - ohne')
						END
					)
				)
		END AS "Kostentr�ger_mit_Bez",
	(
		substring((
				CASE 
					WHEN (
							(
								(NOT T1."MAKE" IN ('OP', 'PE'))
								OR (T1."MAKE" IS NULL)
								)
							OR (T1."MAKE" = ' ')
							)
						THEN (
								(
									CASE 
										WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
											THEN ('OP')
										WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
											THEN ('PE')
										ELSE ('00')
										END
									)
								)
					ELSE (T1."MAKE")
					END + '-' + (
					CASE 
						WHEN (
								(((rtrim(T2."ACCT_NR"))) LIKE '2%')
								AND (T1."SITE" IS NULL)
								)
							THEN ('01')
						ELSE ((right('00' + (left(T1."SITE", 2)), 2)))
						END
					) + '-' + ((rtrim(T2."ACCT_NR"))) + '-' + (
					CASE 
						WHEN (
								(T1."DEPARTMENT" IS NULL)
								OR ((rtrim(T1."DEPARTMENT")) = '')
								)
							THEN ('00')
						ELSE ((rtrim(T1."DEPARTMENT")))
						END
					) + '-' + (
					CASE 
						WHEN (
								(T1."DESTINATION" = '00')
								AND (T1."PRICE_CODE" <> '')
								)
							THEN (T1."PRICE_CODE")
						WHEN (
								(
									(T1."DESTINATION" = '00')
									AND (T1."PRICE_CODE" = '')
									)
								AND (T3."CUSTOMER_GROUP" <> '')
								)
							THEN (T3."CUSTOMER_GROUP")
						WHEN ((rtrim(T1."DESTINATION")) = '')
							THEN ('00')
						ELSE (T1."DESTINATION")
						END
					) + '-' + (
					(
						rtrim(CASE 
								WHEN (
										(T4."MODEL_LINE" IS NOT NULL)
										AND (T4."MODEL_LINE" <> '')
										)
									THEN (T4."MODEL_LINE")
								WHEN (
										(T1."PRODUCT_GROUP" IS NOT NULL)
										AND (T1."PRODUCT_GROUP" <> '')
										)
									THEN (T1."PRODUCT_GROUP")
								WHEN (
										(T1."REPAIR_GROUP" IS NOT NULL)
										AND (T1."REPAIR_GROUP" <> '')
										)
									THEN (T1."REPAIR_GROUP")
								ELSE ('00')
								END)
						)
					)
				), 1, 4)
		) + '-' + (
		CASE 
			WHEN (
					(
						(NOT T1."MAKE" IN ('OP', 'PE'))
						OR (T1."MAKE" IS NULL)
						)
					OR (T1."MAKE" = ' ')
					)
				THEN (
						(
							CASE 
								WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
									THEN ('OP')
								WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
									THEN ('PE')
								ELSE ('00')
								END
							)
						)
			ELSE (T1."MAKE")
			END
		) + (left(T1."SITE", 2)) + (
		substring((
				CASE 
					WHEN (T1."DEPARTMENT" = '    ')
						THEN ('00')
					ELSE (T1."DEPARTMENT")
					END
				), 1, 2)
		) + (
		CASE 
			WHEN (
					(T1."DESTINATION" = '00')
					AND (T1."PRICE_CODE" <> '')
					)
				THEN (T1."PRICE_CODE")
			WHEN (
					(
						(T1."DESTINATION" = '00')
						AND (T1."PRICE_CODE" = '')
						)
					AND (T3."CUSTOMER_GROUP" <> '')
					)
				THEN (T3."CUSTOMER_GROUP")
			WHEN ((rtrim(T1."DESTINATION")) = '')
				THEN ('00')
			ELSE (T1."DESTINATION")
			END
		) + (
		(
			substring((
					CASE 
						WHEN (T4."MODEL_LINE" IS NOT NULL)
							THEN (T4."MODEL_LINE" + ' - ' + T4."MOD_LIN_SPECIFY")
						WHEN (T1."PRODUCT_GROUP" IS NOT NULL)
							THEN (T1."PRODUCT_GROUP")
						WHEN (T1."REPAIR_GROUP" IS NOT NULL)
							THEN (T1."REPAIR_GROUP")
						ELSE ('00 - ohne')
						END
					), 1, 2)
			)
		) AS "ACCT_Detail",
	CASE 
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) = '00'
				)
			THEN ('ohne Marke')
		ELSE ('mit Marke')
		END AS "Buchungen ohne Marke",
	CASE 
		WHEN (
				(
					CASE 
						WHEN (T1."DEPARTMENT" = '    ')
							THEN ('00')
						ELSE (T1."DEPARTMENT")
						END
					) = '00'
				)
			THEN ('ohne KST')
		ELSE ('mit KST')
		END AS "Buchungen ohne KST",
	CASE 
		WHEN (
				(
					CASE 
						WHEN (
								(T1."DESTINATION" = '00')
								AND (T1."PRICE_CODE" <> '')
								)
							THEN (T1."PRICE_CODE")
						WHEN (
								(
									(T1."DESTINATION" = '00')
									AND (T1."PRICE_CODE" = '')
									)
								AND (T3."CUSTOMER_GROUP" <> '')
								)
							THEN (T3."CUSTOMER_GROUP")
						WHEN ((rtrim(T1."DESTINATION")) = '')
							THEN ('00')
						ELSE (T1."DESTINATION")
						END
					) = '00'
				)
			THEN (('ohne Absatzkanal'))
		ELSE ('mit Absatzkanal')
		END AS "Buchungen ohne Absatzkanal",
	T1."DESTINATION" AS "Destination",
	CASE 
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) = 'OP'
				)
			THEN ('OP - Opel')
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) = 'PE'
				)
			THEN ('PE - Peugeot')
		WHEN (
				(
					CASE 
						WHEN (
								(
									(NOT T1."MAKE" IN ('OP', 'PE'))
									OR (T1."MAKE" IS NULL)
									)
								OR (T1."MAKE" = ' ')
								)
							THEN (
									(
										CASE 
											WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
												THEN ('OP')
											WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
												THEN ('PE')
											ELSE ('00')
											END
										)
									)
						ELSE (T1."MAKE")
						END
					) = 'AU'
				)
			THEN ('00 - ohne Marke')
		ELSE ('Marke fehlt')
		END AS "Marke_mit_Bez",
	T1."STRATEGIC_AREA" AS "Strategic Area",
	CASE 
		WHEN (T1."STRATEGIC_AREA" IN ('AUTO      ', 'Opel      ', 'OPEL      '))
			THEN ('OP')
		WHEN (T1."STRATEGIC_AREA" IN ('PEUGEOT   '))
			THEN ('PE')
		ELSE ('00')
		END AS "Marke_Strategic_Area",
	T10."Hauptbetrieb_ID" AS "Hauptbetrieb_ID",
	T10."Hauptbetrieb_Name" AS "Hauptbetrieb Name",
	T10."Standort_ID" AS "Standort Id",
	T10."Standort_Name" AS "Standort Name",
	T1."PRICE_CODE" AS "Price Code"
FROM "OPTIMA"."import"."ACCOUNT_INFO" T2,
	(
		(
			(
				(
					"OPTIMA"."import"."ACCT_DOC_KEY" T1 LEFT JOIN "OPTIMA"."import"."vPP5Q" T4 ON (T1."MODEL_LINE" = T4."MODEL_LINE")
						AND (T1."MAKE" = T4."MAKE_CD")
					) LEFT JOIN "OPTIMA"."import"."DEPARTMENT_TYPE" T6 ON T1."DEPARTMENT" = T6."DEPARTMENT_TYPE_ID"
				) LEFT JOIN "OPTIMA"."import"."AA_TRTYPE" T7 ON T1."AA_TRTYPE" = T7."AA_TRTYPE_ID"
			) LEFT JOIN "OPTIMA"."data"."GC_Department" T10 ON (T1."CLIENT_DB" = T10."Hauptbetrieb")
			AND (T1."SITE" = T10."Site")
		),
	(
		(
			(
				"OPTIMA"."import"."ACCT_DOC_DATA" T5 LEFT JOIN "OPTIMA"."import"."ACCT_DOC_SALESCLAS" T9 ON T5."REFERENCE_IDENT" = T9."REFERENCE_IDENT"
				) LEFT JOIN "OPTIMA"."import"."CUSTOMER" T3 ON T3."CUSTOMER_NUMBER" = T9."CUSTOMER_NUMBER"
			) LEFT JOIN "OPTIMA"."import"."ORDER_LINE" T8 ON (T8."ORDER_NUMBER" = T9."ORDER_NUMBER")
			AND (T8."LINE_NUMBER" = T9."ORDER_LINE_NUMBER")
		)
WHERE (T2."ACCT_NR" = T1."ACCT_NO")
	AND (T1."UNIQUE_IDENT" = T5."REFERENCE_IDENT")
	AND (T2."TYPE_ACCTT" = '2')
