NW_GW_Auftragseingang.iqd 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,O21
  4. DATASOURCENAME,C:\GAPS\Portal\System\IQD\NW\NW_GW_Auftragseingang.imr
  5. TITLE,NW_GW_Auftragseingang.imr
  6. BEGIN SQL
  7. select c246 as c1,
  8. c470 as c2,
  9. c469 as c3,
  10. c468 as c4,
  11. c467 as c5,
  12. c466 as c6,
  13. c465 as c7,
  14. c464 as c8,
  15. c463 as c9,
  16. c462 as c10,
  17. c461 as c11,
  18. c460 as c12,
  19. c459 as c13,
  20. c458 as c14,
  21. c457 as c15,
  22. c456 as c16,
  23. c455 as c17,
  24. c454 as c18,
  25. c453 as c19,
  26. c452 as c20,
  27. c451 as c21,
  28. c450 as c22,
  29. c449 as c23,
  30. c448 as c24,
  31. c447 as c25,
  32. c446 as c26,
  33. c445 as c27,
  34. c444 as c28,
  35. c253 as c29,
  36. c443 as c30,
  37. c442 as c31,
  38. c441 as c32,
  39. c440 as c33,
  40. c255 as c34,
  41. c439 as c35,
  42. c438 as c36,
  43. c437 as c37,
  44. c257 as c38,
  45. c436 as c39,
  46. c250 as c40,
  47. c435 as c41,
  48. c256 as c42,
  49. c434 as c43,
  50. c433 as c44,
  51. c432 as c45,
  52. c431 as c46,
  53. c430 as c47,
  54. c429 as c48,
  55. c428 as c49,
  56. c427 as c50,
  57. c426 as c51,
  58. c425 as c52,
  59. c424 as c53,
  60. c423 as c54,
  61. c422 as c55,
  62. c421 as c56,
  63. c420 as c57,
  64. c419 as c58,
  65. c418 as c59,
  66. c417 as c60,
  67. c416 as c61,
  68. c415 as c62,
  69. c414 as c63,
  70. c413 as c64,
  71. c412 as c65,
  72. c411 as c66,
  73. c410 as c67,
  74. c409 as c68,
  75. c260 as c69,
  76. c408 as c70,
  77. c407 as c71,
  78. c406 as c72,
  79. c405 as c73,
  80. c404 as c74,
  81. c403 as c75,
  82. c402 as c76,
  83. c401 as c77,
  84. c400 as c78,
  85. c399 as c79,
  86. c398 as c80,
  87. c397 as c81,
  88. c396 as c82,
  89. c395 as c83,
  90. c394 as c84,
  91. c393 as c85,
  92. c392 as c86,
  93. c391 as c87,
  94. c390 as c88,
  95. c389 as c89,
  96. c388 as c90,
  97. c387 as c91,
  98. c386 as c92,
  99. c385 as c93,
  100. c384 as c94,
  101. c383 as c95,
  102. c382 as c96,
  103. c381 as c97,
  104. c380 as c98,
  105. c379 as c99,
  106. c378 as c100,
  107. c377 as c101,
  108. c376 as c102,
  109. c375 as c103,
  110. c374 as c104,
  111. c373 as c105,
  112. c372 as c106,
  113. c371 as c107,
  114. c370 as c108,
  115. c369 as c109,
  116. c368 as c110,
  117. c367 as c111,
  118. c366 as c112,
  119. c365 as c113,
  120. c364 as c114,
  121. c363 as c115,
  122. c272 as c116,
  123. c362 as c117,
  124. c361 as c118,
  125. c360 as c119,
  126. c359 as c120,
  127. c358 as c121,
  128. c357 as c122,
  129. c356 as c123,
  130. c355 as c124,
  131. c354 as c125,
  132. c353 as c126,
  133. c273 as c127,
  134. c352 as c128,
  135. c351 as c129,
  136. c350 as c130,
  137. c349 as c131,
  138. c348 as c132,
  139. c347 as c133,
  140. c346 as c134,
  141. c345 as c135,
  142. c344 as c136,
  143. c343 as c137,
  144. c342 as c138,
  145. c341 as c139,
  146. c340 as c140,
  147. c339 as c141,
  148. c338 as c142,
  149. c337 as c143,
  150. c336 as c144,
  151. c335 as c145,
  152. c334 as c146,
  153. c333 as c147,
  154. c332 as c148,
  155. c331 as c149,
  156. c330 as c150,
  157. c329 as c151,
  158. c328 as c152,
  159. c327 as c153,
  160. c326 as c154,
  161. c325 as c155,
  162. c324 as c156,
  163. c323 as c157,
  164. c322 as c158,
  165. c321 as c159,
  166. c320 as c160,
  167. c319 as c161,
  168. c318 as c162,
  169. c317 as c163,
  170. c316 as c164,
  171. c315 as c165,
  172. c314 as c166,
  173. c313 as c167,
  174. c312 as c168,
  175. c311 as c169,
  176. c310 as c170,
  177. c309 as c171,
  178. c308 as c172,
  179. c307 as c173,
  180. c306 as c174,
  181. c305 as c175,
  182. c304 as c176,
  183. c303 as c177,
  184. c302 as c178,
  185. c301 as c179,
  186. c300 as c180,
  187. c299 as c181,
  188. c298 as c182,
  189. c297 as c183,
  190. c296 as c184,
  191. c295 as c185,
  192. c294 as c186,
  193. c293 as c187,
  194. c292 as c188,
  195. c291 as c189,
  196. c290 as c190,
  197. c289 as c191,
  198. c288 as c192,
  199. c287 as c193,
  200. c274 as c194,
  201. c286 as c195,
  202. c285 as c196,
  203. c284 as c197,
  204. c283 as c198,
  205. c282 as c199,
  206. c281 as c200,
  207. c280 as c201,
  208. c279 as c202,
  209. '1' as c203,
  210. c278 as c204,
  211. c277 as c205,
  212. c276 as c206,
  213. c275 as c207,
  214. c268 as c208,
  215. c274 as c209,
  216. c273 as c210,
  217. c272 as c211,
  218. c271 as c212,
  219. c251 as c213,
  220. c270 as c214,
  221. c269 as c215,
  222. c268 as c216,
  223. c267 as c217,
  224. 1 / (XCOUNT(c272 for c246)) as c218,
  225. c266 as c219,
  226. c265 as c220,
  227. c264 as c221,
  228. c263 as c222,
  229. c262 as c223,
  230. c261 as c224,
  231. c260 as c225,
  232. c259 as c226,
  233. c258 as c227,
  234. c258 as c228,
  235. c257 as c229,
  236. c256 as c230,
  237. c255 as c231,
  238. c254 as c232,
  239. c253 as c233,
  240. c252 as c234,
  241. c252 as c235,
  242. c251 as c236,
  243. c250 as c237,
  244. c249 as c238,
  245. '' as c239,
  246. c248 as c240,
  247. XCOUNT(c272 for c246) as c241,
  248. c247 as c242
  249. from
  250. (select T1."UNIT_NUMBER" as c246,
  251. (database()) as c247,
  252. CASE WHEN (T1."ECC_STATUS" IN ('64')) THEN ('fakturiert') ELSE ('Auftragsbestand') END as c248,
  253. T10."FLEET_OWNER" || ' - ' || T11."SPECIFY" as c249,
  254. T1."OWNER" as c250,
  255. (T1."UNIT_NUMBER" || ' - ' || T3."CHASSIS_NUMBER") as c251,
  256. T9."SEL_NAME" as c252,
  257. T1."SALE_SALESMAN" as c253,
  258. CASE WHEN (T7."DESCRIPTION" IN ('Chevrolet','Chevrolet US Car','Opel')) THEN (T7."DESCRIPTION") ELSE ('Fremdfabrikat') END as c254,
  259. T1."BUD_SALE_DET" as c255,
  260. T1."COST_UNIT" as c256,
  261. T1."BUD_COST" as c257,
  262. T8."SEL_NAME" as c258,
  263. T8."SELLER_CODE" as c259,
  264. (T1."LOCATION_CODE") as c260,
  265. (CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) * 15 as c261,
  266. CASE WHEN (T3."CAR_LETTER" = 'Konsi') THEN ('Konsi-FZG') ELSE ('Lagerfahrzeug') END as c262,
  267. T3."CAR_LETTER" as c263,
  268. CASE WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 0 AND 30) THEN ('0 - 30 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 31 AND 60) THEN ('31 - 60 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 61 AND 90) THEN ('61 - 90 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) BETWEEN 91 AND 180) THEN ('91 - 180 Tage') WHEN ((CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END) > 180) THEN ('> 180 Tage') ELSE null END as c264,
  269. CASE WHEN (T1."ECC_STATUS" IN ('21','24')) THEN (0) WHEN (T1."RECEPTION_DATE" IS NULL) THEN ((extract(DAY FROM ((now())) - T1."PURCH_DATE"))) ELSE ((extract(DAY FROM ((now())) - T1."RECEPTION_DATE"))) END as c265,
  270. (now()) as c266,
  271. T1."PURCH_PRICE_UNIT" + T1."COST_UNIT" as c267,
  272. T7."DESCRIPTION" as c268,
  273. T7."GLOBAL_MAKE_CD" as c269,
  274. CASE WHEN (T2."VEHICLE_TYPE" IS NULL) THEN (T1."VEHICLE_TYPE") ELSE (T2."VEHICLE_TYPE" || ' - ' || T2."VEHICLE_TYPE_TEXT") END as c270,
  275. T3."COLOUR_CODE" || ' - ' || T3."COLOUR_CF" as c271,
  276. T3."CHASSIS_NUMBER" as c272,
  277. T3."MODEL_TEXT" as c273,
  278. T4."MOD_LIN_SPECIFY" as c274,
  279. CASE WHEN (T2."VEHICLE_TYPE" IN ('K','M','N','T','V')) THEN ('Neuwagen') WHEN (T2."VEHICLE_TYPE" IN ('D','G','R')) THEN ('Gebrauchtwagen') ELSE null END as c275,
  280. T6."DESCRIPTION" as c276,
  281. T6."DEPARTMENT_TYPE_ID" as c277,
  282. CASE WHEN (T1."SALES_DEPARTMENT" IN (' ')) THEN ('01') ELSE ((od_left(T1."SALES_DEPARTMENT",2))) END as c278,
  283. T5."MAKE_CODE" as c279,
  284. T5."MODEL_GROUP" as c280,
  285. T5."MODEL_TYPE" as c281,
  286. T5."ORIG_MODEL_CODE" as c282,
  287. T5."MODEL_TEXT" as c283,
  288. T5."MAKE_CD" as c284,
  289. T5."WORKSHOP_MODEL" as c285,
  290. T4."MAKE_CD" as c286,
  291. T4."MODEL_LINE" as c287,
  292. T3."MAKE_CD" as c288,
  293. T3."SOLDMARK_DATE" as c289,
  294. T3."DISCOUNT_PERC_WORK" as c290,
  295. T3."WORKSHOP_PRICECODE" as c291,
  296. T3."HOURLY_REPAIR_RATE" as c292,
  297. T3."SERVICE_DAYS" as c293,
  298. T3."FUELTYPE" as c294,
  299. T3."DEALER_MARKING" as c295,
  300. T3."DEALER_NUMBER" as c296,
  301. T3."PURCH_AMOUNT" as c297,
  302. T3."LATEST_INV_DATE" as c298,
  303. T3."PAID_DATE" as c299,
  304. T3."HOUR_RATE_TABLE" as c300,
  305. T3."MAKE" as c301,
  306. T3."MODEL_TYPE_2" as c302,
  307. T3."MODEL_LINE_GROUP" as c303,
  308. T3."PURCH_CAL_DATE" as c304,
  309. T3."STOCK_DATE" as c305,
  310. T3."CAL_COST_DATE" as c306,
  311. T3."CAL_COST" as c307,
  312. T3."AVAILABLE" as c308,
  313. T3."TYPE_YEAR" as c309,
  314. T3."ASU_INSP" as c310,
  315. T3."ASU_DATE" as c311,
  316. T3."ASU_TYPE" as c312,
  317. T3."TUV_INSP" as c313,
  318. T3."TUV_DATE" as c314,
  319. T3."TUV_TYPE" as c315,
  320. T3."NO_OF_OWNERS" as c316,
  321. T3."TRIM_CODE" as c317,
  322. T3."COLOUR_CODE" as c318,
  323. T3."DRIVE_CODE" as c319,
  324. T3."GEAR_CODE" as c320,
  325. T3."MOTOR_CODE" as c321,
  326. T3."MISC_10_CF" as c322,
  327. T3."MISC_9_CF" as c323,
  328. T3."MISC_8_CF" as c324,
  329. T3."MISC_7_CF" as c325,
  330. T3."MISC_6_CF" as c326,
  331. T3."MISC_5_CF" as c327,
  332. T3."MISC_4_CF" as c328,
  333. T3."MISC_3_CF" as c329,
  334. T3."MISC_2_CF" as c330,
  335. T3."MISC_1_CF" as c331,
  336. T3."MILEAGE" as c332,
  337. T3."EQUIPMENT_4" as c333,
  338. T3."EQUIPMENT_3" as c334,
  339. T3."EQUIPMENT_2" as c335,
  340. T3."EQUIPMENT_1" as c336,
  341. T3."DECLARATION_NUMBER" as c337,
  342. T3."DECLARATION_PLACE" as c338,
  343. T3."DECLARATION_DATE" as c339,
  344. T3."SEATS" as c340,
  345. T3."CYLINDER_VOLUME" as c341,
  346. T3."YEAR_MODEL_CF" as c342,
  347. T3."KEY_CODE" as c343,
  348. T3."MOTOR_NUMBER" as c344,
  349. T3."CLASSIFICATION" as c345,
  350. T3."FAC_MODEL_CODE_S" as c346,
  351. T3."WORKSHOP_MODEL" as c347,
  352. T3."MODEL_LINE" as c348,
  353. T3."TRIM_TXT" as c349,
  354. T3."COLOUR_CF" as c350,
  355. T3."ORIG_MODEL_CODE2" as c351,
  356. T3."ORIG_MODEL_CODE1" as c352,
  357. T3."SALESMAN_SALE" as c353,
  358. T3."SALESMAN_BUY" as c354,
  359. T3."ARRIVAL_DATE" as c355,
  360. T3."EXPECTED_ARR_DATE" as c356,
  361. T3."FIRST_OCCUR_DATE" as c357,
  362. T3."LATEST_REG_DATE" as c358,
  363. T3."FIRST_REG_DATE" as c359,
  364. T3."FAC_MODEL_CODE_L" as c360,
  365. T3."CAR_STATUS" as c361,
  366. T3."CAR_GROUP" as c362,
  367. T3."REGISTER_NUMBER" as c363,
  368. T3."HANDLER" as c364,
  369. T3."TRANSACT_DATE" as c365,
  370. T3."BASIS_NUMBER" as c366,
  371. CASE WHEN (T1."ECC_STATUS" = '21') THEN ('21 - Lagerauftrag') WHEN (T1."ECC_STATUS" = '24') THEN ('24 - Kundenauftrag') WHEN (T1."ECC_STATUS" = '41') THEN ('41 - Bestand') WHEN (T1."ECC_STATUS" = '44') THEN ('44 - auf Lager verkauft') WHEN (T1."ECC_STATUS" = '64') THEN ('64 - verkauft') WHEN (T1."ECC_STATUS" = '42') THEN ('42') WHEN (T1."ECC_STATUS" = '25') THEN ('25 - Kundenauftrag') ELSE null END as c367,
  372. T2."VEHICLE_TYPE_TEXT" as c368,
  373. T2."VEHICLE_TYPE" as c369,
  374. T1."UNIQUE_IDENT" as c370,
  375. T1."PRICE_LIST_DATE" as c371,
  376. T1."PRICE_LIST_VERSION" as c372,
  377. T1."PURCH_ORIGIN_CODE" as c373,
  378. T1."SALE_PRICE_DATE" as c374,
  379. T1."BUD_OPT_PRICE" as c375,
  380. T1."RECEPTION_DATE" as c376,
  381. T1."EST_REFERENCE_NO" as c377,
  382. T1."EST_SALES_PRICE" as c378,
  383. T1."FORD_INT_DATE" as c379,
  384. T1."VALUATION_DATE" as c380,
  385. T1."DESIRED_DELIV_DATE" as c381,
  386. T1."BOOKING_DEALER_NR" as c382,
  387. T1."DEALER_MARKING" as c383,
  388. T1."EXP_ARRIVAL_TIME" as c384,
  389. T1."CONTRACT_DATE" as c385,
  390. T1."CNTRACT_DUE_DATE" as c386,
  391. T1."TRANSFER_VAT_RC" as c387,
  392. T1."VAT_RATE_CODE" as c388,
  393. T1."VAT_TABLE_NORMAL" as c389,
  394. T1."VAT_TABLE_WORK" as c390,
  395. T1."PRICE_LABEL_DATE" as c391,
  396. T1."ORDER_CONFIRM_DATE" as c392,
  397. T1."ORDER_ARRIVAL_DATE" as c393,
  398. T1."TRF_DEPARTMENT" as c394,
  399. T1."UNIT_SOLD" as c395,
  400. T1."SALE_ORDER_NO" as c396,
  401. T1."TRF_TAXBASIS_PURCH" as c397,
  402. T1."TRF_TAXBASIS_SALES" as c398,
  403. T1."FREIGHT_BALANCE" as c399,
  404. T1."RESERVATION_TEXT" as c400,
  405. T1."RESERVATION_PERSON" as c401,
  406. T1."RESERVATION_DATE" as c402,
  407. T1."DELIVERY_DATE_VEH" as c403,
  408. T1."COMMISION_NO" as c404,
  409. T1."RECALC_CODE" as c405,
  410. T1."BUDG_PRICE_VAT" as c406,
  411. T1."ACCOUNT_SALES" as c407,
  412. T1."ACCOUNT_PURCHASE" as c408,
  413. T1."INVOICE_PERMISSION" as c409,
  414. T1."LATEST_UPDATE" as c410,
  415. T1."VEHICLE_UPDATE" as c411,
  416. T1."PA_NUMBER" as c412,
  417. T1."BUYING_ORDER_DATE" as c413,
  418. T1."BUYING_ORDER_NO" as c414,
  419. T1."CONDITION_UNIT" as c415,
  420. T1."TRANSFER_BBDB" as c416,
  421. T1."DELETE_PROPOSAL" as c417,
  422. T1."STOCK_DAYS" as c418,
  423. T1."TRANSFER_DATE" as c419,
  424. T1."OR_MARK" as c420,
  425. T1."COST_TAX" as c421,
  426. T1."PURCH_TAX" as c422,
  427. T1."TRANSFER_SOLD" as c423,
  428. T1."TRANSFER_TAX_PCT" as c424,
  429. T1."TRANSFER_TAX_BASIS" as c425,
  430. T1."TRANSFER_ACC_CODE" as c426,
  431. T1."TRANSFER_TAX_HAND" as c427,
  432. T1."TRANSFER_LINE" as c428,
  433. T1."NEXT_LINE_1" as c429,
  434. T1."NEXT_LINE_UNIT" as c430,
  435. T1."INTEREST_2" as c431,
  436. T1."INTEREST_1" as c432,
  437. T1."REG_FEE" as c433,
  438. T1."SALES_PRICE_UNIT" as c434,
  439. T1."PURCH_PRICE_UNIT" as c435,
  440. T1."PREV_OWNER" as c436,
  441. T1."BUD_DEDUCT_FEE" as c437,
  442. T1."BUD_REG_FEE" as c438,
  443. T1."BUD_PURCH_PRICE" as c439,
  444. T1."UNIT_IN_CHANGE" as c440,
  445. T1."SCRAP_CODE" as c441,
  446. T1."SALE_DATE" as c442,
  447. T1."SALE_INV_NUMBER" as c443,
  448. T1."SALES_DEPARTMENT" as c444,
  449. T1."PURCH_DATE" as c445,
  450. T1."PURCH_INVNO" as c446,
  451. T1."PURCH_SALSMAN_CODE" as c447,
  452. T1."PURCH_DEPARTMENT" as c448,
  453. T1."MILEAGE" as c449,
  454. T1."INTEREST_CODE" as c450,
  455. T1."TAX_HANDLING" as c451,
  456. T1."BOOK_KEEPING_CODE" as c452,
  457. T1."TRANSFER_TAX" as c453,
  458. T1."DEPRECIATION" as c454,
  459. T1."UNIT_LAST_UPD_DTE" as c455,
  460. T1."TAX_CODE" as c456,
  461. T1."INTERNAL_CODE" as c457,
  462. T1."DISCOUNT_LIMIT" as c458,
  463. T1."DISCOUNT_PERC_WORK" as c459,
  464. T1."PRICE_CODE" as c460,
  465. T1."DELIVERY_STOP_CODE" as c461,
  466. T1."SMALL_INV_CHARGE" as c462,
  467. T1."SMALL_ACCESSORIES" as c463,
  468. T1."PMT_TERM" as c464,
  469. T1."CAR_CREATION_DATE" as c465,
  470. T1."HANDLER" as c466,
  471. T1."TRANSACT_DATE" as c467,
  472. T1."VEHICLE_TYPE" as c468,
  473. T1."ECC_STATUS" as c469,
  474. T1."BASIS_NUMBER" as c470
  475. from (((((((("deop01"."dbo"."UNIT_FILE" T1 left outer join "deop01"."dbo"."vPP5R" T2 on T1."VEHICLE_TYPE" = T2."VEHICLE_TYPE") left outer join "deop01"."dbo"."VEHICLE" T3 on T1."BASIS_NUMBER" = T3."BASIS_NUMBER") left outer join "deop01"."dbo"."vPP5Q" T4 on (T3."MODEL_LINE" = T4."MODEL_LINE") and (T3."MAKE_CD" = T4."MAKE_CD")) left outer join "deop01"."dbo"."vPP74" T5 on (T3."WORKSHOP_MODEL" = T5."WORKSHOP_MODEL") and (T3."MAKE_CD" = T5."MAKE_CD")) left outer join "deop01"."dbo"."DEPARTMENT_TYPE" T6 on T1."PURCH_DEPARTMENT" = T6."DEPARTMENT_TYPE_ID") left outer join "deop01"."dbo"."GLOBAL_MAKE" T7 on T3."MAKE_CD" = T7."GLOBAL_MAKE_CD") left outer join "deop01"."dbo"."vPP43" T8 on T1."PURCH_SALSMAN_CODE" = T8."SELLER_CODE") left outer join "deop01"."dbo"."vPP43" T9 on T9."SELLER_CODE" = T1."SALE_SALESMAN"),
  476. (("deop01"."dbo"."VEH_ORDER_HEADER" T10 left outer join "deop01"."dbo"."VEH_ORDER_LINE" T12 on T10."ORDER_NUMBER" = T12."ORDER_NUMBER") left outer join "deop01"."dbo"."vPP4K" T11 on T10."FLEET_OWNER" = T11."FLEET_OWNER_CODE")
  477. where (T12."UNIT_NUMBER" = T1."UNIT_NUMBER")
  478. and (T1."ECC_STATUS" IN ('25','44','64','24'))
  479. order by c246 asc,c265 desc
  480. ) D1
  481. END SQL
  482. COLUMN,0,Unit Number
  483. COLUMN,1,Basis Number
  484. COLUMN,2,Ecc Status
  485. COLUMN,3,Vehicle Type
  486. COLUMN,4,Transact Date
  487. COLUMN,5,Handler
  488. COLUMN,6,Car Creation Date
  489. COLUMN,7,Pmt Term
  490. COLUMN,8,Small Accessories
  491. COLUMN,9,Small Inv Charge
  492. COLUMN,10,Delivery Stop Code
  493. COLUMN,11,Price Code
  494. COLUMN,12,Discount Perc Work
  495. COLUMN,13,Discount Limit
  496. COLUMN,14,Internal Code
  497. COLUMN,15,Tax Code
  498. COLUMN,16,Unit Last Upd Dte
  499. COLUMN,17,Depreciation
  500. COLUMN,18,Transfer Tax
  501. COLUMN,19,Book Keeping Code
  502. COLUMN,20,Tax Handling
  503. COLUMN,21,Interest Code
  504. COLUMN,22,Mileage
  505. COLUMN,23,Purch Department
  506. COLUMN,24,Purch Salsman Code
  507. COLUMN,25,Purch Invno
  508. COLUMN,26,Purch Date
  509. COLUMN,27,Sales Department
  510. COLUMN,28,Sale Salesman
  511. COLUMN,29,Sale Inv Number
  512. COLUMN,30,Sale Date
  513. COLUMN,31,Scrap Code
  514. COLUMN,32,Unit In Change
  515. COLUMN,33,Bud Sale Det
  516. COLUMN,34,Bud Purch Price
  517. COLUMN,35,Bud Reg Fee
  518. COLUMN,36,Bud Deduct Fee
  519. COLUMN,37,Bud Cost
  520. COLUMN,38,Prev Owner
  521. COLUMN,39,Owner
  522. COLUMN,40,Purch Price Unit
  523. COLUMN,41,Cost Unit
  524. COLUMN,42,Sales Price Unit
  525. COLUMN,43,Reg Fee
  526. COLUMN,44,Interest 1
  527. COLUMN,45,Interest 2
  528. COLUMN,46,Next Line Unit
  529. COLUMN,47,Next Line 1
  530. COLUMN,48,Transfer Line
  531. COLUMN,49,Transfer Tax Hand
  532. COLUMN,50,Transfer Acc Code
  533. COLUMN,51,Transfer Tax Basis
  534. COLUMN,52,Transfer Tax Pct
  535. COLUMN,53,Transfer Sold
  536. COLUMN,54,Purch Tax
  537. COLUMN,55,Cost Tax
  538. COLUMN,56,Or Mark
  539. COLUMN,57,Transfer Date
  540. COLUMN,58,Stock Days
  541. COLUMN,59,Delete Proposal
  542. COLUMN,60,Transfer Bbdb
  543. COLUMN,61,Condition Unit
  544. COLUMN,62,Buying Order No
  545. COLUMN,63,Buying Order Date
  546. COLUMN,64,Pa Number
  547. COLUMN,65,Vehicle Update
  548. COLUMN,66,Latest Update
  549. COLUMN,67,Invoice Permission
  550. COLUMN,68,Location Code
  551. COLUMN,69,Account Purchase
  552. COLUMN,70,Account Sales
  553. COLUMN,71,Budg Price Vat
  554. COLUMN,72,Recalc Code
  555. COLUMN,73,Commision No
  556. COLUMN,74,Delivery Date Veh
  557. COLUMN,75,Reservation Date
  558. COLUMN,76,Reservation Person
  559. COLUMN,77,Reservation Text
  560. COLUMN,78,Freight Balance
  561. COLUMN,79,Trf Taxbasis Sales
  562. COLUMN,80,Trf Taxbasis Purch
  563. COLUMN,81,Sale Order No
  564. COLUMN,82,Unit Sold
  565. COLUMN,83,Trf Department
  566. COLUMN,84,Order Arrival Date
  567. COLUMN,85,Order Confirm Date
  568. COLUMN,86,Price Label Date
  569. COLUMN,87,Vat Table Work
  570. COLUMN,88,Vat Table Normal
  571. COLUMN,89,Vat Rate Code
  572. COLUMN,90,Transfer Vat Rc
  573. COLUMN,91,Cntract Due Date
  574. COLUMN,92,Contract Date
  575. COLUMN,93,Exp Arrival Time
  576. COLUMN,94,Dealer Marking
  577. COLUMN,95,Booking Dealer Nr
  578. COLUMN,96,Desired Deliv Date
  579. COLUMN,97,Valuation Date
  580. COLUMN,98,Ford Int Date
  581. COLUMN,99,Est Sales Price
  582. COLUMN,100,Est Reference No
  583. COLUMN,101,Reception Date
  584. COLUMN,102,Bud Opt Price
  585. COLUMN,103,Sale Price Date
  586. COLUMN,104,Purch Origin Code
  587. COLUMN,105,Price List Version
  588. COLUMN,106,Price List Date
  589. COLUMN,107,Unique Ident
  590. COLUMN,108,Vehicle Type_vppr5
  591. COLUMN,109,Vehicle Type Text
  592. COLUMN,110,ECC_Status_Text
  593. COLUMN,111,Basis Number
  594. COLUMN,112,Transact Date
  595. COLUMN,113,Handler
  596. COLUMN,114,Register Number
  597. COLUMN,115,Chassis Number
  598. COLUMN,116,Car Group
  599. COLUMN,117,Car Status
  600. COLUMN,118,Fac Model Code L
  601. COLUMN,119,First Reg Date
  602. COLUMN,120,Latest Reg Date
  603. COLUMN,121,First Occur Date
  604. COLUMN,122,Expected Arr Date
  605. COLUMN,123,Arrival Date
  606. COLUMN,124,Salesman Buy
  607. COLUMN,125,Salesman Sale
  608. COLUMN,126,Model Text
  609. COLUMN,127,Orig Model Code1
  610. COLUMN,128,Orig Model Code2
  611. COLUMN,129,Colour Cf
  612. COLUMN,130,Trim Txt
  613. COLUMN,131,Model Line
  614. COLUMN,132,Workshop Model
  615. COLUMN,133,Fac Model Code S
  616. COLUMN,134,Classification
  617. COLUMN,135,Motor Number
  618. COLUMN,136,Key Code
  619. COLUMN,137,Year Model Cf
  620. COLUMN,138,Cylinder Volume
  621. COLUMN,139,Seats
  622. COLUMN,140,Declaration Date
  623. COLUMN,141,Declaration Place
  624. COLUMN,142,Declaration Number
  625. COLUMN,143,Equipment 1
  626. COLUMN,144,Equipment 2
  627. COLUMN,145,Equipment 3
  628. COLUMN,146,Equipment 4
  629. COLUMN,147,Mileage
  630. COLUMN,148,Misc 1 Cf
  631. COLUMN,149,Misc 2 Cf
  632. COLUMN,150,Misc 3 Cf
  633. COLUMN,151,Misc 4 Cf
  634. COLUMN,152,Misc 5 Cf
  635. COLUMN,153,Misc 6 Cf
  636. COLUMN,154,Misc 7 Cf
  637. COLUMN,155,Misc 8 Cf
  638. COLUMN,156,Misc 9 Cf
  639. COLUMN,157,Misc 10 Cf
  640. COLUMN,158,Motor Code
  641. COLUMN,159,Gear Code
  642. COLUMN,160,Drive Code
  643. COLUMN,161,Colour Code
  644. COLUMN,162,Trim Code
  645. COLUMN,163,No Of Owners
  646. COLUMN,164,Tuv Type
  647. COLUMN,165,Tuv Date
  648. COLUMN,166,Tuv Insp
  649. COLUMN,167,Asu Type
  650. COLUMN,168,Asu Date
  651. COLUMN,169,Asu Insp
  652. COLUMN,170,Type Year
  653. COLUMN,171,Available
  654. COLUMN,172,Cal Cost
  655. COLUMN,173,Cal Cost Date
  656. COLUMN,174,Stock Date
  657. COLUMN,175,Purch Cal Date
  658. COLUMN,176,Model Line Group
  659. COLUMN,177,Model Type 2
  660. COLUMN,178,Make
  661. COLUMN,179,Hour Rate Table
  662. COLUMN,180,Paid Date
  663. COLUMN,181,Latest Inv Date
  664. COLUMN,182,Purch Amount
  665. COLUMN,183,Dealer Number
  666. COLUMN,184,Dealer Marking
  667. COLUMN,185,Fueltype
  668. COLUMN,186,Service Days
  669. COLUMN,187,Hourly Repair Rate
  670. COLUMN,188,Workshop Pricecode
  671. COLUMN,189,Discount Perc Work
  672. COLUMN,190,Soldmark Date
  673. COLUMN,191,Make Cd
  674. COLUMN,192,Model Line
  675. COLUMN,193,Mod Lin Specify
  676. COLUMN,194,Make Cd
  677. COLUMN,195,Workshop Model
  678. COLUMN,196,Make Cd
  679. COLUMN,197,Model Text
  680. COLUMN,198,Orig Model Code
  681. COLUMN,199,Model Type
  682. COLUMN,200,Model Group
  683. COLUMN,201,Make Code
  684. COLUMN,202,Hauptbetrieb
  685. COLUMN,203,Standort
  686. COLUMN,204,Department Type Id
  687. COLUMN,205,Description
  688. COLUMN,206,Fahrzeugart
  689. COLUMN,207,Fabrikat_ori
  690. COLUMN,208,Model
  691. COLUMN,209,Modellbez
  692. COLUMN,210,Fahrgestellnr
  693. COLUMN,211,Farbe
  694. COLUMN,212,FZG
  695. COLUMN,213,Fahrzeugtyp
  696. COLUMN,214,Global Make Cd
  697. COLUMN,215,Description
  698. COLUMN,216,Einsatz
  699. COLUMN,217,Menge
  700. COLUMN,218,Heute
  701. COLUMN,219,Standtage
  702. COLUMN,220,Standtagestaffel
  703. COLUMN,221,Car Letter
  704. COLUMN,222,Fahrzeugart_Konsi
  705. COLUMN,223,kalk_Kosten
  706. COLUMN,224,Betrieb
  707. COLUMN,225,Seller Code
  708. COLUMN,226,Sel Name
  709. COLUMN,227,VB_Einkauf
  710. COLUMN,228,geplante Kosten
  711. COLUMN,229,tatsächl. Kosten
  712. COLUMN,230,geplanter VK
  713. COLUMN,231,Fabrikat
  714. COLUMN,232,Sale Salesman
  715. COLUMN,233,Sel Name_Verkauf
  716. COLUMN,234,Verkäufer
  717. COLUMN,235,FZG_1
  718. COLUMN,236,Kunde
  719. COLUMN,237,Kundenart
  720. COLUMN,238,Geschäftsart
  721. COLUMN,239,Status_1
  722. COLUMN,240,Anzahl Datensätze
  723. COLUMN,241,Mandant