d-liefst.w 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. &ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI ADM2
  2. &ANALYZE-RESUME
  3. /* Connected Databases
  4. anadat PROGRESS
  5. */
  6. &Scoped-define WINDOW-NAME CURRENT-WINDOW
  7. {adecomm/appserv.i}
  8. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS dTables
  9. /*------------------------------------------------------------------------
  10. File:
  11. Description: from DATA.W - Template For SmartData objects in the ADM
  12. Input Parameters:
  13. <none>
  14. Output Parameters:
  15. <none>
  16. Modified: February 24, 1999
  17. ------------------------------------------------------------------------*/
  18. /* This .W file was created with the Progress AppBuilder. */
  19. /*----------------------------------------------------------------------*/
  20. /* Create an unnamed pool to store all the widgets created
  21. by this procedure. This is a good default which assures
  22. that this procedure's triggers and internal procedures
  23. will execute in this procedure's storage, and that proper
  24. cleanup will occur on deletion of the procedure. */
  25. CREATE WIDGET-POOL.
  26. /* *************************** Definitions ************************** */
  27. /* Parameters Definitions --- */
  28. /* Local Variable Definitions --- */
  29. &SCOPED-DEFINE Tabelle Liefst
  30. &SCOPED-DEFINE TabWhere USE-INDEX Liefst-k1 ~
  31. WHERE {&Tabelle}.Firma = tRowObject.Firma ~
  32. AND {&Tabelle}.Knr = tRowObject.Knr
  33. { incl/datdefinition.i }
  34. /* _UIB-CODE-BLOCK-END */
  35. &ANALYZE-RESUME
  36. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  37. /* ******************** Preprocessor Definitions ******************** */
  38. &Scoped-define PROCEDURE-TYPE SmartDataObject
  39. &Scoped-define DB-AWARE yes
  40. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  41. /* Db-Required definitions. */
  42. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  43. &GLOBAL-DEFINE DB-REQUIRED TRUE
  44. &ENDIF
  45. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  46. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  47. &Scoped-define QUERY-NAME Query-Main
  48. /* Internal Tables (found by Frame, Query & Browse Queries) */
  49. &Scoped-define INTERNAL-TABLES Liefst
  50. /* Definitions for QUERY Query-Main */
  51. &Scoped-Define ENABLED-FIELDS Firma Knr FRW Kond Kontakt Anrede Bemerkung Kopf Schluss Rabatt Min_Betrag~
  52. Min_Gewicht Spez_Cd Geb_Cd Edat Esbkb Mdat Msbkb Aktiv Lieferungen BestBis~
  53. GLN_Nr1 GLN_Nr2 Spesen Bestell_Intervall Lieferzeit Min_GGebinde~
  54. Min_KGebinde Min_VGebinde ZusRab Barcode_Typ
  55. &Scoped-define ENABLED-FIELDS-IN-Liefst Firma Knr FRW Kond Kontakt Anrede ~
  56. Bemerkung Kopf Schluss Rabatt Min_Betrag Min_Gewicht Spez_Cd Geb_Cd Edat ~
  57. Esbkb Mdat Msbkb Aktiv Lieferungen BestBis GLN_Nr1 GLN_Nr2 Spesen ~
  58. Bestell_Intervall Lieferzeit Min_GGebinde Min_KGebinde Min_VGebinde ZusRab ~
  59. Barcode_Typ
  60. &Scoped-Define DATA-FIELDS Firma Knr FRW Kond Kontakt Anrede Bemerkung Kopf Schluss Rabatt Min_Betrag~
  61. Min_Gewicht Spez_Cd Geb_Cd Edat Esbkb Mdat Msbkb Aktiv Lieferungen BestBis~
  62. GLN_Nr1 GLN_Nr2 Spesen Bestell_Intervall Lieferzeit Min_GGebinde~
  63. Min_KGebinde Min_VGebinde ZusRab Barcode_Typ
  64. &Scoped-define DATA-FIELDS-IN-Liefst Firma Knr FRW Kond Kontakt Anrede ~
  65. Bemerkung Kopf Schluss Rabatt Min_Betrag Min_Gewicht Spez_Cd Geb_Cd Edat ~
  66. Esbkb Mdat Msbkb Aktiv Lieferungen BestBis GLN_Nr1 GLN_Nr2 Spesen ~
  67. Bestell_Intervall Lieferzeit Min_GGebinde Min_KGebinde Min_VGebinde ZusRab ~
  68. Barcode_Typ
  69. &Scoped-Define MANDATORY-FIELDS Firma Knr
  70. &Scoped-Define APPLICATION-SERVICE
  71. &Scoped-Define ASSIGN-LIST
  72. &Scoped-Define DATA-FIELD-DEFS "d-liefst.i"
  73. &Scoped-define QUERY-STRING-Query-Main FOR EACH Liefst NO-LOCK INDEXED-REPOSITION
  74. {&DB-REQUIRED-START}
  75. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH Liefst NO-LOCK INDEXED-REPOSITION.
  76. {&DB-REQUIRED-END}
  77. &Scoped-define TABLES-IN-QUERY-Query-Main Liefst
  78. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main Liefst
  79. /* Custom List Definitions */
  80. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  81. /* _UIB-PREPROCESSOR-BLOCK-END */
  82. &ANALYZE-RESUME
  83. /* ************************ Function Prototypes ********************** */
  84. {&DB-REQUIRED-START}
  85. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  86. FUNCTION openQuery RETURNS LOGICAL
  87. ( /* parameter-definitions */ ) FORWARD.
  88. /* _UIB-CODE-BLOCK-END */
  89. &ANALYZE-RESUME
  90. {&DB-REQUIRED-END}
  91. /* *********************** Control Definitions ********************** */
  92. {&DB-REQUIRED-START}
  93. /* Query definitions */
  94. &ANALYZE-SUSPEND
  95. DEFINE QUERY Query-Main FOR
  96. Liefst SCROLLING.
  97. &ANALYZE-RESUME
  98. {&DB-REQUIRED-END}
  99. /* ************************ Frame Definitions *********************** */
  100. /* *********************** Procedure Settings ************************ */
  101. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  102. /* Settings for THIS-PROCEDURE
  103. Type: SmartDataObject
  104. Allow: Query
  105. Frames: 0
  106. Add Fields to: Neither
  107. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  108. */
  109. /* This procedure should always be RUN PERSISTENT. Report the error, */
  110. /* then cleanup and return. */
  111. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  112. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  113. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  114. RETURN.
  115. END.
  116. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  117. /* ************************* Create Window ************************** */
  118. &ANALYZE-SUSPEND _CREATE-WINDOW
  119. /* DESIGN Window definition (used by the UIB)
  120. CREATE WINDOW dTables ASSIGN
  121. HEIGHT = 1.62
  122. WIDTH = 46.6.
  123. /* END WINDOW DEFINITION */
  124. */
  125. &ANALYZE-RESUME
  126. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  127. /* ************************* Included-Libraries *********************** */
  128. {src/adm2/data.i}
  129. /* _UIB-CODE-BLOCK-END */
  130. &ANALYZE-RESUME
  131. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  132. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  133. /* SETTINGS FOR WINDOW dTables
  134. VISIBLE,,RUN-PERSISTENT */
  135. /* _RUN-TIME-ATTRIBUTES-END */
  136. &ANALYZE-RESUME
  137. /* Setting information for Queries and Browse Widgets fields */
  138. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  139. /* Query rebuild information for SmartDataObject Query-Main
  140. _TblList = "AnaDat.Liefst"
  141. _Options = "NO-LOCK INDEXED-REPOSITION"
  142. _FldNameList[1] > AnaDat.Liefst.Firma
  143. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? yes 8 yes ""
  144. _FldNameList[2] > AnaDat.Liefst.Knr
  145. "Knr" "Knr" ? ? "integer" ? ? ? ? ? ? yes ? yes 7.2 yes ""
  146. _FldNameList[3] > AnaDat.Liefst.FRW
  147. "FRW" "FRW" ? ? "character" ? ? ? ? ? ? yes ? no 5 yes ""
  148. _FldNameList[4] > AnaDat.Liefst.Kond
  149. "Kond" "Kond" ? ? "integer" ? ? ? ? ? ? yes ? no 5 yes ""
  150. _FldNameList[5] > AnaDat.Liefst.Kontakt
  151. "Kontakt" "Kontakt" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  152. _FldNameList[6] > AnaDat.Liefst.Anrede
  153. "Anrede" "Anrede" ? ? "character" ? ? ? ? ? ? yes ? no 50 yes ""
  154. _FldNameList[7] > AnaDat.Liefst.Bemerkung
  155. "Bemerkung" "Bemerkung" ? ? "character" ? ? ? ? ? ? yes ? no 480 yes ""
  156. _FldNameList[8] > AnaDat.Liefst.Kopf
  157. "Kopf" "Kopf" ? ? "character" ? ? ? ? ? ? yes ? no 480 yes ""
  158. _FldNameList[9] > AnaDat.Liefst.Schluss
  159. "Schluss" "Schluss" ? ? "character" ? ? ? ? ? ? yes ? no 480 yes ""
  160. _FldNameList[10] > AnaDat.Liefst.Rabatt
  161. "Rabatt" "Rabatt" ? ? "decimal" ? ? ? ? ? ? yes ? no 6.4 yes ""
  162. _FldNameList[11] > AnaDat.Liefst.Min_Betrag
  163. "Min_Betrag" "Min_Betrag" ? ? "decimal" ? ? ? ? ? ? yes ? no 10.8 yes ""
  164. _FldNameList[12] > AnaDat.Liefst.Min_Gewicht
  165. "Min_Gewicht" "Min_Gewicht" ? ? "decimal" ? ? ? ? ? ? yes ? no 12.4 yes ""
  166. _FldNameList[13] > AnaDat.Liefst.Spez_Cd
  167. "Spez_Cd" "Spez_Cd" ? ? "character" ? ? ? ? ? ? yes ? no 8.6 yes ""
  168. _FldNameList[14] > AnaDat.Liefst.Geb_Cd
  169. "Geb_Cd" "Geb_Cd" ? ? "character" ? ? ? ? ? ? yes ? no 8 yes ""
  170. _FldNameList[15] > AnaDat.Liefst.Edat
  171. "Edat" "Edat" ? ? "date" ? ? ? ? ? ? yes ? no 10.8 yes ""
  172. _FldNameList[16] > AnaDat.Liefst.Esbkb
  173. "Esbkb" "Esbkb" ? ? "character" ? ? ? ? ? ? yes ? no 6 yes ""
  174. _FldNameList[17] > AnaDat.Liefst.Mdat
  175. "Mdat" "Mdat" ? ? "date" ? ? ? ? ? ? yes ? no 10.8 yes ""
  176. _FldNameList[18] > AnaDat.Liefst.Msbkb
  177. "Msbkb" "Msbkb" ? ? "character" ? ? ? ? ? ? yes ? no 6.4 yes ""
  178. _FldNameList[19] > AnaDat.Liefst.Aktiv
  179. "Aktiv" "Aktiv" ? "Ja/Nein" "logical" ? ? ? ? ? ? yes ? no 4.8 yes ""
  180. _FldNameList[20] > AnaDat.Liefst.Lieferungen
  181. "Lieferungen" "Lieferungen" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  182. _FldNameList[21] > AnaDat.Liefst.BestBis
  183. "BestBis" "BestBis" "Bestellung bis" ? "character" ? ? ? ? ? ? yes ? no 20 yes ""
  184. _FldNameList[22] > AnaDat.Liefst.GLN_Nr1
  185. "GLN_Nr1" "GLN_Nr1" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ?
  186. _FldNameList[23] > AnaDat.Liefst.GLN_Nr2
  187. "GLN_Nr2" "GLN_Nr2" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ?
  188. _FldNameList[24] > AnaDat.Liefst.Spesen
  189. "Spesen" "Spesen" ? ? "decimal" ? ? ? ? ? ? yes ? no 7.2 yes ?
  190. _FldNameList[25] > AnaDat.Liefst.Bestell_Intervall
  191. "Bestell_Intervall" "Bestell_Intervall" ? ? "integer" ? ? ? ? ? ? yes ? no 14.8 yes ?
  192. _FldNameList[26] > AnaDat.Liefst.Lieferzeit
  193. "Lieferzeit" "Lieferzeit" ? ? "integer" ? ? ? ? ? ? yes ? no 8.4 yes ?
  194. _FldNameList[27] > AnaDat.Liefst.Min_GGebinde
  195. "Min_GGebinde" "Min_GGebinde" ? ? "integer" ? ? ? ? ? ? yes ? no 14.2 yes ?
  196. _FldNameList[28] > AnaDat.Liefst.Min_KGebinde
  197. "Min_KGebinde" "Min_KGebinde" ? ? "integer" ? ? ? ? ? ? yes ? no 14 yes ?
  198. _FldNameList[29] > AnaDat.Liefst.Min_VGebinde
  199. "Min_VGebinde" "Min_VGebinde" ? ? "integer" ? ? ? ? ? ? yes ? no 14 yes ?
  200. _FldNameList[30] > AnaDat.Liefst.ZusRab
  201. "ZusRab" "ZusRab" ? ? "decimal" ? ? ? ? ? ? yes ? no 7.6 yes ?
  202. _FldNameList[31] > AnaDat.Liefst.Barcode_Typ
  203. "Barcode_Typ" "Barcode_Typ" ? ? "integer" ? ? ? ? ? ? yes ? no 12.8 yes ?
  204. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  205. */ /* QUERY Query-Main */
  206. &ANALYZE-RESUME
  207. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  208. /* *************************** Main Block *************************** */
  209. { incl/datmainblock.i }
  210. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  211. RUN initializeObject.
  212. &ENDIF
  213. /* _UIB-CODE-BLOCK-END */
  214. &ANALYZE-RESUME
  215. /* ********************** Internal Procedures *********************** */
  216. {&DB-REQUIRED-START}
  217. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataAvailable dTables _DB-REQUIRED
  218. PROCEDURE dataAvailable :
  219. /*------------------------------------------------------------------------------
  220. Purpose: Super Override
  221. Parameters:
  222. Notes:
  223. ------------------------------------------------------------------------------*/
  224. { incl/datdataavailable.i }
  225. END PROCEDURE.
  226. /* _UIB-CODE-BLOCK-END */
  227. &ANALYZE-RESUME
  228. {&DB-REQUIRED-END}
  229. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  230. PROCEDURE disable_UI :
  231. /*------------------------------------------------------------------------------
  232. Purpose: DISABLE the User Interface
  233. Parameters: <none>
  234. Notes: Here we clean-up the user-interface by deleting
  235. dynamic widgets we have created and/or hide
  236. frames. This procedure is usually called when
  237. we are ready to "clean-up" after running.
  238. ------------------------------------------------------------------------------*/
  239. /* Hide all frames. */
  240. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  241. END PROCEDURE.
  242. /* _UIB-CODE-BLOCK-END */
  243. &ANALYZE-RESUME
  244. {&DB-REQUIRED-START}
  245. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE INAKTIVIEREN dTables _DB-REQUIRED
  246. PROCEDURE INAKTIVIEREN :
  247. /*------------------------------------------------------------------------------
  248. Purpose:
  249. Parameters: <none>
  250. Notes:
  251. ------------------------------------------------------------------------------*/
  252. { incl/datinaktivieren.i }
  253. END PROCEDURE.
  254. /* _UIB-CODE-BLOCK-END */
  255. &ANALYZE-RESUME
  256. {&DB-REQUIRED-END}
  257. {&DB-REQUIRED-START}
  258. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject dTables _DB-REQUIRED
  259. PROCEDURE initializeObject :
  260. /*------------------------------------------------------------------------------
  261. Purpose: Super Override
  262. Parameters:
  263. Notes:
  264. ------------------------------------------------------------------------------*/
  265. { incl/datinitialize.i }
  266. END PROCEDURE.
  267. /* _UIB-CODE-BLOCK-END */
  268. &ANALYZE-RESUME
  269. {&DB-REQUIRED-END}
  270. {&DB-REQUIRED-START}
  271. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REAKTIVIEREN dTables _DB-REQUIRED
  272. PROCEDURE REAKTIVIEREN :
  273. /*------------------------------------------------------------------------------
  274. Purpose:
  275. Parameters: <none>
  276. Notes:
  277. ------------------------------------------------------------------------------*/
  278. { incl/datreaktivieren.i }
  279. END PROCEDURE.
  280. /* _UIB-CODE-BLOCK-END */
  281. &ANALYZE-RESUME
  282. {&DB-REQUIRED-END}
  283. /* ************************ Function Implementations ***************** */
  284. {&DB-REQUIRED-START}
  285. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  286. FUNCTION openQuery RETURNS LOGICAL
  287. ( /* parameter-definitions */ ) :
  288. /*------------------------------------------------------------------------------
  289. Purpose: Super Override
  290. Notes:
  291. ------------------------------------------------------------------------------*/
  292. DEF VAR ix AS INT NO-UNDO.
  293. DEF VAR Felder AS CHAR NO-UNDO.
  294. Felder = DYNAMIC-FUNCTION('getForeignFields':U) NO-ERROR.
  295. DO WHILE TRUE:
  296. xWhere = 'Firma = "' + Firma + '" '.
  297. IF Felder = ? THEN LEAVE.
  298. IF Felder = '' THEN LEAVE.
  299. ix = LOOKUP('Knr', Felder, ',') / 2.
  300. IF ix < 1 THEN LEAVE.
  301. Felder = DYNAMIC-FUNCTION('getForeignValues':U) NO-ERROR.
  302. xWhere = 'Firma = "' + Firma + '" '
  303. + 'AND Knr = ' + ENTRY(ix, Felder, CHR(01)).
  304. LEAVE.
  305. END.
  306. DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere).
  307. RETURN SUPER( ).
  308. END FUNCTION.
  309. /* _UIB-CODE-BLOCK-END */
  310. &ANALYZE-RESUME
  311. {&DB-REQUIRED-END}