d-krest.w 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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 Krest
  30. /* &SCOPED-DEFINE TabWhere USE-INDEX Krest-k1 ~ */
  31. /* WHERE {&Tabelle}.Firma = tRowObject.Firma ~ */
  32. /* AND {&Tabelle}.Aufnr = tRowObject.Aufnr */
  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 Krest
  50. /* Definitions for QUERY Query-Main */
  51. &Scoped-Define ENABLED-FIELDS Firma Knr FrwBas FrwA1 FrwA2 MWST_Nr Kred_Knr BezugsPerson Anrede Telefon~
  52. Fax Kond Konto Konto_S ZahlArt BankA BankE BankKto PCKto ESRTnNr Rabatt~
  53. Rundung WIR% WIRKonto Brief Saldo Aktiv
  54. &Scoped-define ENABLED-FIELDS-IN-Krest Firma Knr FrwBas FrwA1 FrwA2 MWST_Nr ~
  55. Kred_Knr BezugsPerson Anrede Telefon Fax Kond Konto Konto_S ZahlArt BankA ~
  56. BankE BankKto PCKto ESRTnNr Rabatt Rundung WIR% WIRKonto Brief Saldo Aktiv
  57. &Scoped-Define DATA-FIELDS Firma Knr FrwBas FrwA1 FrwA2 MWST_Nr Kred_Knr BezugsPerson Anrede Telefon~
  58. Fax Kond Konto Konto_S ZahlArt BankA BankE BankKto PCKto ESRTnNr Rabatt~
  59. Rundung WIR% WIRKonto Brief Saldo Aktiv
  60. &Scoped-define DATA-FIELDS-IN-Krest Firma Knr FrwBas FrwA1 FrwA2 MWST_Nr ~
  61. Kred_Knr BezugsPerson Anrede Telefon Fax Kond Konto Konto_S ZahlArt BankA ~
  62. BankE BankKto PCKto ESRTnNr Rabatt Rundung WIR% WIRKonto Brief Saldo Aktiv
  63. &Scoped-Define MANDATORY-FIELDS Firma
  64. &Scoped-Define APPLICATION-SERVICE
  65. &Scoped-Define ASSIGN-LIST
  66. &Scoped-Define DATA-FIELD-DEFS "d-krest.i"
  67. &Scoped-define QUERY-STRING-Query-Main FOR EACH Krest NO-LOCK INDEXED-REPOSITION
  68. {&DB-REQUIRED-START}
  69. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH Krest NO-LOCK INDEXED-REPOSITION.
  70. {&DB-REQUIRED-END}
  71. &Scoped-define TABLES-IN-QUERY-Query-Main Krest
  72. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main Krest
  73. /* Custom List Definitions */
  74. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  75. /* _UIB-PREPROCESSOR-BLOCK-END */
  76. &ANALYZE-RESUME
  77. /* ************************ Function Prototypes ********************** */
  78. {&DB-REQUIRED-START}
  79. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getCurrentRecid dTables _DB-REQUIRED
  80. FUNCTION getCurrentRecid RETURNS RECID
  81. ( /* parameter-definitions */ ) FORWARD.
  82. /* _UIB-CODE-BLOCK-END */
  83. &ANALYZE-RESUME
  84. {&DB-REQUIRED-END}
  85. {&DB-REQUIRED-START}
  86. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  87. FUNCTION openQuery RETURNS LOGICAL
  88. ( /* parameter-definitions */ ) FORWARD.
  89. /* _UIB-CODE-BLOCK-END */
  90. &ANALYZE-RESUME
  91. {&DB-REQUIRED-END}
  92. /* *********************** Control Definitions ********************** */
  93. {&DB-REQUIRED-START}
  94. /* Query definitions */
  95. &ANALYZE-SUSPEND
  96. DEFINE QUERY Query-Main FOR
  97. Krest SCROLLING.
  98. &ANALYZE-RESUME
  99. {&DB-REQUIRED-END}
  100. /* ************************ Frame Definitions *********************** */
  101. /* *********************** Procedure Settings ************************ */
  102. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  103. /* Settings for THIS-PROCEDURE
  104. Type: SmartDataObject
  105. Allow: Query
  106. Frames: 0
  107. Add Fields to: Neither
  108. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  109. */
  110. /* This procedure should always be RUN PERSISTENT. Report the error, */
  111. /* then cleanup and return. */
  112. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  113. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  114. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  115. RETURN.
  116. END.
  117. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  118. /* ************************* Create Window ************************** */
  119. &ANALYZE-SUSPEND _CREATE-WINDOW
  120. /* DESIGN Window definition (used by the UIB)
  121. CREATE WINDOW dTables ASSIGN
  122. HEIGHT = 4.19
  123. WIDTH = 92.6.
  124. /* END WINDOW DEFINITION */
  125. */
  126. &ANALYZE-RESUME
  127. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  128. /* ************************* Included-Libraries *********************** */
  129. {src/adm2/data.i}
  130. /* _UIB-CODE-BLOCK-END */
  131. &ANALYZE-RESUME
  132. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  133. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  134. /* SETTINGS FOR WINDOW dTables
  135. VISIBLE,,RUN-PERSISTENT */
  136. /* _RUN-TIME-ATTRIBUTES-END */
  137. &ANALYZE-RESUME
  138. /* Setting information for Queries and Browse Widgets fields */
  139. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  140. /* Query rebuild information for SmartDataObject Query-Main
  141. _TblList = "AnaDat.Krest"
  142. _Options = "NO-LOCK INDEXED-REPOSITION"
  143. _FldNameList[1] > AnaDat.Krest.Firma
  144. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? yes 8 yes ""
  145. _FldNameList[2] > AnaDat.Krest.Knr
  146. "Knr" "Knr" ? ? "integer" ? ? ? ? ? ? yes ? no 7.2 yes ""
  147. _FldNameList[3] > AnaDat.Krest.FrwBas
  148. "FrwBas" "FrwBas" ? ? "character" ? ? ? ? ? ? yes ? no 7 yes ""
  149. _FldNameList[4] > AnaDat.Krest.FrwA1
  150. "FrwA1" "FrwA1" ? ? "character" ? ? ? ? ? ? yes ? no 6 yes ""
  151. _FldNameList[5] > AnaDat.Krest.FrwA2
  152. "FrwA2" "FrwA2" ? ? "character" ? ? ? ? ? ? yes ? no 6 yes ""
  153. _FldNameList[6] > AnaDat.Krest.MWST_Nr
  154. "MWST_Nr" "MWST_Nr" ? ? "character" ? ? ? ? ? ? yes ? no 15 yes ""
  155. _FldNameList[7] > AnaDat.Krest.Kred_Knr
  156. "Kred_Knr" "Kred_Knr" ? ? "character" ? ? ? ? ? ? yes ? no 12 yes ""
  157. _FldNameList[8] > AnaDat.Krest.BezugsPerson
  158. "BezugsPerson" "BezugsPerson" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  159. _FldNameList[9] > AnaDat.Krest.Anrede
  160. "Anrede" "Anrede" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  161. _FldNameList[10] > AnaDat.Krest.Telefon
  162. "Telefon" "Telefon" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ""
  163. _FldNameList[11] > AnaDat.Krest.Fax
  164. "Fax" "Fax" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ""
  165. _FldNameList[12] > AnaDat.Krest.Kond
  166. "Kond" "Kond" ? ? "integer" ? ? ? ? ? ? yes ? no 5 yes ""
  167. _FldNameList[13] > AnaDat.Krest.Konto
  168. "Konto" "Konto" ? ? "character" ? ? ? ? ? ? yes ? no 12 yes ""
  169. _FldNameList[14] > AnaDat.Krest.Konto_S
  170. "Konto_S" "Konto_S" ? ? "character" ? ? ? ? ? ? yes ? no 12 yes ""
  171. _FldNameList[15] > AnaDat.Krest.ZahlArt
  172. "ZahlArt" "ZahlArt" ? ? "integer" ? ? ? ? ? ? yes ? no 6.8 yes ""
  173. _FldNameList[16] > AnaDat.Krest.BankA
  174. "BankA" "BankA" ? ? "integer" ? ? ? ? ? ? yes ? no 6.4 yes ""
  175. _FldNameList[17] > AnaDat.Krest.BankE
  176. "BankE" "BankE" ? ? "integer" ? ? ? ? ? ? yes ? no 6.4 yes ""
  177. _FldNameList[18] > AnaDat.Krest.BankKto
  178. "BankKto" "BankKto" ? ? "character" ? ? ? ? ? ? yes ? no 25 yes ""
  179. _FldNameList[19] > AnaDat.Krest.PCKto
  180. "PCKto" "PCKto" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ""
  181. _FldNameList[20] > AnaDat.Krest.ESRTnNr
  182. "ESRTnNr" "ESRTnNr" ? ? "integer" ? ? ? ? ? ? yes ? no 10.8 yes ""
  183. _FldNameList[21] > AnaDat.Krest.Rabatt
  184. "Rabatt" "Rabatt" ? ? "decimal" ? ? ? ? ? ? yes ? no 6.4 yes ""
  185. _FldNameList[22] > AnaDat.Krest.Rundung
  186. "Rundung" "Rundung" ? ? "integer" ? ? ? ? ? ? yes ? no 8.8 yes ""
  187. _FldNameList[23] > AnaDat.Krest.WIR%
  188. "WIR%" "WIR%" ? ? "integer" ? ? ? ? ? ? yes ? no 6 yes ""
  189. _FldNameList[24] > AnaDat.Krest.WIRKonto
  190. "WIRKonto" "WIRKonto" ? ? "character" ? ? ? ? ? ? yes ? no 12 yes ""
  191. _FldNameList[25] > AnaDat.Krest.Brief
  192. "Brief" "Brief" ? ? "integer" ? ? ? ? ? ? yes ? no 4.2 yes ""
  193. _FldNameList[26] > AnaDat.Krest.Saldo
  194. "Saldo" "Saldo" ? ? "decimal" ? ? ? ? ? ? yes ? no 14 yes ""
  195. _FldNameList[27] > AnaDat.Krest.Aktiv
  196. "Aktiv" "Aktiv" ? "Ja/Nein" "logical" ? ? ? ? ? ? yes ? no 4.8 yes ""
  197. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  198. */ /* QUERY Query-Main */
  199. &ANALYZE-RESUME
  200. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  201. /* *************************** Main Block *************************** */
  202. { incl/datmainblock.i }
  203. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  204. RUN initializeObject.
  205. &ENDIF
  206. /* _UIB-CODE-BLOCK-END */
  207. &ANALYZE-RESUME
  208. /* ********************** Internal Procedures *********************** */
  209. {&DB-REQUIRED-START}
  210. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataAvailable dTables _DB-REQUIRED
  211. PROCEDURE dataAvailable :
  212. /*------------------------------------------------------------------------------
  213. Purpose: Super Override
  214. Parameters:
  215. Notes:
  216. ------------------------------------------------------------------------------*/
  217. { incl/datdataavailable.i }
  218. END PROCEDURE.
  219. /* _UIB-CODE-BLOCK-END */
  220. &ANALYZE-RESUME
  221. {&DB-REQUIRED-END}
  222. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  223. PROCEDURE disable_UI :
  224. /*------------------------------------------------------------------------------
  225. Purpose: DISABLE the User Interface
  226. Parameters: <none>
  227. Notes: Here we clean-up the user-interface by deleting
  228. dynamic widgets we have created and/or hide
  229. frames. This procedure is usually called when
  230. we are ready to "clean-up" after running.
  231. ------------------------------------------------------------------------------*/
  232. /* Hide all frames. */
  233. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  234. END PROCEDURE.
  235. /* _UIB-CODE-BLOCK-END */
  236. &ANALYZE-RESUME
  237. {&DB-REQUIRED-START}
  238. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE INAKTIVIEREN dTables _DB-REQUIRED
  239. PROCEDURE INAKTIVIEREN :
  240. /*------------------------------------------------------------------------------
  241. Purpose:
  242. Parameters: <none>
  243. Notes:
  244. ------------------------------------------------------------------------------*/
  245. { incl/datinaktivieren.i }
  246. END PROCEDURE.
  247. /* _UIB-CODE-BLOCK-END */
  248. &ANALYZE-RESUME
  249. {&DB-REQUIRED-END}
  250. {&DB-REQUIRED-START}
  251. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject dTables _DB-REQUIRED
  252. PROCEDURE initializeObject :
  253. /*------------------------------------------------------------------------------
  254. Purpose: Super Override
  255. Parameters:
  256. Notes:
  257. ------------------------------------------------------------------------------*/
  258. { incl/datinitialize.i }
  259. END PROCEDURE.
  260. /* _UIB-CODE-BLOCK-END */
  261. &ANALYZE-RESUME
  262. {&DB-REQUIRED-END}
  263. /* ************************ Function Implementations ***************** */
  264. {&DB-REQUIRED-START}
  265. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getCurrentRecid dTables _DB-REQUIRED
  266. FUNCTION getCurrentRecid RETURNS RECID
  267. ( /* parameter-definitions */ ) :
  268. /*------------------------------------------------------------------------------
  269. Purpose:
  270. Notes:
  271. ------------------------------------------------------------------------------*/
  272. { incl/datgetcurrentrecid.i }
  273. END FUNCTION.
  274. /* _UIB-CODE-BLOCK-END */
  275. &ANALYZE-RESUME
  276. {&DB-REQUIRED-END}
  277. {&DB-REQUIRED-START}
  278. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  279. FUNCTION openQuery RETURNS LOGICAL
  280. ( /* parameter-definitions */ ) :
  281. /*------------------------------------------------------------------------------
  282. Purpose: Super Override
  283. Notes:
  284. ------------------------------------------------------------------------------*/
  285. DEF VAR ix AS INT NO-UNDO.
  286. DEF VAR Felder AS CHAR NO-UNDO.
  287. Felder = DYNAMIC-FUNCTION('getForeignFields':U) NO-ERROR.
  288. DO WHILE TRUE:
  289. xWhere = 'Firma = "' + Firma + '" '.
  290. IF Felder = ? THEN LEAVE.
  291. IF Felder = '' THEN LEAVE.
  292. ix = LOOKUP('Knr', Felder, ',') / 2.
  293. IF ix < 1 THEN LEAVE.
  294. Felder = DYNAMIC-FUNCTION('getForeignValues':U) NO-ERROR.
  295. xWhere = 'Firma = "' + Firma + '" '
  296. + 'AND Knr = ' + ENTRY(ix, Felder, CHR(01)).
  297. LEAVE.
  298. END.
  299. DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere).
  300. RETURN SUPER( ).
  301. END FUNCTION.
  302. /* _UIB-CODE-BLOCK-END */
  303. &ANALYZE-RESUME
  304. {&DB-REQUIRED-END}