d-aufko-ruestkontrolle.w 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  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. DEFINE TEMP-TABLE tAufko
  30. FIELD Firma AS CHARACTER
  31. FIELD Aufnr AS INTEGER
  32. FIELD Gewicht AS DECIMAL.
  33. &SCOPED-DEFINE Tabelle Aufko
  34. &SCOPED-DEFINE TabWhere USE-INDEX Aufko-k1 ~
  35. WHERE {&Tabelle}.Firma = tRowObject.Firma ~
  36. AND {&Tabelle}.Aufnr = tRowObject.Aufnr
  37. { incl/datdefinition.i }
  38. /* _UIB-CODE-BLOCK-END */
  39. &ANALYZE-RESUME
  40. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  41. /* ******************** Preprocessor Definitions ******************** */
  42. &Global-define DATA-LOGIC-PROCEDURE .p
  43. &Scoped-define PROCEDURE-TYPE SmartDataObject
  44. &Scoped-define DB-AWARE yes
  45. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  46. /* Db-Required definitions. */
  47. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  48. &GLOBAL-DEFINE DB-REQUIRED TRUE
  49. &ENDIF
  50. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  51. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  52. &Scoped-define QUERY-NAME Query-Main
  53. /* Internal Tables (found by Frame, Query & Browse Queries) */
  54. &Scoped-define INTERNAL-TABLES Aufko
  55. /* Definitions for QUERY Query-Main */
  56. &Scoped-Define ENABLED-FIELDS Firma Aufnr Knr Fahrer Tour_Nr1 Lief_Datum Gewicht Ablad_Vor_Text Kunde~
  57. Strasse PlzOrt Auf_Text cStatus cAktion TotalGewicht lLast
  58. &Scoped-define ENABLED-FIELDS-IN-Aufko Firma Aufnr Knr Fahrer Tour_Nr1 ~
  59. Lief_Datum Gewicht Ablad_Vor_Text Auf_Text
  60. &Scoped-Define DATA-FIELDS Firma Aufnr Knr Fahrer Tour_Nr1 Lief_Datum Gewicht Ablad_Vor_Text Kunde~
  61. Strasse PlzOrt Auf_Text cStatus cAktion TotalGewicht lLast xDUMMY
  62. &Scoped-define DATA-FIELDS-IN-Aufko Firma Aufnr Knr Fahrer Tour_Nr1 ~
  63. Lief_Datum Gewicht Ablad_Vor_Text Auf_Text
  64. &Scoped-Define MANDATORY-FIELDS Firma Knr
  65. &Scoped-Define APPLICATION-SERVICE
  66. &Scoped-Define ASSIGN-LIST
  67. &Scoped-Define DATA-FIELD-DEFS "d-aufko-ruestkontrolle.i"
  68. &Scoped-Define DATA-TABLE-NO-UNDO NO-UNDO
  69. &Scoped-define QUERY-STRING-Query-Main FOR EACH Aufko NO-LOCK INDEXED-REPOSITION
  70. {&DB-REQUIRED-START}
  71. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH Aufko NO-LOCK INDEXED-REPOSITION.
  72. {&DB-REQUIRED-END}
  73. &Scoped-define TABLES-IN-QUERY-Query-Main Aufko
  74. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main Aufko
  75. /* Custom List Definitions */
  76. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  77. /* _UIB-PREPROCESSOR-BLOCK-END */
  78. &ANALYZE-RESUME
  79. /* ************************ Function Prototypes ********************** */
  80. {&DB-REQUIRED-START}
  81. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getCurrentRecid dTables _DB-REQUIRED
  82. FUNCTION getCurrentRecid RETURNS RECID
  83. ( /* parameter-definitions */ ) FORWARD.
  84. /* _UIB-CODE-BLOCK-END */
  85. &ANALYZE-RESUME
  86. {&DB-REQUIRED-END}
  87. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getGesamtGewicht dTables
  88. FUNCTION getGesamtGewicht RETURNS DECIMAL
  89. ( ipcFirma AS CHARACTER, ipiAufnr AS INTEGER ) FORWARD.
  90. /* _UIB-CODE-BLOCK-END */
  91. &ANALYZE-RESUME
  92. {&DB-REQUIRED-START}
  93. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getQueryBuffer dTables _DB-REQUIRED
  94. FUNCTION getQueryBuffer RETURNS HANDLE
  95. ( /* parameter-definitions */ ) FORWARD.
  96. /* _UIB-CODE-BLOCK-END */
  97. &ANALYZE-RESUME
  98. {&DB-REQUIRED-END}
  99. {&DB-REQUIRED-START}
  100. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getZusatzDaten dTables _DB-REQUIRED
  101. FUNCTION getZusatzDaten RETURNS CHARACTER
  102. ( /* parameter-definitions */ ) FORWARD.
  103. /* _UIB-CODE-BLOCK-END */
  104. &ANALYZE-RESUME
  105. {&DB-REQUIRED-END}
  106. {&DB-REQUIRED-START}
  107. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  108. FUNCTION openQuery RETURNS LOGICAL
  109. ( /* parameter-definitions */ ) FORWARD.
  110. /* _UIB-CODE-BLOCK-END */
  111. &ANALYZE-RESUME
  112. {&DB-REQUIRED-END}
  113. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD setGesamtGewicht dTables
  114. FUNCTION setGesamtGewicht RETURNS LOGICAL
  115. ( ipcString AS CHARACTER ) FORWARD.
  116. /* _UIB-CODE-BLOCK-END */
  117. &ANALYZE-RESUME
  118. /* *********************** Control Definitions ********************** */
  119. {&DB-REQUIRED-START}
  120. /* Query definitions */
  121. &ANALYZE-SUSPEND
  122. DEFINE QUERY Query-Main FOR
  123. Aufko SCROLLING.
  124. &ANALYZE-RESUME
  125. {&DB-REQUIRED-END}
  126. /* ************************ Frame Definitions *********************** */
  127. /* *********************** Procedure Settings ************************ */
  128. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  129. /* Settings for THIS-PROCEDURE
  130. Type: SmartDataObject
  131. Allow: Query
  132. Frames: 0
  133. Add Fields to: Neither
  134. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  135. */
  136. /* This procedure should always be RUN PERSISTENT. Report the error, */
  137. /* then cleanup and return. */
  138. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  139. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  140. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  141. RETURN.
  142. END.
  143. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  144. /* ************************* Create Window ************************** */
  145. &ANALYZE-SUSPEND _CREATE-WINDOW
  146. /* DESIGN Window definition (used by the UIB)
  147. CREATE WINDOW dTables ASSIGN
  148. HEIGHT = 1.62
  149. WIDTH = 46.6.
  150. /* END WINDOW DEFINITION */
  151. */
  152. &ANALYZE-RESUME
  153. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  154. /* ************************* Included-Libraries *********************** */
  155. {src/adm2/data.i}
  156. /* _UIB-CODE-BLOCK-END */
  157. &ANALYZE-RESUME
  158. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  159. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  160. /* SETTINGS FOR WINDOW dTables
  161. VISIBLE,,RUN-PERSISTENT */
  162. /* _RUN-TIME-ATTRIBUTES-END */
  163. &ANALYZE-RESUME
  164. /* Setting information for Queries and Browse Widgets fields */
  165. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  166. /* Query rebuild information for SmartDataObject Query-Main
  167. _TblList = "AnaDat.Aufko"
  168. _Options = "NO-LOCK INDEXED-REPOSITION"
  169. _FldNameList[1] > AnaDat.Aufko.Firma
  170. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? yes 8 yes ?
  171. _FldNameList[2] > AnaDat.Aufko.Aufnr
  172. "Aufnr" "Aufnr" ? ? "integer" ? ? ? ? ? ? yes ? no 8.4 yes ?
  173. _FldNameList[3] > AnaDat.Aufko.Knr
  174. "Knr" "Knr" ? ? "integer" ? ? ? ? ? ? yes ? yes 7.2 yes ?
  175. _FldNameList[4] > AnaDat.Aufko.Fahrer
  176. "Fahrer" "Fahrer" ? ? "integer" ? ? ? ? ? ? yes ? no 6 yes ?
  177. _FldNameList[5] > AnaDat.Aufko.Tour_Nr1
  178. "Tour_Nr1" "Tour_Nr1" ? ? "integer" ? ? ? ? ? ? yes ? no 9 yes ?
  179. _FldNameList[6] > AnaDat.Aufko.Lief_Datum
  180. "Lief_Datum" "Lief_Datum" ? ? "date" ? ? ? ? ? ? yes ? no 10.8 yes ?
  181. _FldNameList[7] > AnaDat.Aufko.Gewicht
  182. "Gewicht" "Gewicht" ? ? "decimal" ? ? ? ? ? ? yes ? no 11.6 yes ?
  183. _FldNameList[8] > AnaDat.Aufko.Ablad_Vor_Text
  184. "Ablad_Vor_Text" "Ablad_Vor_Text" ? ? "character" ? ? ? ? ? ? yes ? no 40 yes ?
  185. _FldNameList[9] > "_<CALC>"
  186. """""" "Kunde" "Kunde" "x(30)" "character" ? ? ? ? ? ? yes ? no 30 no ?
  187. _FldNameList[10] > "_<CALC>"
  188. """""" "Strasse" "Strasse" "x(30)" "character" ? ? ? ? ? ? yes ? no 30 no ?
  189. _FldNameList[11] > "_<CALC>"
  190. """""" "PlzOrt" "Plt / Ort" "x(8)" "character" ? ? ? ? ? ? yes ? no 8 no ?
  191. _FldNameList[12] > AnaDat.Aufko.Auf_Text
  192. "Auf_Text" "Auf_Text" ? ? "character" ? ? ? ? ? ? yes ? no 500 yes ?
  193. _FldNameList[13] > "_<CALC>"
  194. """""" "cStatus" "A" "X" "character" ? ? ? ? ? ? yes ? no 1.4 no ?
  195. _FldNameList[14] > "_<CALC>"
  196. "X" "cAktion" "A" "X" "character" ? ? ? ? ? ? yes ? no 1 no ?
  197. _FldNameList[15] > "_<CALC>"
  198. "DYNAMIC-FUNCTION('getGesamtGewicht':U IN THIS-PROCEDURE, RowObject.Firma, RowObject.Aufnr)" "TotalGewicht" "Total Gewicht" "->>,>>9.99" "Decimal" ? ? ? ? ? ? yes ? no 13.2 no ?
  199. _FldNameList[16] > "_<CALC>"
  200. "FALSE" "lLast" "Letzter" "Yes/No" "Logical" ? ? ? ? ? ? yes ? no 6.4 no ?
  201. _FldNameList[17] > "_<CALC>"
  202. "DYNAMIC-FUNCTION('getZusatzDaten':U IN THIS-PROCEDURE)" "xDUMMY" ? "x(8)" "character" ? ? ? ? ? ? no ? no 8 no ?
  203. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  204. */ /* QUERY Query-Main */
  205. &ANALYZE-RESUME
  206. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  207. /* *************************** Main Block *************************** */
  208. fOpen = FALSE.
  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 DATA.CALCULATE dTables DATA.CALCULATE _DB-REQUIRED
  218. PROCEDURE DATA.CALCULATE :
  219. /*------------------------------------------------------------------------------
  220. Purpose: Calculate all the Calculated Expressions found in the
  221. SmartDataObject.
  222. Parameters: <none>
  223. ------------------------------------------------------------------------------*/
  224. ASSIGN
  225. rowObject.cAktion = (X)
  226. rowObject.cStatus = ("")
  227. rowObject.Kunde = ("")
  228. rowObject.lLast = (FALSE)
  229. rowObject.PlzOrt = ("")
  230. rowObject.Strasse = ("")
  231. rowObject.TotalGewicht = (DYNAMIC-FUNCTION('getGesamtGewicht':U IN THIS-PROCEDURE, RowObject.Firma, RowObject.Aufnr))
  232. rowObject.xDUMMY = (DYNAMIC-FUNCTION('getZusatzDaten':U IN THIS-PROCEDURE))
  233. .
  234. END PROCEDURE.
  235. /* _UIB-CODE-BLOCK-END */
  236. &ANALYZE-RESUME
  237. {&DB-REQUIRED-END}
  238. {&DB-REQUIRED-START}
  239. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataAvailable dTables _DB-REQUIRED
  240. PROCEDURE dataAvailable :
  241. /*------------------------------------------------------------------------------
  242. Purpose: Super Override
  243. Parameters:
  244. Notes:
  245. ------------------------------------------------------------------------------*/
  246. { incl/datdataavailable.i }
  247. END PROCEDURE.
  248. /* _UIB-CODE-BLOCK-END */
  249. &ANALYZE-RESUME
  250. {&DB-REQUIRED-END}
  251. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  252. PROCEDURE disable_UI :
  253. /*------------------------------------------------------------------------------
  254. Purpose: DISABLE the User Interface
  255. Parameters: <none>
  256. Notes: Here we clean-up the user-interface by deleting
  257. dynamic widgets we have created and/or hide
  258. frames. This procedure is usually called when
  259. we are ready to "clean-up" after running.
  260. ------------------------------------------------------------------------------*/
  261. /* Hide all frames. */
  262. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  263. END PROCEDURE.
  264. /* _UIB-CODE-BLOCK-END */
  265. &ANALYZE-RESUME
  266. {&DB-REQUIRED-START}
  267. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE INAKTIVIEREN dTables _DB-REQUIRED
  268. PROCEDURE INAKTIVIEREN :
  269. /*------------------------------------------------------------------------------
  270. Purpose:
  271. Parameters: <none>
  272. Notes:
  273. ------------------------------------------------------------------------------*/
  274. { incl/datinaktivieren.i }
  275. END PROCEDURE.
  276. /* _UIB-CODE-BLOCK-END */
  277. &ANALYZE-RESUME
  278. {&DB-REQUIRED-END}
  279. {&DB-REQUIRED-START}
  280. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject dTables _DB-REQUIRED
  281. PROCEDURE initializeObject :
  282. /*------------------------------------------------------------------------------
  283. Purpose: Super Override
  284. Parameters:
  285. Notes:
  286. ------------------------------------------------------------------------------*/
  287. { incl/datinitialize.i }
  288. END PROCEDURE.
  289. /* _UIB-CODE-BLOCK-END */
  290. &ANALYZE-RESUME
  291. {&DB-REQUIRED-END}
  292. {&DB-REQUIRED-START}
  293. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REAKTIVIEREN dTables _DB-REQUIRED
  294. PROCEDURE REAKTIVIEREN :
  295. /*------------------------------------------------------------------------------
  296. Purpose:
  297. Parameters: <none>
  298. Notes:
  299. ------------------------------------------------------------------------------*/
  300. { incl/datreaktivieren.i }
  301. END PROCEDURE.
  302. /* _UIB-CODE-BLOCK-END */
  303. &ANALYZE-RESUME
  304. {&DB-REQUIRED-END}
  305. {&DB-REQUIRED-START}
  306. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REPOS_TABELLE dTables _DB-REQUIRED
  307. PROCEDURE REPOS_TABELLE :
  308. /*------------------------------------------------------------------------------
  309. Purpose:
  310. Parameters: <none>
  311. Notes:
  312. ------------------------------------------------------------------------------*/
  313. { incl/datrepos.i }
  314. END PROCEDURE.
  315. /* _UIB-CODE-BLOCK-END */
  316. &ANALYZE-RESUME
  317. {&DB-REQUIRED-END}
  318. {&DB-REQUIRED-START}
  319. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_FILTER dTables _DB-REQUIRED
  320. PROCEDURE SET_FILTER :
  321. /*------------------------------------------------------------------------------
  322. Purpose:
  323. Parameters: <none>
  324. Notes:
  325. ------------------------------------------------------------------------------*/
  326. { incl/datsetfilter.i }
  327. END PROCEDURE.
  328. /* _UIB-CODE-BLOCK-END */
  329. &ANALYZE-RESUME
  330. {&DB-REQUIRED-END}
  331. {&DB-REQUIRED-START}
  332. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_OPENFLAG dTables _DB-REQUIRED
  333. PROCEDURE SET_OPENFLAG :
  334. /*------------------------------------------------------------------------------
  335. Purpose:
  336. Parameters: <none>
  337. Notes:
  338. ------------------------------------------------------------------------------*/
  339. { incl/datsetopenflag.i }
  340. END PROCEDURE.
  341. /* _UIB-CODE-BLOCK-END */
  342. &ANALYZE-RESUME
  343. {&DB-REQUIRED-END}
  344. {&DB-REQUIRED-START}
  345. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_SORT dTables _DB-REQUIRED
  346. PROCEDURE SET_SORT :
  347. /*------------------------------------------------------------------------------
  348. Purpose:
  349. Parameters: <none>
  350. Notes:
  351. ------------------------------------------------------------------------------*/
  352. { incl/datsetsort.i }
  353. END PROCEDURE.
  354. /* _UIB-CODE-BLOCK-END */
  355. &ANALYZE-RESUME
  356. {&DB-REQUIRED-END}
  357. /* ************************ Function Implementations ***************** */
  358. {&DB-REQUIRED-START}
  359. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getCurrentRecid dTables _DB-REQUIRED
  360. FUNCTION getCurrentRecid RETURNS RECID
  361. ( /* parameter-definitions */ ) :
  362. /*------------------------------------------------------------------------------
  363. Purpose:
  364. Notes:
  365. ------------------------------------------------------------------------------*/
  366. { incl/datgetcurrentrecid.i }
  367. END FUNCTION.
  368. /* _UIB-CODE-BLOCK-END */
  369. &ANALYZE-RESUME
  370. {&DB-REQUIRED-END}
  371. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getGesamtGewicht dTables
  372. FUNCTION getGesamtGewicht RETURNS DECIMAL
  373. ( ipcFirma AS CHARACTER, ipiAufnr AS INTEGER ):
  374. /*------------------------------------------------------------------------------
  375. Purpose:
  376. Notes:
  377. ------------------------------------------------------------------------------*/
  378. FIND FIRST tAufko NO-LOCK
  379. WHERE tAufko.Firma = ipcFirma
  380. AND tAufko.Aufnr = ipiAufnr NO-ERROR.
  381. RETURN (IF AVAILABLE tAufko THEN tAufko.Gewicht ELSE 0.00).
  382. END FUNCTION.
  383. /* _UIB-CODE-BLOCK-END */
  384. &ANALYZE-RESUME
  385. {&DB-REQUIRED-START}
  386. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getQueryBuffer dTables _DB-REQUIRED
  387. FUNCTION getQueryBuffer RETURNS HANDLE
  388. ( /* parameter-definitions */ ) :
  389. /*------------------------------------------------------------------------------
  390. Purpose:
  391. Notes:
  392. ------------------------------------------------------------------------------*/
  393. RETURN BUFFER rowObject:HANDLE.
  394. END FUNCTION.
  395. /* _UIB-CODE-BLOCK-END */
  396. &ANALYZE-RESUME
  397. {&DB-REQUIRED-END}
  398. {&DB-REQUIRED-START}
  399. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getZusatzDaten dTables _DB-REQUIRED
  400. FUNCTION getZusatzDaten RETURNS CHARACTER
  401. ( /* parameter-definitions */ ) :
  402. /*------------------------------------------------------------------------------
  403. Purpose:
  404. Notes:
  405. ------------------------------------------------------------------------------*/
  406. DEF BUFFER bAdresse FOR Adresse.
  407. FIND bAdresse NO-LOCK
  408. WHERE bAdresse.Firma = AdFirma
  409. AND bAdresse.Knr = rowObject.Knr NO-ERROR.
  410. ASSIGN
  411. rowObject.Kunde = (IF bAdresse.Firma1 <> '' THEN TRIM(bAdresse.Firma1 + ' ' + bAdresse.Firma2 )
  412. ELSE TRIM(bAdresse.NAME + ' ' + bAdresse.Vorname ) )
  413. rowObject.Strasse = bAdresse.Strasse
  414. rowObject.PlzOrt = TRIM(bAdresse.Plz + ' ' + bAdresse.Ort).
  415. RETURN "". /* Function return value. */
  416. END FUNCTION.
  417. /* _UIB-CODE-BLOCK-END */
  418. &ANALYZE-RESUME
  419. {&DB-REQUIRED-END}
  420. {&DB-REQUIRED-START}
  421. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  422. FUNCTION openQuery RETURNS LOGICAL
  423. ( /* parameter-definitions */ ) :
  424. /*------------------------------------------------------------------------------
  425. Purpose: Super Override
  426. Notes:
  427. ------------------------------------------------------------------------------*/
  428. DEF VAR Felder AS CHAR NO-UNDO.
  429. DEF VAR Inhalt AS CHAR NO-UNDO.
  430. DEF VAR ix AS INT NO-UNDO.
  431. DEF VAR cFeld AS CHAR NO-UNDO.
  432. DEF VAR dDatum AS DATE NO-UNDO.
  433. DEF VAR iTour AS INTEGER NO-UNDO.
  434. DEF VAR iFahrer AS INTEGER NO-UNDO.
  435. IF NOT fOpen THEN RETURN FALSE.
  436. xWhere = ''.
  437. xSort = ''.
  438. xString = ''.
  439. Felder = DYNAMIC-FUNCTION('getForeignFields':U) NO-ERROR.
  440. Inhalt = DYNAMIC-FUNCTION('getForeignValues':U) NO-ERROR.
  441. dDatum = DYNAMIC-FUNCTION('getLieferdatum':U IN hKontainer) NO-ERROR.
  442. iFahrer = DYNAMIC-FUNCTION('getFahrer':U IN hKontainer) NO-ERROR.
  443. iTour = DYNAMIC-FUNCTION('getTour':U IN hKontainer) NO-ERROR.
  444. IF dDatum = ? THEN RETURN FALSE.
  445. /* ix = LOOKUP('Feld', Felder, ',') / 2. */
  446. /* cFeld = ENTRY (ix , Inhalt, CHR(01)). */
  447. /* xWhere = 'Aufko.Firma = ' + QUOTER(Firma) + ' AND ' */
  448. /* + 'Aufko.Auf_Sta = ' + STRING(Auf_Sta) + ' '. */
  449. xString = 'FOR EACH Aufko NO-LOCK '
  450. + 'WHERE Aufko.Firma = &1 '
  451. + 'AND Aufko.Lief_Datum = &2 '
  452. + 'AND Aufko.Auf_Sta < 3 '
  453. + 'AND NOT Aufko.AlsOfferte '.
  454. IF iFahrer > 0 THEN xString = xString
  455. + 'AND Aufko.Fahrer = &3 '.
  456. IF iTour > 0 THEN xString = xString
  457. + 'AND Aufko.Tour_Nr1 = &4 '.
  458. xString = SUBSTITUTE(xString, QUOTER(Firma), dDatum, iFahrer, iTour ).
  459. cFeld = xString + ' BREAK BY Aufko.Tour_Nr1 BY Aufko.Fahrer BY Aufko.Aufnr '.
  460. DYNAMIC-FUNCTION ('setGesamtGewicht':U IN THIS-PROCEDURE, cFeld ) NO-ERROR.
  461. xString = xString + ' BY Aufko.Tour_Nr1 BY Aufko.Fahrer BY Aufko.Aufnr '
  462. + ' INDEXED-REPOSITION '.
  463. { incl/datopenquery.i }
  464. IF xWhere <> '' THEN DYNAMIC-FUNCTION('setQueryWhere':U , INPUT xWhere ).
  465. IF xSort <> '' THEN DYNAMIC-FUNCTION('setQuerySort':U , INPUT xSort ).
  466. IF xString <> '' THEN DYNAMIC-FUNCTION('setQueryString':U, INPUT xString).
  467. RETURN SUPER( ).
  468. END FUNCTION.
  469. /* _UIB-CODE-BLOCK-END */
  470. &ANALYZE-RESUME
  471. {&DB-REQUIRED-END}
  472. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION setGesamtGewicht dTables
  473. FUNCTION setGesamtGewicht RETURNS LOGICAL
  474. ( ipcString AS CHARACTER ):
  475. /*------------------------------------------------------------------------------
  476. Purpose:
  477. Notes:
  478. ------------------------------------------------------------------------------*/
  479. DEFINE VARIABLE nTotGewicht AS DECIMAL NO-UNDO.
  480. DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
  481. EMPTY TEMP-TABLE tAufko.
  482. CREATE QUERY hQuery.
  483. hQuery:SET-BUFFERS ( BUFFER Aufko:HANDLE ).
  484. hQuery:QUERY-PREPARE ( ipcString ).
  485. hQuery:QUERY-OPEN ( ).
  486. hQuery:GET-FIRST ( ).
  487. DO WHILE NOT hQuery:QUERY-OFF-END:
  488. IF hQuery:FIRST-OF(2) THEN nTotGewicht = 0.
  489. nTotGewicht = nTotGewicht + Aufko.Gewicht NO-ERROR .
  490. IF hQuery:LAST-OF(2) THEN
  491. DO:
  492. CREATE tAufko.
  493. ASSIGN tAufko.Firma = Aufko.Firma
  494. tAufko.Aufnr = Aufko.Aufnr
  495. tAufko.Gewicht = nTotGewicht.
  496. END.
  497. hQuery:GET-NEXT ().
  498. END.
  499. END FUNCTION.
  500. /* _UIB-CODE-BLOCK-END */
  501. &ANALYZE-RESUME