Advertisement
bytecoded

Top Queries by Average Duration (Result)

Mar 20th, 2019
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.17 KB | None | 0 0
  1. 28609334.000 "SELECT TOP 25
  2. T80._IDRRef,
  3. T80._Marked,
  4. T80._Number,
  5. T80._Date_Time,
  6. T80._Posted,
  7. T80._Fld4621RRef,
  8. T80._Fld4622RRef,
  9. T80._Fld4625RRef,
  10. T80._Fld4633,
  11. T80._Fld4635RRef,
  12. T80._Fld4657RRef,
  13. CASE WHEN ((T80._Fld4657RRef = ?) AND T80._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T97.Fld10346Balance_ AS NUMERIC(33, 2)),0.0) > 0.0) THEN CASE WHEN (ISNULL(CAST(T81.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 4.0 WHEN ((ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T81.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T81.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 6.0 ELSE 5.0 END ELSE CASE WHEN (ISNULL(CAST(T81.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 0.0 WHEN ((ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T81.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T81.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 2.0 ELSE 1.0 END END ELSE 7.0 END,
  14. T102._Fld12313RRef,
  15. T80._Fld13369,
  16. CASE WHEN ((ISNULL(CAST(T103.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) > 0.0) THEN (ISNULL(CAST(T103.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T83.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) ELSE 0.0 END,
  17. T117._Fld1191
  18. FROM dbo._Document233 T80
  19. LEFT OUTER JOIN (SELECT
  20. T82._Fld11328RRef AS Fld11328RRef,
  21. CAST(SUM(T82._Fld11330) AS NUMERIC(33, 8)) AS Fld11330Turnover_
  22. FROM dbo._AccumRgTn11332 T82
  23. WHERE ((T82._Fld595 = ?)) AND ((T82._Fld11330 <> ?))
  24. GROUP BY T82._Fld11328RRef
  25. HAVING (CAST(SUM(T82._Fld11330) AS NUMERIC(33, 8))) <> 0.0) T81
  26. ON (T80._IDRRef = T81.Fld11328RRef)
  27. LEFT OUTER JOIN (SELECT
  28. T84._Fld10540_TYPE AS Fld10540_TYPE,
  29. T84._Fld10540_RTRef AS Fld10540_RTRef,
  30. T84._Fld10540_RRRef AS Fld10540_RRRef,
  31. CAST(SUM(T84._Fld10545) AS NUMERIC(33, 8)) AS Fld10545Balance_
  32. FROM dbo._AccumRgT10549 T84
  33. WHERE (((T84._Fld595 = ?)) AND (EXISTS(SELECT
  34. 1
  35. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  36. LEFT OUTER JOIN dbo._Reference42 T85
  37. ON ((T84._Fld10538RRef = T85._IDRRef)) AND (T85._Fld595 = ?)
  38. WHERE EXISTS(SELECT
  39. 0x01 AS Q_001_F_000_
  40. FROM dbo._Reference98 T86
  41. INNER JOIN dbo._Reference21 T87
  42. ON (((T86._Fld1685 = ?) AND EXISTS(SELECT
  43. 0x01 AS Q_008_F_000_
  44. FROM dbo._InfoRg11709 T88
  45. WHERE ((T88._Fld595 = ?)) AND ((T88._Fld12065RRef = T86._IDRRef) AND (T88._Fld12066RRef = T87._IDRRef)))) AND T87._IDRRef IN
  46. (SELECT
  47. T89._Reference21_IDRRef AS Q_009_F_000RRef
  48. FROM dbo._Reference21_VT782 T89
  49. INNER JOIN dbo._InfoRg9937 T90
  50. ON ((T90._Fld9939_TYPE = 0x08 AND T90._Fld9939_RTRef = 0x00000095 AND T90._Fld9939_RRRef = ?) AND (T90._Fld9938_TYPE = T89._Fld784_TYPE AND T90._Fld9938_RTRef = T89._Fld784_RTRef AND T90._Fld9938_RRRef = T89._Fld784_RRRef))
  51. WHERE ((T89._Fld595 = ?)) AND (T90._Fld595 = ?)))
  52. WHERE ((T87._Fld595 = ?)) AND (((((CASE WHEN T85._Fld1040RRef IS NULL THEN 0x01 ELSE CASE WHEN T85._Fld1040RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  53. 0x01 AS Q_002_F_000_
  54. FROM dbo._InfoRg11710 T91
  55. WHERE ((T91._Fld595 = ?)) AND ((T91._Fld12072RRef = T87._IDRRef) AND (T91._Fld12073_TYPE = CASE WHEN T85._Fld1040RRef IS NOT NULL THEN 0x08 END AND T91._Fld12073_RTRef = CASE WHEN T85._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND T91._Fld12073_RRRef = T85._Fld1040RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  56. 0x01 AS Q_003_F_000_
  57. FROM dbo._InfoRg11715 T92
  58. WHERE ((T92._Fld595 = ?)) AND ((T92._Fld12199RRef = T87._IDRRef) AND T92._Fld12200_TYPE = CASE WHEN T85._Fld1040RRef IS NOT NULL THEN 0x08 END AND T92._Fld12200_RTRef = CASE WHEN T85._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND (T92._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)) OR ((CASE WHEN T85._Fld12739RRef IS NULL THEN 0x01 ELSE CASE WHEN T85._Fld12739RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  59. 0x01 AS Q_004_F_000_
  60. FROM dbo._InfoRg11710 T93
  61. WHERE ((T93._Fld595 = ?)) AND ((T93._Fld12072RRef = T87._IDRRef) AND (T93._Fld12073_TYPE = CASE WHEN T85._Fld12739RRef IS NOT NULL THEN 0x08 END AND T93._Fld12073_RTRef = CASE WHEN T85._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND T93._Fld12073_RRRef = T85._Fld12739RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  62. 0x01 AS Q_005_F_000_
  63. FROM dbo._InfoRg11715 T94
  64. WHERE ((T94._Fld595 = ?)) AND ((T94._Fld12199RRef = T87._IDRRef) AND T94._Fld12200_TYPE = CASE WHEN T85._Fld12739RRef IS NOT NULL THEN 0x08 END AND T94._Fld12200_RTRef = CASE WHEN T85._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND (T94._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))) OR ((CASE WHEN T85._Fld12740RRef IS NULL THEN 0x01 ELSE CASE WHEN T85._Fld12740RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  65. 0x01 AS Q_006_F_000_
  66. FROM dbo._InfoRg11710 T95
  67. WHERE ((T95._Fld595 = ?)) AND ((T95._Fld12072RRef = T87._IDRRef) AND (T95._Fld12073_TYPE = CASE WHEN T85._Fld12740RRef IS NOT NULL THEN 0x08 END AND T95._Fld12073_RTRef = CASE WHEN T85._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND T95._Fld12073_RRRef = T85._Fld12740RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  68. 0x01 AS Q_007_F_000_
  69. FROM dbo._InfoRg11715 T96
  70. WHERE ((T96._Fld595 = ?)) AND ((T96._Fld12199RRef = T87._IDRRef) AND T96._Fld12200_TYPE = CASE WHEN T85._Fld12740RRef IS NOT NULL THEN 0x08 END AND T96._Fld12200_RTRef = CASE WHEN T85._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND (T96._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))))) AND (T84._Period = ? AND (T84._Fld10545 <> ?) AND (T84._Fld10545 <> ?))
  71. GROUP BY T84._Fld10540_TYPE,
  72. T84._Fld10540_RTRef,
  73. T84._Fld10540_RRRef
  74. HAVING (CAST(SUM(T84._Fld10545) AS NUMERIC(33, 8))) <> 0.0) T83
  75. ON (0x08 = T83.Fld10540_TYPE AND 0x000000E9 = T83.Fld10540_RTRef AND T80._IDRRef = T83.Fld10540_RRRef)
  76. LEFT OUTER JOIN (SELECT
  77. T98.Fld10344RRef AS Fld10344RRef,
  78. CAST(SUM(T98.Fld10346Balance_) AS NUMERIC(38, 8)) AS Fld10346Balance_
  79. FROM (SELECT
  80. T99._Fld10344RRef AS Fld10344RRef,
  81. CAST(SUM(T99._Fld10346) AS NUMERIC(33, 8)) AS Fld10346Balance_
  82. FROM dbo._AccumRgT10349 T99
  83. WHERE ((T99._Fld595 = ?)) AND (T99._Period = ? AND (T99._Fld10346 <> ?) AND (T99._Fld10346 <> ?))
  84. GROUP BY T99._Fld10344RRef
  85. HAVING (CAST(SUM(T99._Fld10346) AS NUMERIC(33, 8))) <> 0.0
  86. UNION ALL SELECT
  87. T100._Fld10344RRef AS Fld10344RRef,
  88. CAST(CAST(SUM(CASE WHEN T100._RecordKind = 0.0 THEN -T100._Fld10346 ELSE T100._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld10346Balance_
  89. FROM dbo._AccumRg10339 T100
  90. WHERE ((T100._Fld595 = ?)) AND (T100._Period >= ? AND T100._Period < ? AND T100._Active = 0x01)
  91. GROUP BY T100._Fld10344RRef
  92. HAVING (CAST(CAST(SUM(CASE WHEN T100._RecordKind = 0.0 THEN -T100._Fld10346 ELSE T100._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T98
  93. GROUP BY T98.Fld10344RRef
  94. HAVING (CAST(SUM(T98.Fld10346Balance_) AS NUMERIC(38, 8))) <> 0.0) T97
  95. ON (T80._IDRRef = T97.Fld10344RRef)
  96. LEFT OUTER JOIN dbo._InfoRg9134 T101
  97. ON ((0x08 = T101._Fld9136_TYPE AND 0x000000E9 = T101._Fld9136_RTRef AND T80._IDRRef = T101._Fld9136_RRRef)) AND (T101._Fld595 = ?)
  98. LEFT OUTER JOIN dbo._InfoRg11720 T102
  99. ON ((0x08 = T102._Fld12312_TYPE AND 0x000000E9 = T102._Fld12312_RTRef AND T80._IDRRef = T102._Fld12312_RRRef)) AND (T102._Fld595 = ?)
  100. LEFT OUTER JOIN (SELECT
  101. T104._Fld10332_TYPE AS Fld10332_TYPE,
  102. T104._Fld10332_RTRef AS Fld10332_RTRef,
  103. T104._Fld10332_RRRef AS Fld10332_RRRef,
  104. CAST(SUM(T104._Fld10335) AS NUMERIC(33, 8)) AS Fld10335Balance_
  105. FROM dbo._AccumRgT10337 T104
  106. WHERE (((T104._Fld595 = ?)) AND (EXISTS(SELECT
  107. 1
  108. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  109. LEFT OUTER JOIN dbo._Reference42 T105
  110. ON ((T104._Fld10330RRef = T105._IDRRef)) AND (T105._Fld595 = ?)
  111. WHERE EXISTS(SELECT
  112. 0x01 AS Q_001_F_000_
  113. FROM dbo._Reference98 T106
  114. INNER JOIN dbo._Reference21 T107
  115. ON (((T106._Fld1685 = ?) AND EXISTS(SELECT
  116. 0x01 AS Q_008_F_000_
  117. FROM dbo._InfoRg11709 T108
  118. WHERE ((T108._Fld595 = ?)) AND ((T108._Fld12065RRef = T106._IDRRef) AND (T108._Fld12066RRef = T107._IDRRef)))) AND T107._IDRRef IN
  119. (SELECT
  120. T109._Reference21_IDRRef AS Q_009_F_000RRef
  121. FROM dbo._Reference21_VT782 T109
  122. INNER JOIN dbo._InfoRg9937 T110
  123. ON ((T110._Fld9939_TYPE = 0x08 AND T110._Fld9939_RTRef = 0x00000095 AND T110._Fld9939_RRRef = ?) AND (T110._Fld9938_TYPE = T109._Fld784_TYPE AND T110._Fld9938_RTRef = T109._Fld784_RTRef AND T110._Fld9938_RRRef = T109._Fld784_RRRef))
  124. WHERE ((T109._Fld595 = ?)) AND (T110._Fld595 = ?)))
  125. WHERE ((T107._Fld595 = ?)) AND (((((CASE WHEN T105._Fld1040RRef IS NULL THEN 0x01 ELSE CASE WHEN T105._Fld1040RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  126. 0x01 AS Q_002_F_000_
  127. FROM dbo._InfoRg11710 T111
  128. WHERE ((T111._Fld595 = ?)) AND ((T111._Fld12072RRef = T107._IDRRef) AND (T111._Fld12073_TYPE = CASE WHEN T105._Fld1040RRef IS NOT NULL THEN 0x08 END AND T111._Fld12073_RTRef = CASE WHEN T105._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND T111._Fld12073_RRRef = T105._Fld1040RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  129. 0x01 AS Q_003_F_000_
  130. FROM dbo._InfoRg11715 T112
  131. WHERE ((T112._Fld595 = ?)) AND ((T112._Fld12199RRef = T107._IDRRef) AND T112._Fld12200_TYPE = CASE WHEN T105._Fld1040RRef IS NOT NULL THEN 0x08 END AND T112._Fld12200_RTRef = CASE WHEN T105._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND (T112._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)) OR ((CASE WHEN T105._Fld12739RRef IS NULL THEN 0x01 ELSE CASE WHEN T105._Fld12739RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  132. 0x01 AS Q_004_F_000_
  133. FROM dbo._InfoRg11710 T113
  134. WHERE ((T113._Fld595 = ?)) AND ((T113._Fld12072RRef = T107._IDRRef) AND (T113._Fld12073_TYPE = CASE WHEN T105._Fld12739RRef IS NOT NULL THEN 0x08 END AND T113._Fld12073_RTRef = CASE WHEN T105._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND T113._Fld12073_RRRef = T105._Fld12739RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  135. 0x01 AS Q_005_F_000_
  136. FROM dbo._InfoRg11715 T114
  137. WHERE ((T114._Fld595 = ?)) AND ((T114._Fld12199RRef = T107._IDRRef) AND T114._Fld12200_TYPE = CASE WHEN T105._Fld12739RRef IS NOT NULL THEN 0x08 END AND T114._Fld12200_RTRef = CASE WHEN T105._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND (T114._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))) OR ((CASE WHEN T105._Fld12740RRef IS NULL THEN 0x01 ELSE CASE WHEN T105._Fld12740RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  138. 0x01 AS Q_006_F_000_
  139. FROM dbo._InfoRg11710 T115
  140. WHERE ((T115._Fld595 = ?)) AND ((T115._Fld12072RRef = T107._IDRRef) AND (T115._Fld12073_TYPE = CASE WHEN T105._Fld12740RRef IS NOT NULL THEN 0x08 END AND T115._Fld12073_RTRef = CASE WHEN T105._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND T115._Fld12073_RRRef = T105._Fld12740RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  141. 0x01 AS Q_007_F_000_
  142. FROM dbo._InfoRg11715 T116
  143. WHERE ((T116._Fld595 = ?)) AND ((T116._Fld12199RRef = T107._IDRRef) AND T116._Fld12200_TYPE = CASE WHEN T105._Fld12740RRef IS NOT NULL THEN 0x08 END AND T116._Fld12200_RTRef = CASE WHEN T105._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND (T116._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))))) AND (T104._Period = ? AND (T104._Fld10335 <> ?) AND (T104._Fld10335 <> ?))
  144. GROUP BY T104._Fld10332_TYPE,
  145. T104._Fld10332_RTRef,
  146. T104._Fld10332_RRRef
  147. HAVING (CAST(SUM(T104._Fld10335) AS NUMERIC(33, 8))) <> 0.0) T103
  148. ON (0x08 = T103.Fld10332_TYPE AND 0x000000E9 = T103.Fld10332_RTRef AND T80._IDRRef = T103.Fld10332_RRRef)
  149. LEFT OUTER JOIN dbo._Reference51 T117
  150. ON (T80._Fld4635RRef = T117._IDRRef) AND (T117._Fld595 = ?)
  151. LEFT OUTER JOIN dbo._Reference28 T118
  152. ON (T80._Fld4621RRef = T118._IDRRef) AND (T118._Fld595 = ?)
  153. LEFT OUTER JOIN (SELECT
  154. T120._Folder AS Folder_,
  155. T120._Fld1040RRef AS Fld1040RRef,
  156. T120._Fld12739RRef AS Fld12739RRef,
  157. T120._IDRRef AS IDRRef,
  158. T120._Description COLLATE Latin1_General_CI_AS AS Description_,
  159. T120._Fld12740RRef AS Fld12740RRef,
  160. T120._Fld595 AS Fld595_
  161. FROM dbo._Reference42 T120
  162. WHERE ((((T120._Folder = 0x00) OR EXISTS(SELECT
  163. 0x01 AS Q_001_F_000_
  164. FROM dbo._Reference98 T121
  165. INNER JOIN dbo._Reference21 T122
  166. ON (((T121._Fld1685 = ?) AND EXISTS(SELECT
  167. 0x01 AS Q_008_F_000_
  168. FROM dbo._InfoRg11709 T123
  169. WHERE ((T123._Fld595 = ?)) AND ((T123._Fld12065RRef = T121._IDRRef) AND (T123._Fld12066RRef = T122._IDRRef)))) AND T122._IDRRef IN
  170. (SELECT
  171. T124._Reference21_IDRRef AS Q_009_F_000RRef
  172. FROM dbo._Reference21_VT782 T124
  173. INNER JOIN dbo._InfoRg9937 T125
  174. ON ((T125._Fld9939_TYPE = 0x08 AND T125._Fld9939_RTRef = 0x00000095 AND T125._Fld9939_RRRef = ?) AND (T125._Fld9938_TYPE = T124._Fld784_TYPE AND T125._Fld9938_RTRef = T124._Fld784_RTRef AND T125._Fld9938_RRRef = T124._Fld784_RRRef))
  175. WHERE ((T124._Fld595 = ?)) AND (T125._Fld595 = ?)))
  176. WHERE ((T122._Fld595 = ?)) AND (((((CASE WHEN T120._Fld1040RRef IS NULL THEN 0x01 ELSE CASE WHEN T120._Fld1040RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  177. 0x01 AS Q_002_F_000_
  178. FROM dbo._InfoRg11710 T126
  179. WHERE ((T126._Fld595 = ?)) AND ((T126._Fld12072RRef = T122._IDRRef) AND (T126._Fld12073_TYPE = CASE WHEN T120._Fld1040RRef IS NOT NULL THEN 0x08 END AND T126._Fld12073_RTRef = CASE WHEN T120._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND T126._Fld12073_RRRef = T120._Fld1040RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  180. 0x01 AS Q_003_F_000_
  181. FROM dbo._InfoRg11715 T127
  182. WHERE ((T127._Fld595 = ?)) AND ((T127._Fld12199RRef = T122._IDRRef) AND T127._Fld12200_TYPE = CASE WHEN T120._Fld1040RRef IS NOT NULL THEN 0x08 END AND T127._Fld12200_RTRef = CASE WHEN T120._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND (T127._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)) OR ((CASE WHEN T120._Fld12739RRef IS NULL THEN 0x01 ELSE CASE WHEN T120._Fld12739RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  183. 0x01 AS Q_004_F_000_
  184. FROM dbo._InfoRg11710 T128
  185. WHERE ((T128._Fld595 = ?)) AND ((T128._Fld12072RRef = T122._IDRRef) AND (T128._Fld12073_TYPE = CASE WHEN T120._Fld12739RRef IS NOT NULL THEN 0x08 END AND T128._Fld12073_RTRef = CASE WHEN T120._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND T128._Fld12073_RRRef = T120._Fld12739RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  186. 0x01 AS Q_005_F_000_
  187. FROM dbo._InfoRg11715 T129
  188. WHERE ((T129._Fld595 = ?)) AND ((T129._Fld12199RRef = T122._IDRRef) AND T129._Fld12200_TYPE = CASE WHEN T120._Fld12739RRef IS NOT NULL THEN 0x08 END AND T129._Fld12200_RTRef = CASE WHEN T120._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND (T129._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))) OR ((CASE WHEN T120._Fld12740RRef IS NULL THEN 0x01 ELSE CASE WHEN T120._Fld12740RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  189. 0x01 AS Q_006_F_000_
  190. FROM dbo._InfoRg11710 T130
  191. WHERE ((T130._Fld595 = ?)) AND ((T130._Fld12072RRef = T122._IDRRef) AND (T130._Fld12073_TYPE = CASE WHEN T120._Fld12740RRef IS NOT NULL THEN 0x08 END AND T130._Fld12073_RTRef = CASE WHEN T120._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND T130._Fld12073_RRRef = T120._Fld12740RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  192. 0x01 AS Q_007_F_000_
  193. FROM dbo._InfoRg11715 T131
  194. WHERE ((T131._Fld595 = ?)) AND ((T131._Fld12199RRef = T122._IDRRef) AND T131._Fld12200_TYPE = CASE WHEN T120._Fld12740RRef IS NOT NULL THEN 0x08 END AND T131._Fld12200_RTRef = CASE WHEN T120._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND (T131._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))))) AND (T120._Fld595 = ?)) T119
  195. ON T80._Fld4625RRef = T119.IDRRef
  196. LEFT OUTER JOIN (SELECT
  197. T133._Fld5085RRef AS Fld5085RRef,
  198. T133._IDRRef AS IDRRef,
  199. T133._Number COLLATE Latin1_General_CI_AS AS Number_,
  200. T133._Fld595 AS Fld595_
  201. FROM dbo._Document240 T133
  202. WHERE ((EXISTS(SELECT
  203. 1
  204. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  205. LEFT OUTER JOIN dbo._Reference42 T134
  206. ON ((T133._Fld5085RRef = T134._IDRRef)) AND (T134._Fld595 = ?)
  207. WHERE EXISTS(SELECT
  208. 0x01 AS Q_001_F_000_
  209. FROM dbo._Reference98 T135
  210. INNER JOIN dbo._Reference21 T136
  211. ON (((T135._Fld1685 = ?) AND EXISTS(SELECT
  212. 0x01 AS Q_008_F_000_
  213. FROM dbo._InfoRg11709 T137
  214. WHERE ((T137._Fld595 = ?)) AND ((T137._Fld12065RRef = T135._IDRRef) AND (T137._Fld12066RRef = T136._IDRRef)))) AND T136._IDRRef IN
  215. (SELECT
  216. T138._Reference21_IDRRef AS Q_009_F_000RRef
  217. FROM dbo._Reference21_VT782 T138
  218. INNER JOIN dbo._InfoRg9937 T139
  219. ON ((T139._Fld9939_TYPE = 0x08 AND T139._Fld9939_RTRef = 0x00000095 AND T139._Fld9939_RRRef = ?) AND (T139._Fld9938_TYPE = T138._Fld784_TYPE AND T139._Fld9938_RTRef = T138._Fld784_RTRef AND T139._Fld9938_RRRef = T138._Fld784_RRRef))
  220. WHERE ((T138._Fld595 = ?)) AND (T139._Fld595 = ?)))
  221. WHERE ((T136._Fld595 = ?)) AND (((((CASE WHEN T134._Fld1040RRef IS NULL THEN 0x01 ELSE CASE WHEN T134._Fld1040RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  222. 0x01 AS Q_002_F_000_
  223. FROM dbo._InfoRg11710 T140
  224. WHERE ((T140._Fld595 = ?)) AND ((T140._Fld12072RRef = T136._IDRRef) AND (T140._Fld12073_TYPE = CASE WHEN T134._Fld1040RRef IS NOT NULL THEN 0x08 END AND T140._Fld12073_RTRef = CASE WHEN T134._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND T140._Fld12073_RRRef = T134._Fld1040RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  225. 0x01 AS Q_003_F_000_
  226. FROM dbo._InfoRg11715 T141
  227. WHERE ((T141._Fld595 = ?)) AND ((T141._Fld12199RRef = T136._IDRRef) AND T141._Fld12200_TYPE = CASE WHEN T134._Fld1040RRef IS NOT NULL THEN 0x08 END AND T141._Fld12200_RTRef = CASE WHEN T134._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND (T141._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)) OR ((CASE WHEN T134._Fld12739RRef IS NULL THEN 0x01 ELSE CASE WHEN T134._Fld12739RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  228. 0x01 AS Q_004_F_000_
  229. FROM dbo._InfoRg11710 T142
  230. WHERE ((T142._Fld595 = ?)) AND ((T142._Fld12072RRef = T136._IDRRef) AND (T142._Fld12073_TYPE = CASE WHEN T134._Fld12739RRef IS NOT NULL THEN 0x08 END AND T142._Fld12073_RTRef = CASE WHEN T134._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND T142._Fld12073_RRRef = T134._Fld12739RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  231. 0x01 AS Q_005_F_000_
  232. FROM dbo._InfoRg11715 T143
  233. WHERE ((T143._Fld595 = ?)) AND ((T143._Fld12199RRef = T136._IDRRef) AND T143._Fld12200_TYPE = CASE WHEN T134._Fld12739RRef IS NOT NULL THEN 0x08 END AND T143._Fld12200_RTRef = CASE WHEN T134._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND (T143._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))) OR ((CASE WHEN T134._Fld12740RRef IS NULL THEN 0x01 ELSE CASE WHEN T134._Fld12740RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  234. 0x01 AS Q_006_F_000_
  235. FROM dbo._InfoRg11710 T144
  236. WHERE ((T144._Fld595 = ?)) AND ((T144._Fld12072RRef = T136._IDRRef) AND (T144._Fld12073_TYPE = CASE WHEN T134._Fld12740RRef IS NOT NULL THEN 0x08 END AND T144._Fld12073_RTRef = CASE WHEN T134._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND T144._Fld12073_RRRef = T134._Fld12740RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  237. 0x01 AS Q_007_F_000_
  238. FROM dbo._InfoRg11715 T145
  239. WHERE ((T145._Fld595 = ?)) AND ((T145._Fld12199RRef = T136._IDRRef) AND T145._Fld12200_TYPE = CASE WHEN T134._Fld12740RRef IS NOT NULL THEN 0x08 END AND T145._Fld12200_RTRef = CASE WHEN T134._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND (T145._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))))) AND (T133._Fld595 = ?)) T132
  240. ON T102._Fld12313RRef = T132.IDRRef
  241. WHERE (((T80._Fld595 = ?) AND (EXISTS(SELECT
  242. 1
  243. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  244. LEFT OUTER JOIN dbo._Reference42 T146
  245. ON ((T80._Fld4625RRef = T146._IDRRef)) AND (T146._Fld595 = ?)
  246. WHERE EXISTS(SELECT
  247. 0x01 AS Q_001_F_000_
  248. FROM dbo._Reference98 T147
  249. INNER JOIN dbo._Reference21 T148
  250. ON (((T147._Fld1685 = ?) AND EXISTS(SELECT
  251. 0x01 AS Q_008_F_000_
  252. FROM dbo._InfoRg11709 T149
  253. WHERE ((T149._Fld595 = ?)) AND ((T149._Fld12065RRef = T147._IDRRef) AND (T149._Fld12066RRef = T148._IDRRef)))) AND T148._IDRRef IN
  254. (SELECT
  255. T150._Reference21_IDRRef AS Q_009_F_000RRef
  256. FROM dbo._Reference21_VT782 T150
  257. INNER JOIN dbo._InfoRg9937 T151
  258. ON ((T151._Fld9939_TYPE = 0x08 AND T151._Fld9939_RTRef = 0x00000095 AND T151._Fld9939_RRRef = ?) AND (T151._Fld9938_TYPE = T150._Fld784_TYPE AND T151._Fld9938_RTRef = T150._Fld784_RTRef AND T151._Fld9938_RRRef = T150._Fld784_RRRef))
  259. WHERE ((T150._Fld595 = ?)) AND (T151._Fld595 = ?)))
  260. WHERE ((T148._Fld595 = ?)) AND (((((CASE WHEN T146._Fld1040RRef IS NULL THEN 0x01 ELSE CASE WHEN T146._Fld1040RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  261. 0x01 AS Q_002_F_000_
  262. FROM dbo._InfoRg11710 T152
  263. WHERE ((T152._Fld595 = ?)) AND ((T152._Fld12072RRef = T148._IDRRef) AND (T152._Fld12073_TYPE = CASE WHEN T146._Fld1040RRef IS NOT NULL THEN 0x08 END AND T152._Fld12073_RTRef = CASE WHEN T146._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND T152._Fld12073_RRRef = T146._Fld1040RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  264. 0x01 AS Q_003_F_000_
  265. FROM dbo._InfoRg11715 T153
  266. WHERE ((T153._Fld595 = ?)) AND ((T153._Fld12199RRef = T148._IDRRef) AND T153._Fld12200_TYPE = CASE WHEN T146._Fld1040RRef IS NOT NULL THEN 0x08 END AND T153._Fld12200_RTRef = CASE WHEN T146._Fld1040RRef IS NOT NULL THEN 0x00000040 END AND (T153._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)) OR ((CASE WHEN T146._Fld12739RRef IS NULL THEN 0x01 ELSE CASE WHEN T146._Fld12739RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  267. 0x01 AS Q_004_F_000_
  268. FROM dbo._InfoRg11710 T154
  269. WHERE ((T154._Fld595 = ?)) AND ((T154._Fld12072RRef = T148._IDRRef) AND (T154._Fld12073_TYPE = CASE WHEN T146._Fld12739RRef IS NOT NULL THEN 0x08 END AND T154._Fld12073_RTRef = CASE WHEN T146._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND T154._Fld12073_RRRef = T146._Fld12739RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  270. 0x01 AS Q_005_F_000_
  271. FROM dbo._InfoRg11715 T155
  272. WHERE ((T155._Fld595 = ?)) AND ((T155._Fld12199RRef = T148._IDRRef) AND T155._Fld12200_TYPE = CASE WHEN T146._Fld12739RRef IS NOT NULL THEN 0x08 END AND T155._Fld12200_RTRef = CASE WHEN T146._Fld12739RRef IS NOT NULL THEN 0x00000040 END AND (T155._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))) OR ((CASE WHEN T146._Fld12740RRef IS NULL THEN 0x01 ELSE CASE WHEN T146._Fld12740RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  273. 0x01 AS Q_006_F_000_
  274. FROM dbo._InfoRg11710 T156
  275. WHERE ((T156._Fld595 = ?)) AND ((T156._Fld12072RRef = T148._IDRRef) AND (T156._Fld12073_TYPE = CASE WHEN T146._Fld12740RRef IS NOT NULL THEN 0x08 END AND T156._Fld12073_RTRef = CASE WHEN T146._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND T156._Fld12073_RRRef = T146._Fld12740RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  276. 0x01 AS Q_007_F_000_
  277. FROM dbo._InfoRg11715 T157
  278. WHERE ((T157._Fld595 = ?)) AND ((T157._Fld12199RRef = T148._IDRRef) AND T157._Fld12200_TYPE = CASE WHEN T146._Fld12740RRef IS NOT NULL THEN 0x08 END AND T157._Fld12200_RTRef = CASE WHEN T146._Fld12740RRef IS NOT NULL THEN 0x00000040 END AND (T157._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))))) AND ((T80._IDRRef IN
  279. (SELECT
  280. T158._Q_000_F_000RRef AS INVALUELISTRRef
  281. FROM #tt T158 WITH(NOLOCK)
  282. WHERE T158._Q_000_F_000RRef IS NOT NULL) AND ((((T118._Description LIKE ? ESCAPE '/') OR (T119.Description_ LIKE ? ESCAPE '/')) OR (T117._Description LIKE ? ESCAPE '/')) OR (T80._Number LIKE ? ESCAPE '/'))) OR (T132.Number_ LIKE ? ESCAPE '/'))) AND T80._Date_Time < ?
  283. ORDER BY (T80._Date_Time) DESC, (T80._IDRRef) DESC
  284. OPTION (FAST 1)
  285. ",Context=DynamicList.GetData : Document.InventoryExpense.Form.ListForm.Attribute.List
  286.  
  287. 13203005.500 "SELECT TOP 25
  288. T1._IDRRef,
  289. T1._Marked,
  290. T1._Number,
  291. T1._Date_Time,
  292. T1._Posted,
  293. T1._Fld4621RRef,
  294. T1._Fld4622RRef,
  295. T1._Fld4625RRef,
  296. T1._Fld4633,
  297. T1._Fld4635RRef,
  298. T1._Fld4654RRef,
  299. T1._Fld4657RRef,
  300. CASE WHEN ((T1._Fld4657RRef = ?) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T14.Fld10346Balance_ AS NUMERIC(33, 2)),0.0) > 0.0) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 4.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 6.0 ELSE 5.0 END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 0.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 2.0 ELSE 1.0 END END ELSE 7.0 END,
  301. T19._Fld12313RRef,
  302. CASE WHEN ((ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) > 0.0) THEN (ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) ELSE 0.0 END,
  303. T30._Fld1191
  304. FROM dbo._Document233 T1
  305. LEFT OUTER JOIN (SELECT
  306. T3._Fld11328RRef AS Fld11328RRef,
  307. CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8)) AS Fld11330Turnover_
  308. FROM dbo._AccumRgTn11332 T3
  309. WHERE ((T3._Fld595 = ?)) AND ((T3._Fld11330 <> ?))
  310. GROUP BY T3._Fld11328RRef
  311. HAVING (CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8))) <> 0.0) T2
  312. ON (T1._IDRRef = T2.Fld11328RRef)
  313. LEFT OUTER JOIN (SELECT
  314. T5._Fld10540_TYPE AS Fld10540_TYPE,
  315. T5._Fld10540_RTRef AS Fld10540_RTRef,
  316. T5._Fld10540_RRRef AS Fld10540_RRRef,
  317. CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8)) AS Fld10545Balance_
  318. FROM dbo._AccumRgT10549 T5
  319. WHERE (((T5._Fld595 = ?)) AND (EXISTS(SELECT
  320. 1
  321. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  322. LEFT OUTER JOIN dbo._Reference42 T6
  323. ON ((T5._Fld10538RRef = T6._IDRRef)) AND (T6._Fld595 = ?)
  324. WHERE EXISTS(SELECT
  325. 0x01 AS Q_001_F_000_
  326. FROM dbo._Reference98 T7
  327. INNER JOIN dbo._Reference21 T8
  328. ON (((T7._Fld1685 = ?) AND EXISTS(SELECT
  329. 0x01 AS Q_004_F_000_
  330. FROM dbo._InfoRg11709 T9
  331. WHERE ((T9._Fld595 = ?)) AND ((T9._Fld12065RRef = T7._IDRRef) AND (T9._Fld12066RRef = T8._IDRRef)))) AND T8._IDRRef IN
  332. (SELECT
  333. T10._Reference21_IDRRef AS Q_005_F_000RRef
  334. FROM dbo._Reference21_VT782 T10
  335. INNER JOIN dbo._InfoRg9937 T11
  336. ON ((T11._Fld9939_TYPE = 0x08 AND T11._Fld9939_RTRef = 0x00000095 AND T11._Fld9939_RRRef = ?) AND (T11._Fld9938_TYPE = T10._Fld784_TYPE AND T11._Fld9938_RTRef = T10._Fld784_RTRef AND T11._Fld9938_RRRef = T10._Fld784_RRRef))
  337. WHERE ((T10._Fld595 = ?)) AND (T11._Fld595 = ?)))
  338. WHERE ((T8._Fld595 = ?)) AND ((CASE WHEN T6._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  339. 0x01 AS Q_002_F_000_
  340. FROM dbo._InfoRg11710 T12
  341. WHERE ((T12._Fld595 = ?)) AND ((T12._Fld12072RRef = T8._IDRRef) AND (T12._Fld12073_TYPE = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END AND T12._Fld12073_RTRef = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T12._Fld12073_RRRef = T6._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  342. 0x01 AS Q_003_F_000_
  343. FROM dbo._InfoRg11715 T13
  344. WHERE ((T13._Fld595 = ?)) AND ((T13._Fld12199RRef = T8._IDRRef) AND T13._Fld12200_TYPE = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END AND T13._Fld12200_RTRef = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T13._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T5._Period = ? AND (T5._Fld10545 <> ?) AND (T5._Fld10545 <> ?))
  345. GROUP BY T5._Fld10540_TYPE,
  346. T5._Fld10540_RTRef,
  347. T5._Fld10540_RRRef
  348. HAVING (CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8))) <> 0.0) T4
  349. ON (0x08 = T4.Fld10540_TYPE AND 0x000000E9 = T4.Fld10540_RTRef AND T1._IDRRef = T4.Fld10540_RRRef)
  350. LEFT OUTER JOIN (SELECT
  351. T15.Fld10344RRef AS Fld10344RRef,
  352. CAST(SUM(T15.Fld10346Balance_) AS NUMERIC(38, 8)) AS Fld10346Balance_
  353. FROM (SELECT
  354. T16._Fld10344RRef AS Fld10344RRef,
  355. CAST(SUM(T16._Fld10346) AS NUMERIC(33, 8)) AS Fld10346Balance_
  356. FROM dbo._AccumRgT10349 T16
  357. WHERE ((T16._Fld595 = ?)) AND (T16._Period = ? AND (T16._Fld10346 <> ?) AND (T16._Fld10346 <> ?))
  358. GROUP BY T16._Fld10344RRef
  359. HAVING (CAST(SUM(T16._Fld10346) AS NUMERIC(33, 8))) <> 0.0
  360. UNION ALL SELECT
  361. T17._Fld10344RRef AS Fld10344RRef,
  362. CAST(CAST(SUM(CASE WHEN T17._RecordKind = 0.0 THEN -T17._Fld10346 ELSE T17._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld10346Balance_
  363. FROM dbo._AccumRg10339 T17
  364. WHERE ((T17._Fld595 = ?)) AND (T17._Period >= ? AND T17._Period < ? AND T17._Active = 0x01)
  365. GROUP BY T17._Fld10344RRef
  366. HAVING (CAST(CAST(SUM(CASE WHEN T17._RecordKind = 0.0 THEN -T17._Fld10346 ELSE T17._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T15
  367. GROUP BY T15.Fld10344RRef
  368. HAVING (CAST(SUM(T15.Fld10346Balance_) AS NUMERIC(38, 8))) <> 0.0) T14
  369. ON (T1._IDRRef = T14.Fld10344RRef)
  370. LEFT OUTER JOIN dbo._InfoRg9134 T18
  371. ON ((0x08 = T18._Fld9136_TYPE AND 0x000000E9 = T18._Fld9136_RTRef AND T1._IDRRef = T18._Fld9136_RRRef)) AND (T18._Fld595 = ?)
  372. LEFT OUTER JOIN dbo._InfoRg11720 T19
  373. ON ((0x08 = T19._Fld12312_TYPE AND 0x000000E9 = T19._Fld12312_RTRef AND T1._IDRRef = T19._Fld12312_RRRef)) AND (T19._Fld595 = ?)
  374. LEFT OUTER JOIN (SELECT
  375. T21._Fld10332_TYPE AS Fld10332_TYPE,
  376. T21._Fld10332_RTRef AS Fld10332_RTRef,
  377. T21._Fld10332_RRRef AS Fld10332_RRRef,
  378. CAST(SUM(T21._Fld10335) AS NUMERIC(33, 8)) AS Fld10335Balance_
  379. FROM dbo._AccumRgT10337 T21
  380. WHERE (((T21._Fld595 = ?)) AND (EXISTS(SELECT
  381. 1
  382. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  383. LEFT OUTER JOIN dbo._Reference42 T22
  384. ON ((T21._Fld10330RRef = T22._IDRRef)) AND (T22._Fld595 = ?)
  385. WHERE EXISTS(SELECT
  386. 0x01 AS Q_001_F_000_
  387. FROM dbo._Reference98 T23
  388. INNER JOIN dbo._Reference21 T24
  389. ON (((T23._Fld1685 = ?) AND EXISTS(SELECT
  390. 0x01 AS Q_004_F_000_
  391. FROM dbo._InfoRg11709 T25
  392. WHERE ((T25._Fld595 = ?)) AND ((T25._Fld12065RRef = T23._IDRRef) AND (T25._Fld12066RRef = T24._IDRRef)))) AND T24._IDRRef IN
  393. (SELECT
  394. T26._Reference21_IDRRef AS Q_005_F_000RRef
  395. FROM dbo._Reference21_VT782 T26
  396. INNER JOIN dbo._InfoRg9937 T27
  397. ON ((T27._Fld9939_TYPE = 0x08 AND T27._Fld9939_RTRef = 0x00000095 AND T27._Fld9939_RRRef = ?) AND (T27._Fld9938_TYPE = T26._Fld784_TYPE AND T27._Fld9938_RTRef = T26._Fld784_RTRef AND T27._Fld9938_RRRef = T26._Fld784_RRRef))
  398. WHERE ((T26._Fld595 = ?)) AND (T27._Fld595 = ?)))
  399. WHERE ((T24._Fld595 = ?)) AND ((CASE WHEN T22._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  400. 0x01 AS Q_002_F_000_
  401. FROM dbo._InfoRg11710 T28
  402. WHERE ((T28._Fld595 = ?)) AND ((T28._Fld12072RRef = T24._IDRRef) AND (T28._Fld12073_TYPE = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END AND T28._Fld12073_RTRef = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T28._Fld12073_RRRef = T22._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  403. 0x01 AS Q_003_F_000_
  404. FROM dbo._InfoRg11715 T29
  405. WHERE ((T29._Fld595 = ?)) AND ((T29._Fld12199RRef = T24._IDRRef) AND T29._Fld12200_TYPE = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END AND T29._Fld12200_RTRef = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T29._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T21._Period = ? AND (T21._Fld10335 <> ?) AND (T21._Fld10335 <> ?))
  406. GROUP BY T21._Fld10332_TYPE,
  407. T21._Fld10332_RTRef,
  408. T21._Fld10332_RRRef
  409. HAVING (CAST(SUM(T21._Fld10335) AS NUMERIC(33, 8))) <> 0.0) T20
  410. ON (0x08 = T20.Fld10332_TYPE AND 0x000000E9 = T20.Fld10332_RTRef AND T1._IDRRef = T20.Fld10332_RRRef)
  411. LEFT OUTER JOIN dbo._Reference51 T30
  412. ON (T1._Fld4635RRef = T30._IDRRef) AND (T30._Fld595 = ?)
  413. LEFT OUTER JOIN dbo._Reference28 T31
  414. ON (T1._Fld4621RRef = T31._IDRRef) AND (T31._Fld595 = ?)
  415. LEFT OUTER JOIN (SELECT
  416. T33._Folder AS Folder_,
  417. T33._IDRRef AS IDRRef,
  418. T33._Description COLLATE Latin1_General_CI_AS AS Description_,
  419. T33._Fld12836RRef AS Fld12836RRef,
  420. T33._Fld595 AS Fld595_
  421. FROM dbo._Reference42 T33
  422. WHERE ((((T33._Folder = 0x00) OR EXISTS(SELECT
  423. 0x01 AS Q_001_F_000_
  424. FROM dbo._Reference98 T34
  425. INNER JOIN dbo._Reference21 T35
  426. ON (((T34._Fld1685 = ?) AND EXISTS(SELECT
  427. 0x01 AS Q_004_F_000_
  428. FROM dbo._InfoRg11709 T36
  429. WHERE ((T36._Fld595 = ?)) AND ((T36._Fld12065RRef = T34._IDRRef) AND (T36._Fld12066RRef = T35._IDRRef)))) AND T35._IDRRef IN
  430. (SELECT
  431. T37._Reference21_IDRRef AS Q_005_F_000RRef
  432. FROM dbo._Reference21_VT782 T37
  433. INNER JOIN dbo._InfoRg9937 T38
  434. ON ((T38._Fld9939_TYPE = 0x08 AND T38._Fld9939_RTRef = 0x00000095 AND T38._Fld9939_RRRef = ?) AND (T38._Fld9938_TYPE = T37._Fld784_TYPE AND T38._Fld9938_RTRef = T37._Fld784_RTRef AND T38._Fld9938_RRRef = T37._Fld784_RRRef))
  435. WHERE ((T37._Fld595 = ?)) AND (T38._Fld595 = ?)))
  436. WHERE ((T35._Fld595 = ?)) AND ((CASE WHEN T33._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  437. 0x01 AS Q_002_F_000_
  438. FROM dbo._InfoRg11710 T39
  439. WHERE ((T39._Fld595 = ?)) AND ((T39._Fld12072RRef = T35._IDRRef) AND (T39._Fld12073_TYPE = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x08 END AND T39._Fld12073_RTRef = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T39._Fld12073_RRRef = T33._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  440. 0x01 AS Q_003_F_000_
  441. FROM dbo._InfoRg11715 T40
  442. WHERE ((T40._Fld595 = ?)) AND ((T40._Fld12199RRef = T35._IDRRef) AND T40._Fld12200_TYPE = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x08 END AND T40._Fld12200_RTRef = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T40._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T33._Fld595 = ?)) T32
  443. ON T1._Fld4625RRef = T32.IDRRef
  444. LEFT OUTER JOIN dbo._Reference64 T41
  445. ON (T1._Fld4654RRef = T41._IDRRef) AND (T41._Fld595 = ?)
  446. LEFT OUTER JOIN (SELECT
  447. T43._Fld5085RRef AS Fld5085RRef,
  448. T43._IDRRef AS IDRRef,
  449. T43._Number COLLATE Latin1_General_CI_AS AS Number_,
  450. T43._Fld595 AS Fld595_
  451. FROM dbo._Document240 T43
  452. WHERE ((EXISTS(SELECT
  453. 1
  454. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  455. LEFT OUTER JOIN dbo._Reference42 T44
  456. ON ((T43._Fld5085RRef = T44._IDRRef)) AND (T44._Fld595 = ?)
  457. WHERE EXISTS(SELECT
  458. 0x01 AS Q_001_F_000_
  459. FROM dbo._Reference98 T45
  460. INNER JOIN dbo._Reference21 T46
  461. ON (((T45._Fld1685 = ?) AND EXISTS(SELECT
  462. 0x01 AS Q_004_F_000_
  463. FROM dbo._InfoRg11709 T47
  464. WHERE ((T47._Fld595 = ?)) AND ((T47._Fld12065RRef = T45._IDRRef) AND (T47._Fld12066RRef = T46._IDRRef)))) AND T46._IDRRef IN
  465. (SELECT
  466. T48._Reference21_IDRRef AS Q_005_F_000RRef
  467. FROM dbo._Reference21_VT782 T48
  468. INNER JOIN dbo._InfoRg9937 T49
  469. ON ((T49._Fld9939_TYPE = 0x08 AND T49._Fld9939_RTRef = 0x00000095 AND T49._Fld9939_RRRef = ?) AND (T49._Fld9938_TYPE = T48._Fld784_TYPE AND T49._Fld9938_RTRef = T48._Fld784_RTRef AND T49._Fld9938_RRRef = T48._Fld784_RRRef))
  470. WHERE ((T48._Fld595 = ?)) AND (T49._Fld595 = ?)))
  471. WHERE ((T46._Fld595 = ?)) AND ((CASE WHEN T44._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  472. 0x01 AS Q_002_F_000_
  473. FROM dbo._InfoRg11710 T50
  474. WHERE ((T50._Fld595 = ?)) AND ((T50._Fld12072RRef = T46._IDRRef) AND (T50._Fld12073_TYPE = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END AND T50._Fld12073_RTRef = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T50._Fld12073_RRRef = T44._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  475. 0x01 AS Q_003_F_000_
  476. FROM dbo._InfoRg11715 T51
  477. WHERE ((T51._Fld595 = ?)) AND ((T51._Fld12199RRef = T46._IDRRef) AND T51._Fld12200_TYPE = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END AND T51._Fld12200_RTRef = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T51._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T43._Fld595 = ?)) T42
  478. ON T19._Fld12313RRef = T42.IDRRef
  479. WHERE (((T1._Fld595 = ?)) AND (EXISTS(SELECT
  480. 1
  481. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  482. LEFT OUTER JOIN dbo._Reference42 T52
  483. ON ((T1._Fld4625RRef = T52._IDRRef)) AND (T52._Fld595 = ?)
  484. WHERE EXISTS(SELECT
  485. 0x01 AS Q_001_F_000_
  486. FROM dbo._Reference98 T53
  487. INNER JOIN dbo._Reference21 T54
  488. ON (((T53._Fld1685 = ?) AND EXISTS(SELECT
  489. 0x01 AS Q_004_F_000_
  490. FROM dbo._InfoRg11709 T55
  491. WHERE ((T55._Fld595 = ?)) AND ((T55._Fld12065RRef = T53._IDRRef) AND (T55._Fld12066RRef = T54._IDRRef)))) AND T54._IDRRef IN
  492. (SELECT
  493. T56._Reference21_IDRRef AS Q_005_F_000RRef
  494. FROM dbo._Reference21_VT782 T56
  495. INNER JOIN dbo._InfoRg9937 T57
  496. ON ((T57._Fld9939_TYPE = 0x08 AND T57._Fld9939_RTRef = 0x00000095 AND T57._Fld9939_RRRef = ?) AND (T57._Fld9938_TYPE = T56._Fld784_TYPE AND T57._Fld9938_RTRef = T56._Fld784_RTRef AND T57._Fld9938_RRRef = T56._Fld784_RRRef))
  497. WHERE ((T56._Fld595 = ?)) AND (T57._Fld595 = ?)))
  498. WHERE ((T54._Fld595 = ?)) AND ((CASE WHEN T52._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  499. 0x01 AS Q_002_F_000_
  500. FROM dbo._InfoRg11710 T58
  501. WHERE ((T58._Fld595 = ?)) AND ((T58._Fld12072RRef = T54._IDRRef) AND (T58._Fld12073_TYPE = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x08 END AND T58._Fld12073_RTRef = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T58._Fld12073_RRRef = T52._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  502. 0x01 AS Q_003_F_000_
  503. FROM dbo._InfoRg11715 T59
  504. WHERE ((T59._Fld595 = ?)) AND ((T59._Fld12199RRef = T54._IDRRef) AND T59._Fld12200_TYPE = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x08 END AND T59._Fld12200_RTRef = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T59._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND ((T1._Fld4621RRef = ?) AND (T1._Marked = 0x00) AND ((((((((T31._Description LIKE ? ESCAPE '/') OR (T32.Description_ LIKE ? ESCAPE '/')) OR ((T1._Fld4633 >= ?) AND (T1._Fld4633 < ?))) OR (T30._Description LIKE ? ESCAPE '/')) OR (T1._Number LIKE ? ESCAPE '/')) OR ((CASE WHEN ((ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),?) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) > ?) THEN (ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),?) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) ELSE ? END >= ?) AND (CASE WHEN ((ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),?) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) > ?) THEN (ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),?) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) ELSE ? END < ?))) OR (T41._Description LIKE ? ESCAPE '/')) OR (T42.Number_ LIKE ? ESCAPE '/')))
  505. ORDER BY (T1._Date_Time) DESC, (T1._IDRRef) DESC
  506. ",Context=DynamicList.GetData : Document.InventoryExpense.Form.ListForm.Attribute.List
  507.  
  508. 2156008.000 "SELECT TOP 25
  509. T1._IDRRef,
  510. T1._Marked,
  511. T1._Number,
  512. T1._Date_Time,
  513. T1._Posted,
  514. T1._Fld4621RRef,
  515. T1._Fld4622RRef,
  516. T1._Fld4625RRef,
  517. T1._Fld4633,
  518. T1._Fld4635RRef,
  519. T1._Fld4657RRef,
  520. CASE WHEN ((T1._Fld4657RRef = 0xAEB7F7D9237C245A447AADE98F164CDF) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T6.Fld10346Balance_ AS NUMERIC(33, 2)),0.0) > 0.0) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 4.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 6.0 ELSE 5.0 END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 0.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 2.0 ELSE 1.0 END END ELSE 7.0 END,
  521. T11._Fld12313RRef,
  522. CASE WHEN ((ISNULL(CAST(T12.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) > 0.0) THEN (ISNULL(CAST(T12.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) ELSE 0.0 END,
  523. T14._Fld1191
  524. FROM dbo._Document233 T1
  525. LEFT OUTER JOIN (SELECT
  526. T3._Fld11328RRef AS Fld11328RRef,
  527. CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8)) AS Fld11330Turnover_
  528. FROM dbo._AccumRgTn11332 T3
  529. WHERE ((T3._Fld595 = ?)) AND ((T3._Fld11330 <> ?))
  530. GROUP BY T3._Fld11328RRef
  531. HAVING (CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8))) <> 0.0) T2
  532. ON (T1._IDRRef = T2.Fld11328RRef)
  533. LEFT OUTER JOIN (SELECT
  534. T5._Fld10540_TYPE AS Fld10540_TYPE,
  535. T5._Fld10540_RTRef AS Fld10540_RTRef,
  536. T5._Fld10540_RRRef AS Fld10540_RRRef,
  537. CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8)) AS Fld10545Balance_
  538. FROM dbo._AccumRgT10549 T5
  539. WHERE ((T5._Fld595 = ?)) AND (T5._Period = ? AND (T5._Fld10545 <> ?) AND (T5._Fld10545 <> ?))
  540. GROUP BY T5._Fld10540_TYPE,
  541. T5._Fld10540_RTRef,
  542. T5._Fld10540_RRRef
  543. HAVING (CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8))) <> 0.0) T4
  544. ON (0x08 = T4.Fld10540_TYPE AND 0x000000E9 = T4.Fld10540_RTRef AND T1._IDRRef = T4.Fld10540_RRRef)
  545. LEFT OUTER JOIN (SELECT
  546. T7.Fld10344RRef AS Fld10344RRef,
  547. CAST(SUM(T7.Fld10346Balance_) AS NUMERIC(38, 8)) AS Fld10346Balance_
  548. FROM (SELECT
  549. T8._Fld10344RRef AS Fld10344RRef,
  550. CAST(SUM(T8._Fld10346) AS NUMERIC(33, 8)) AS Fld10346Balance_
  551. FROM dbo._AccumRgT10349 T8
  552. WHERE ((T8._Fld595 = ?)) AND (T8._Period = ? AND (T8._Fld10346 <> ?) AND (T8._Fld10346 <> ?))
  553. GROUP BY T8._Fld10344RRef
  554. HAVING (CAST(SUM(T8._Fld10346) AS NUMERIC(33, 8))) <> 0.0
  555. UNION ALL SELECT
  556. T9._Fld10344RRef AS Fld10344RRef,
  557. CAST(CAST(SUM(CASE WHEN T9._RecordKind = 0.0 THEN -T9._Fld10346 ELSE T9._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld10346Balance_
  558. FROM dbo._AccumRg10339 T9
  559. WHERE ((T9._Fld595 = ?)) AND (T9._Period >= ? AND T9._Period < ? AND T9._Active = 0x01)
  560. GROUP BY T9._Fld10344RRef
  561. HAVING (CAST(CAST(SUM(CASE WHEN T9._RecordKind = 0.0 THEN -T9._Fld10346 ELSE T9._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T7
  562. GROUP BY T7.Fld10344RRef
  563. HAVING (CAST(SUM(T7.Fld10346Balance_) AS NUMERIC(38, 8))) <> 0.0) T6
  564. ON (T1._IDRRef = T6.Fld10344RRef)
  565. LEFT OUTER JOIN dbo._InfoRg9134 T10
  566. ON ((0x08 = T10._Fld9136_TYPE AND 0x000000E9 = T10._Fld9136_RTRef AND T1._IDRRef = T10._Fld9136_RRRef)) AND (T10._Fld595 = ?)
  567. LEFT OUTER JOIN dbo._InfoRg11720 T11
  568. ON ((0x08 = T11._Fld12312_TYPE AND 0x000000E9 = T11._Fld12312_RTRef AND T1._IDRRef = T11._Fld12312_RRRef)) AND (T11._Fld595 = ?)
  569. LEFT OUTER JOIN (SELECT
  570. T13._Fld10332_TYPE AS Fld10332_TYPE,
  571. T13._Fld10332_RTRef AS Fld10332_RTRef,
  572. T13._Fld10332_RRRef AS Fld10332_RRRef,
  573. CAST(SUM(T13._Fld10335) AS NUMERIC(33, 8)) AS Fld10335Balance_
  574. FROM dbo._AccumRgT10337 T13
  575. WHERE ((T13._Fld595 = ?)) AND (T13._Period = ? AND (T13._Fld10335 <> ?) AND (T13._Fld10335 <> ?))
  576. GROUP BY T13._Fld10332_TYPE,
  577. T13._Fld10332_RTRef,
  578. T13._Fld10332_RRRef
  579. HAVING (CAST(SUM(T13._Fld10335) AS NUMERIC(33, 8))) <> 0.0) T12
  580. ON (0x08 = T12.Fld10332_TYPE AND 0x000000E9 = T12.Fld10332_RTRef AND T1._IDRRef = T12.Fld10332_RRRef)
  581. LEFT OUTER JOIN dbo._Reference51 T14
  582. ON (T1._Fld4635RRef = T14._IDRRef) AND (T14._Fld595 = ?)
  583. LEFT OUTER JOIN dbo._Reference28 T15
  584. ON (T1._Fld4621RRef = T15._IDRRef) AND (T15._Fld595 = ?)
  585. LEFT OUTER JOIN dbo._Reference42 T16
  586. ON (T1._Fld4625RRef = T16._IDRRef) AND (T16._Fld595 = ?)
  587. LEFT OUTER JOIN dbo._Document240 T17
  588. ON (T11._Fld12313RRef = T17._IDRRef) AND (T17._Fld595 = ?)
  589. WHERE ((T1._Fld595 = ?)) AND ((T1._Fld4621RRef = ?) AND (((((T15._Description LIKE ? ESCAPE '/') OR (T16._Description LIKE ? ESCAPE '/')) OR (T14._Description LIKE ? ESCAPE '/')) OR (T1._Number LIKE ? ESCAPE '/')) OR (T17._Number LIKE ? ESCAPE '/')) AND ((CASE WHEN ((T1._Fld4657RRef = ?) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T6.Fld10346Balance_ AS NUMERIC(33, 2)),?) > ?) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END END ELSE ? END > ?) OR ((CASE WHEN ((T1._Fld4657RRef = ?) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T6.Fld10346Balance_ AS NUMERIC(33, 2)),?) > ?) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END END ELSE ? END = ?) AND (T1._IDRRef >= ?))))
  590. ORDER BY (CASE WHEN ((T1._Fld4657RRef = 0xAEB7F7D9237C245A447AADE98F164CDF) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T6.Fld10346Balance_ AS NUMERIC(33, 2)),0.0) > 0.0) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 4.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 6.0 ELSE 5.0 END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 0.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 2.0 ELSE 1.0 END END ELSE 7.0 END), (T1._IDRRef)
  591. ",Context=DynamicList.GetData : Document.InventoryExpense.Form.ListForm.Attribute.List
  592.  
  593. 1859000.000 "SELECT TOP 30
  594. T1._IDRRef,
  595. T1._Marked,
  596. T1._Number,
  597. T1._Date_Time,
  598. T1._Posted,
  599. T1._Fld4621RRef,
  600. T1._Fld4622RRef,
  601. T1._Fld4625RRef,
  602. T1._Fld4633,
  603. T1._Fld4635RRef,
  604. T1._Fld4657RRef,
  605. CASE WHEN ((T1._Fld4657RRef = ?) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T14.Fld10346Balance_ AS NUMERIC(33, 2)),0.0) > 0.0) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 4.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 6.0 ELSE 5.0 END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 0.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 2.0 ELSE 1.0 END END ELSE 7.0 END,
  606. T19._Fld12313RRef,
  607. CASE WHEN ((ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) > 0.0) THEN (ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) ELSE 0.0 END,
  608. T30._Fld1191,
  609. T1._Fld4642,
  610. T1._Posted
  611. FROM dbo._Document233 T1
  612. LEFT OUTER JOIN (SELECT
  613. T3._Fld11328RRef AS Fld11328RRef,
  614. CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8)) AS Fld11330Turnover_
  615. FROM dbo._AccumRgTn11332 T3
  616. WHERE ((T3._Fld595 = ?)) AND ((T3._Fld11330 <> ?))
  617. GROUP BY T3._Fld11328RRef
  618. HAVING (CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8))) <> 0.0) T2
  619. ON (T1._IDRRef = T2.Fld11328RRef)
  620. LEFT OUTER JOIN (SELECT
  621. T5._Fld10540_TYPE AS Fld10540_TYPE,
  622. T5._Fld10540_RTRef AS Fld10540_RTRef,
  623. T5._Fld10540_RRRef AS Fld10540_RRRef,
  624. CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8)) AS Fld10545Balance_
  625. FROM dbo._AccumRgT10549 T5
  626. WHERE (((T5._Fld595 = ?)) AND (EXISTS(SELECT
  627. 1
  628. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  629. LEFT OUTER JOIN dbo._Reference42 T6
  630. ON ((T5._Fld10538RRef = T6._IDRRef)) AND (T6._Fld595 = ?)
  631. WHERE EXISTS(SELECT
  632. 0x01 AS Q_001_F_000_
  633. FROM dbo._Reference98 T7
  634. INNER JOIN dbo._Reference21 T8
  635. ON (((T7._Fld1685 = ?) AND EXISTS(SELECT
  636. 0x01 AS Q_004_F_000_
  637. FROM dbo._InfoRg11709 T9
  638. WHERE ((T9._Fld595 = ?)) AND ((T9._Fld12065RRef = T7._IDRRef) AND (T9._Fld12066RRef = T8._IDRRef)))) AND T8._IDRRef IN
  639. (SELECT
  640. T10._Reference21_IDRRef AS Q_005_F_000RRef
  641. FROM dbo._Reference21_VT782 T10
  642. INNER JOIN dbo._InfoRg9937 T11
  643. ON ((T11._Fld9939_TYPE = 0x08 AND T11._Fld9939_RTRef = 0x00000095 AND T11._Fld9939_RRRef = ?) AND (T11._Fld9938_TYPE = T10._Fld784_TYPE AND T11._Fld9938_RTRef = T10._Fld784_RTRef AND T11._Fld9938_RRRef = T10._Fld784_RRRef))
  644. WHERE ((T10._Fld595 = ?)) AND (T11._Fld595 = ?)))
  645. WHERE ((T8._Fld595 = ?)) AND ((CASE WHEN T6._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  646. 0x01 AS Q_002_F_000_
  647. FROM dbo._InfoRg11710 T12
  648. WHERE ((T12._Fld595 = ?)) AND ((T12._Fld12072RRef = T8._IDRRef) AND (T12._Fld12073_TYPE = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END AND T12._Fld12073_RTRef = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T12._Fld12073_RRRef = T6._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  649. 0x01 AS Q_003_F_000_
  650. FROM dbo._InfoRg11715 T13
  651. WHERE ((T13._Fld595 = ?)) AND ((T13._Fld12199RRef = T8._IDRRef) AND T13._Fld12200_TYPE = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END AND T13._Fld12200_RTRef = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T13._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T5._Period = ? AND (T5._Fld10545 <> ?) AND (T5._Fld10545 <> ?))
  652. GROUP BY T5._Fld10540_TYPE,
  653. T5._Fld10540_RTRef,
  654. T5._Fld10540_RRRef
  655. HAVING (CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8))) <> 0.0) T4
  656. ON (0x08 = T4.Fld10540_TYPE AND 0x000000E9 = T4.Fld10540_RTRef AND T1._IDRRef = T4.Fld10540_RRRef)
  657. LEFT OUTER JOIN (SELECT
  658. T15.Fld10344RRef AS Fld10344RRef,
  659. CAST(SUM(T15.Fld10346Balance_) AS NUMERIC(38, 8)) AS Fld10346Balance_
  660. FROM (SELECT
  661. T16._Fld10344RRef AS Fld10344RRef,
  662. CAST(SUM(T16._Fld10346) AS NUMERIC(33, 8)) AS Fld10346Balance_
  663. FROM dbo._AccumRgT10349 T16
  664. WHERE ((T16._Fld595 = ?)) AND (T16._Period = ? AND (T16._Fld10346 <> ?) AND (T16._Fld10346 <> ?))
  665. GROUP BY T16._Fld10344RRef
  666. HAVING (CAST(SUM(T16._Fld10346) AS NUMERIC(33, 8))) <> 0.0
  667. UNION ALL SELECT
  668. T17._Fld10344RRef AS Fld10344RRef,
  669. CAST(CAST(SUM(CASE WHEN T17._RecordKind = 0.0 THEN -T17._Fld10346 ELSE T17._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld10346Balance_
  670. FROM dbo._AccumRg10339 T17
  671. WHERE ((T17._Fld595 = ?)) AND (T17._Period >= ? AND T17._Period < ? AND T17._Active = 0x01)
  672. GROUP BY T17._Fld10344RRef
  673. HAVING (CAST(CAST(SUM(CASE WHEN T17._RecordKind = 0.0 THEN -T17._Fld10346 ELSE T17._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T15
  674. GROUP BY T15.Fld10344RRef
  675. HAVING (CAST(SUM(T15.Fld10346Balance_) AS NUMERIC(38, 8))) <> 0.0) T14
  676. ON (T1._IDRRef = T14.Fld10344RRef)
  677. LEFT OUTER JOIN dbo._InfoRg9134 T18
  678. ON ((0x08 = T18._Fld9136_TYPE AND 0x000000E9 = T18._Fld9136_RTRef AND T1._IDRRef = T18._Fld9136_RRRef)) AND (T18._Fld595 = ?)
  679. LEFT OUTER JOIN dbo._InfoRg11720 T19
  680. ON ((0x08 = T19._Fld12312_TYPE AND 0x000000E9 = T19._Fld12312_RTRef AND T1._IDRRef = T19._Fld12312_RRRef)) AND (T19._Fld595 = ?)
  681. LEFT OUTER JOIN (SELECT
  682. T21._Fld10332_TYPE AS Fld10332_TYPE,
  683. T21._Fld10332_RTRef AS Fld10332_RTRef,
  684. T21._Fld10332_RRRef AS Fld10332_RRRef,
  685. CAST(SUM(T21._Fld10335) AS NUMERIC(33, 8)) AS Fld10335Balance_
  686. FROM dbo._AccumRgT10337 T21
  687. WHERE (((T21._Fld595 = ?)) AND (EXISTS(SELECT
  688. 1
  689. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  690. LEFT OUTER JOIN dbo._Reference42 T22
  691. ON ((T21._Fld10330RRef = T22._IDRRef)) AND (T22._Fld595 = ?)
  692. WHERE EXISTS(SELECT
  693. 0x01 AS Q_001_F_000_
  694. FROM dbo._Reference98 T23
  695. INNER JOIN dbo._Reference21 T24
  696. ON (((T23._Fld1685 = ?) AND EXISTS(SELECT
  697. 0x01 AS Q_004_F_000_
  698. FROM dbo._InfoRg11709 T25
  699. WHERE ((T25._Fld595 = ?)) AND ((T25._Fld12065RRef = T23._IDRRef) AND (T25._Fld12066RRef = T24._IDRRef)))) AND T24._IDRRef IN
  700. (SELECT
  701. T26._Reference21_IDRRef AS Q_005_F_000RRef
  702. FROM dbo._Reference21_VT782 T26
  703. INNER JOIN dbo._InfoRg9937 T27
  704. ON ((T27._Fld9939_TYPE = 0x08 AND T27._Fld9939_RTRef = 0x00000095 AND T27._Fld9939_RRRef = ?) AND (T27._Fld9938_TYPE = T26._Fld784_TYPE AND T27._Fld9938_RTRef = T26._Fld784_RTRef AND T27._Fld9938_RRRef = T26._Fld784_RRRef))
  705. WHERE ((T26._Fld595 = ?)) AND (T27._Fld595 = ?)))
  706. WHERE ((T24._Fld595 = ?)) AND ((CASE WHEN T22._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  707. 0x01 AS Q_002_F_000_
  708. FROM dbo._InfoRg11710 T28
  709. WHERE ((T28._Fld595 = ?)) AND ((T28._Fld12072RRef = T24._IDRRef) AND (T28._Fld12073_TYPE = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END AND T28._Fld12073_RTRef = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T28._Fld12073_RRRef = T22._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  710. 0x01 AS Q_003_F_000_
  711. FROM dbo._InfoRg11715 T29
  712. WHERE ((T29._Fld595 = ?)) AND ((T29._Fld12199RRef = T24._IDRRef) AND T29._Fld12200_TYPE = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END AND T29._Fld12200_RTRef = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T29._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T21._Period = ? AND (T21._Fld10335 <> ?) AND (T21._Fld10335 <> ?))
  713. GROUP BY T21._Fld10332_TYPE,
  714. T21._Fld10332_RTRef,
  715. T21._Fld10332_RRRef
  716. HAVING (CAST(SUM(T21._Fld10335) AS NUMERIC(33, 8))) <> 0.0) T20
  717. ON (0x08 = T20.Fld10332_TYPE AND 0x000000E9 = T20.Fld10332_RTRef AND T1._IDRRef = T20.Fld10332_RRRef)
  718. LEFT OUTER JOIN dbo._Reference51 T30
  719. ON (T1._Fld4635RRef = T30._IDRRef) AND (T30._Fld595 = ?)
  720. WHERE (((T1._Fld595 = ?)) AND (EXISTS(SELECT
  721. 1
  722. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  723. LEFT OUTER JOIN dbo._Reference42 T31
  724. ON ((T1._Fld4625RRef = T31._IDRRef)) AND (T31._Fld595 = ?)
  725. WHERE EXISTS(SELECT
  726. 0x01 AS Q_001_F_000_
  727. FROM dbo._Reference98 T32
  728. INNER JOIN dbo._Reference21 T33
  729. ON (((T32._Fld1685 = ?) AND EXISTS(SELECT
  730. 0x01 AS Q_004_F_000_
  731. FROM dbo._InfoRg11709 T34
  732. WHERE ((T34._Fld595 = ?)) AND ((T34._Fld12065RRef = T32._IDRRef) AND (T34._Fld12066RRef = T33._IDRRef)))) AND T33._IDRRef IN
  733. (SELECT
  734. T35._Reference21_IDRRef AS Q_005_F_000RRef
  735. FROM dbo._Reference21_VT782 T35
  736. INNER JOIN dbo._InfoRg9937 T36
  737. ON ((T36._Fld9939_TYPE = 0x08 AND T36._Fld9939_RTRef = 0x00000095 AND T36._Fld9939_RRRef = ?) AND (T36._Fld9938_TYPE = T35._Fld784_TYPE AND T36._Fld9938_RTRef = T35._Fld784_RTRef AND T36._Fld9938_RRRef = T35._Fld784_RRRef))
  738. WHERE ((T35._Fld595 = ?)) AND (T36._Fld595 = ?)))
  739. WHERE ((T33._Fld595 = ?)) AND ((CASE WHEN T31._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T31._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  740. 0x01 AS Q_002_F_000_
  741. FROM dbo._InfoRg11710 T37
  742. WHERE ((T37._Fld595 = ?)) AND ((T37._Fld12072RRef = T33._IDRRef) AND (T37._Fld12073_TYPE = CASE WHEN T31._Fld12836RRef IS NOT NULL THEN 0x08 END AND T37._Fld12073_RTRef = CASE WHEN T31._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T37._Fld12073_RRRef = T31._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  743. 0x01 AS Q_003_F_000_
  744. FROM dbo._InfoRg11715 T38
  745. WHERE ((T38._Fld595 = ?)) AND ((T38._Fld12199RRef = T33._IDRRef) AND T38._Fld12200_TYPE = CASE WHEN T31._Fld12836RRef IS NOT NULL THEN 0x08 END AND T38._Fld12200_RTRef = CASE WHEN T31._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T38._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND ((T1._Posted = 0x00) AND (T1._Marked = 0x00))
  746. ORDER BY (T1._Date_Time), (T1._IDRRef)
  747. ",Context=DynamicList.GetData : Document.InventoryExpense.Form.ListForm.Attribute.List
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement