Listing: 1 IMPLEMENTATION MODULE Gas; 2 (* 3 * ModBase 4 * Release 3.0 5 * (c) Copyright 1986 - 1991 PMI 6 * P.O. Box 8402 7 * Green Bay Wi 53308 8 * All Rights Reserved 9 * by Ed Ross 10 *) 11 12 13 14 FROM ModBase3 IMPORT AppendBlank,ReadDBRec, WriteDBRec,Record; 15 FROM NumTypes IMPORT Real8,REALToReal8; 16 FROM DBFGas IMPORT GasRec,MoveGasFromDBF,MoveGasToDBF; 17 FROM LowLevel IMPORT Fill; 18 FROM StrEdit IMPORT Append,OverWrite,AssignStr; 19 FROM StrConv IMPORT CardinalToStr; 20 FROM M2Strings IMPORT CompareStr,Assign; 21 FROM ScrnUtl2 IMPORT CloseDisplayFrame; 22 FROM ScrnUtl1 IMPORT GetFieldRec,PutFieldRec,FieldNum,FieldListTotal; 23 FROM ScrnTypes IMPORT DisplayFrame,InitDisplayFrame,AFrameName, 24 DispCode,ContinueInput,CancelInput,SubmitInput,InputFieldRecord; 25 FROM FramePainter IMPORT ShowDisplayFrame,RedrawField; 26 FROM Prompts IMPORT PromptYN,Prompt,PromptNum; 27 FROM ControlUtils IMPORT Control,AddStrField,AddMenuItem; 28 FROM PMIGlobals IMPORT Today,TodayP30,TodayP30Str,Config, 29 OpenReportDevice,CloseReportDevice,NormalTitle; 30 FROM SYSTEM IMPORT ADR,SIZE; 31 FROM PosUtils IMPORT Equal; 32 FROM GenLists IMPORT ListLength,GenList,DisposeList,GetElmtAdr, 33 SortList,GetElmt,NilList; 34 FROM DateFunctions IMPORT Date,DaysSince1900,DateToStr; 35 FROM DBStuff IMPORT ConditionType,MakeKey,FindAll,ReadAllRecs,DeleteAllRecs; 36 FROM DBUtils IMPORT PrintFrame; 37 FROM Customer IMPORT GetCurrCustName; 38 FROM DBFGas IMPORT GasRec,GasDBF,GasIdx,OpenGasDBF,CloseGasDBF, ***** ^ duplicate identifier ***** ^ duplicate identifier 39 GasOutIdx,GasInIdx; 40 FROM SYSTEM IMPORT SIZE,ADDRESS; ***** ^ duplicate identifier ***** ^ duplicate identifier 41 FROM VWindows IMPORT CurrentWindow; 42 43 FROM Storage IMPORT ALLOCATE; 44 45 TYPE 46 FGasRec = RECORD 47 Gas: GasRec; 48 LI : LONGINT; 49 END; ***** ^ not supported yet 50 51 PROCEDURE SortByDate (P1 : ADDRESS; C1 :CARDINAL; P2 : ADDRESS; C2 : CARDINAL): INTEGER; 52 VAR 53 Gas1, Gas2 : POINTER TO FGasRec; ***** ^ not supported yet 54 BEGIN 55 Gas1 := P1; (* sort by invoice by item types *) ***** ^ not supported yet ***** ^ not supported yet 56 Gas2 := P2; ***** ^ not supported yet ***** ^ not supported yet 57 IF Equal(Gas1^.Gas.INVNBR,Gas2^.Gas.INVNBR) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 58 THEN 59 RETURN CompareStr(Gas1^.Gas.ITEMNBR,Gas2^.Gas.ITEMNBR) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 60 ELSE 61 RETURN CompareStr(Gas1^.Gas.INVNBR,Gas2^.Gas.INVNBR); (* inv numbers sort by date*) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 62 END; 63 END SortByDate; ***** ^ not supported yet 64 65 66 PROCEDURE ReadARec(VAR AddressOfRec : ADDRESS; 67 VAR SizeOfRec: CARDINAL); 68 69 VAR 70 P : POINTER TO FGasRec; ***** ^ not supported yet 71 BEGIN 72 SizeOfRec := SIZE(FGasRec); ***** ^ not supported yet ***** ^ not supported yet 73 ALLOCATE(P,SizeOfRec); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 74 MoveGasFromDBF(P^.Gas); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 75 P^.LI := Record(GasDBF); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 76 AddressOfRec := P; ***** ^ not supported yet ***** ^ not supported yet 77 END ReadARec; ***** ^ not supported yet 78 79 80 81 PROCEDURE DeleteGasFromInv(InvNbr : ARRAY OF CHAR); ***** ^ not supported yet 82 VAR 83 TheList : GenList; 84 J : CARDINAL; 85 LI : LONGINT; 86 Gas : GasRec; 87 Code : CARDINAL; 88 BEGIN 89 OpenGasDBF(TRUE); ***** ^ not supported yet ***** ^ not supported yet 90 MakeKey(InvNbr); ***** ^ not supported yet ***** ^ not supported yet 91 NilList(TheList); ***** ^ not supported yet ***** ^ not supported yet 92 FindAll(GasOutIdx,InvNbr,EQ,TheList); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 93 DeleteAllRecs(GasDBF,TheList); (* delete all recs from check out*) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 94 FindAll(GasInIdx,InvNbr,EQ,TheList); (* find any check in recs *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 95 IF ListLength(TheList) > 0 ***** ^ not supported yet ***** ^ not supported yet 96 THEN 97 FOR J := 1 TO ListLength(TheList) DO ***** ^ not supported yet ***** ^ not supported yet 98 GetElmt(TheList,J,LI,Code); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 99 ReadDBRec(GasDBF,LI); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 100 MoveGasFromDBF(Gas); ***** ^ not supported yet ***** ^ not supported yet 101 Gas.STATUS := 'O'; (* make outstanding*) ***** ^ not supported yet ***** ^ not supported yet 102 Gas.ININVNBR := ''; ***** ^ not supported yet ***** ^ not supported yet 103 MoveGasToDBF(Gas); ***** ^ not supported yet ***** ^ not supported yet 104 WriteDBRec(GasDBF); ***** ^ not supported yet ***** ^ not supported yet 105 END; 106 END; 107 DisposeList(TheList); ***** ^ not supported yet ***** ^ not supported yet 108 CloseGasDBF(); ***** ^ not supported yet ***** ^ not supported yet 109 END DeleteGasFromInv; ***** ^ not supported yet 110 111 112 113 114 PROCEDURE CheckOutGas(CustID,OutInvoiceNbr,InvtryItem : ARRAY OF CHAR; ***** ^ not supported yet 115 Quant : CARDINAL;InvDate: Date); 116 VAR 117 Rec : GasRec; 118 J : CARDINAL; 119 BEGIN 120 OpenGasDBF(TRUE); ***** ^ not supported yet ***** ^ not supported yet 121 Fill(ADR(Rec),SIZE(Rec),0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 122 WITH Rec DO ***** ^ not supported yet 123 Assign( CustID,CIN ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 124 Assign( OutInvoiceNbr,INVNBR ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 125 Assign( InvtryItem,ITEMNBR); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 126 DATEOUT := InvDate; ***** ^ undeclared identifier ***** ^ not supported yet 127 DUEDATE := TodayP30; ***** ^ undeclared identifier ***** ^ not supported yet 128 STATUS := 'O'; ***** ^ undeclared identifier 129 END; ***** ^ not supported yet 130 131 FOR J := 1 TO Quant DO ***** ^ undeclared identifier ***** ^ undeclared identifier 132 AppendBlank(GasDBF); ***** ^ not supported yet ***** ^ not supported yet 133 MoveGasToDBF(Rec); ***** ^ not supported yet ***** ^ undeclared identifier 134 WriteDBRec(GasDBF); ***** ^ not supported yet ***** ^ not supported yet 135 END; 136 CloseGasDBF(); ***** ^ not supported yet ***** ^ not supported yet 137 END CheckOutGas; ***** ^ not supported yet 138 139 PROCEDURE GetGasByCust(CustID,InvtryItem : ARRAY OF CHAR;Status : CHAR; ***** ^ not supported yet 140 VAR TheList : GenList); 141 VAR 142 Str : ARRAY[0..30] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 143 J : CARDINAL; 144 BEGIN 145 Assign(CustID,Str ); (* form the partial key *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 146 Append(Str,Status); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 147 Append(Str,InvtryItem); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 148 MakeKey(Str); (* upcase remove blanks *) ***** ^ not supported yet ***** ^ not supported yet 149 NilList(TheList); ***** ^ not supported yet ***** ^ not supported yet 150 FindAll(GasIdx,Str,BeginsWith,TheList); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 151 ReadAllRecs(GasDBF,ReadARec,TheList); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 152 SortList(TheList,SortByDate); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 153 END GetGasByCust; ***** ^ not supported yet 154 155 156 PROCEDURE CheckInGas(CustID,InInvoiceNbr,InvtryItem: ARRAY OF CHAR; ***** ^ not supported yet 157 Quant : CARDINAL; InvDate : Date); 158 VAR 159 OutList : GenList; 160 J : CARDINAL; 161 Size, Code : CARDINAL; 162 LL : CARDINAL; 163 Str : ARRAY[0..30] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 164 Str2 : ARRAY[0..5] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 165 Rec : POINTER TO FGasRec; ***** ^ not supported yet 166 D1,D2 : CARDINAL; 167 BEGIN 168 OpenGasDBF(TRUE); ***** ^ not supported yet ***** ^ not supported yet 169 InvtryItem[1] := '0'; (* find by the size checkout *) ***** ^ not supported yet ***** ^ not supported yet 170 GetGasByCust(CustID,InvtryItem,'O',OutList); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 171 172 LL := ListLength(OutList); ***** ^ not supported yet ***** ^ not supported yet 173 IF Quant <= LL (* can handle this - more tanks out than turned in*) 174 THEN 175 FOR J := 1 TO Quant DO 176 GetElmtAdr(OutList,J,Rec,Size,Code); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 177 Rec^.Gas.DATEIN := InvDate; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 178 Assign( InInvoiceNbr,Rec^.Gas.ININVNBR ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 179 Rec^.Gas.STATUS := 'I'; (* change status *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 180 D2 := DaysSince1900(Rec^.Gas.DUEDATE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 181 D1 := DaysSince1900(Rec^.Gas.DATEIN); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 182 IF D1 > D2 183 THEN 184 Rec^.Gas.DAYSLATE := D1 - D2; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 185 END; 186 ReadDBRec(GasDBF,Rec^.LI); (* position the database *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 187 MoveGasToDBF(Rec^.Gas); (* update the record *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 188 WriteDBRec(GasDBF); ***** ^ not supported yet ***** ^ not supported yet 189 END; (* end of for *) 190 ELSE (* here were in trouble - the cust wants to return more*) 191 (* tanks than what I have recored as outstanding *) 192 D1 := Quant - LL; (* number to be checked in without being checkou*) 193 CardinalToStr(D1,4,Str2); ***** ^ not supported yet ***** ^ not supported yet 194 Str := ' WARNING - '; ***** ^ not supported yet ***** ^ not supported yet 195 Append(Str,Str2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 196 Append(Str,' More tanks checked out than on record'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 197 Prompt(Str); ***** ^ not supported yet ***** ^ not supported yet 198 CheckOutGas(CustID,'??????',InvtryItem,D1,InvDate); (* check out with out an in*) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 199 (* make a recursive call to check in - this time it should work*) 200 CheckInGas(CustID,InInvoiceNbr,InvtryItem,Quant,InvDate); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 201 END; 202 203 CloseGasDBF(); ***** ^ not supported yet ***** ^ not supported yet 204 END CheckInGas; ***** ^ not supported yet 205 206 207 208 209 PROCEDURE GasAmountDue(CustID, InvtryItem : ARRAY OF CHAR;Quant : CARDINAL; ***** ^ not supported yet 210 InvDate : Date; 211 VAR AmountDue : Real8; 212 VAR Notes : ARRAY OF CHAR); (* filled in if late*) ***** ^ not supported yet 213 VAR Str : ARRAY[0..40] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 214 Str2 : ARRAY[0..5] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 215 DaysLate : CARDINAL; 216 List : GenList; 217 Rec : POINTER TO FGasRec; ***** ^ not supported yet 218 J, Size,Code : CARDINAL; 219 D1, D2 : CARDINAL; 220 DL : Real8; 221 BEGIN 222 OpenGasDBF(TRUE); ***** ^ not supported yet ***** ^ not supported yet 223 InvtryItem[1] := '0'; (* make it look like a check out *) ***** ^ not supported yet ***** ^ not supported yet 224 GetGasByCust(CustID,InvtryItem,'O',List); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 225 DaysLate := 0; 226 D1 := DaysSince1900(InvDate); ***** ^ not supported yet ***** ^ not supported yet 227 IF Quant > ListLength(List) ***** ^ not supported yet ***** ^ not supported yet 228 THEN Quant := ListLength(List); ***** ^ not supported yet ***** ^ not supported yet 229 END; 230 FOR J := 1 TO Quant DO 231 GetElmtAdr(List,J,Rec,Size,Code); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 232 D2 := DaysSince1900(Rec^.Gas.DUEDATE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 233 IF D1 > D2 (* late *) 234 235 THEN 236 Str := 'Tank late by '; ***** ^ not supported yet ***** ^ not supported yet 237 CardinalToStr(D1-D2,5,Str2); ***** ^ not supported yet ***** ^ not supported yet 238 Append(Str,Str2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 239 Append(Str,' Days - Charge for '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 240 DaysLate := DaysLate + PromptNum(Str,D1 - D2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 241 END; 242 END; (* end for J := quant *) 243 244 DL := REALToReal8(FLOAT(DaysLate)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 245 AmountDue := DL * Config.OvertimeCharge; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 246 IF DaysLate > 0 247 THEN 248 AssignStr( 'Late charge for ',Notes); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 249 CardinalToStr(DaysLate,3,Str); ***** ^ not supported yet ***** ^ not supported yet 250 Append(Str,Notes); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 251 Append(Notes,' tank days '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 252 END; 253 DisposeList(List); ***** ^ not supported yet ***** ^ not supported yet 254 CloseGasDBF(); ***** ^ not supported yet ***** ^ not supported yet 255 END GasAmountDue; ***** ^ not supported yet 256 257 258 259 260 PROCEDURE ListOutstanding(CustID : ARRAY OF CHAR); ***** ^ not supported yet 261 CONST 262 Title = 263 ' Tank Size Invoice Out Invoice Date Due Date '; ***** ^ not supported yet 264 (* 265 0123456789012345678901234567890123456789012345678901234567890*) 266 267 VAR 268 DF : DisplayFrame; 269 Handle : CARDINAL; 270 Line : ARRAY[0..80] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 271 Str : ARRAY [0..20] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 272 Rec : POINTER TO FGasRec; ***** ^ not supported yet 273 B : BOOLEAN; 274 J : CARDINAL; 275 Code,Size : CARDINAL; 276 FieldRec : InputFieldRecord; 277 List : GenList; 278 Title1 : ARRAY[0..80] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 279 280 BEGIN 281 282 OpenGasDBF(TRUE); ***** ^ not supported yet ***** ^ not supported yet 283 GetGasByCust(CustID,'','O',List); (* get all items *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 284 CloseGasDBF(); ***** ^ not supported yet ***** ^ not supported yet 285 286 InitDisplayFrame(DF,CurrentWindow); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 287 AddStrField(DF,2,2,Title,75); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 288 GetFieldRec(DF,1,FieldRec); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 289 FieldRec.typ := DispCode; (* headline = display code *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 290 PutFieldRec(FieldRec,DF,1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 291 DF^.headline := 2; ***** ^ not supported yet ***** ^ not supported yet 292 IF ListLength(List) > 0 (* some tanks are outstanding *) ***** ^ not supported yet ***** ^ not supported yet 293 THEN 294 FOR J := 1 TO ListLength(List) DO ***** ^ not supported yet ***** ^ not supported yet 295 GetElmtAdr(List,J,Rec,Size,Code); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 296 Fill(ADR(Line),SIZE(Line),' '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 297 OverWrite(Rec^.Gas.ITEMNBR,Line,1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 298 OverWrite(Rec^.Gas.INVNBR,Line,14); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 299 DateToStr(Rec^.Gas.DATEOUT,Str,B); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 300 OverWrite(Str,Line,29); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 301 DateToStr(Rec^.Gas.DUEDATE,Str,B); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 302 OverWrite(Str,Line,47); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 303 AddMenuItem(DF,2,J+2,Line,78,0,' '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 304 END; 305 ShowDisplayFrame(DF,1,13,80,24); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 306 Control(DF); ***** ^ not supported yet ***** ^ not supported yet 307 IF PromptYN('Do you wish to print Y/N?',DF) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 308 THEN 309 GetCurrCustName(Title1); ***** ^ not supported yet ***** ^ not supported yet 310 Append(Title1,' - Gas Outstanding'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 311 Handle := OpenReportDevice(); ***** ^ not supported yet ***** ^ not supported yet 312 NormalTitle(Title1); ***** ^ not supported yet ***** ^ not supported yet 313 314 PrintFrame(DF,Handle); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 315 CloseReportDevice(Handle); ***** ^ not supported yet ***** ^ not supported yet 316 END; 317 318 END; (* end of if > 0 *) 319 CloseDisplayFrame(DF); ***** ^ not supported yet ***** ^ not supported yet 320 DisposeList(List); ***** ^ not supported yet ***** ^ not supported yet 321 322 END ListOutstanding; ***** ^ not supported yet 323 324 PROCEDURE ListHistory(CustID : ARRAY OF CHAR; DF1 : DisplayFrame); ***** ^ not supported yet 325 CONST 326 Title = 327 ' Size InvoiceOut DateOut DueDate InvoiceIn DateIn DaysLate Charge '; ***** ^ not supported yet 328 (* 329 0123456789012345678901234567890123456789012345678901234567890*) 330 331 VAR 332 DF : DisplayFrame; 333 Line : ARRAY[0..80] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 334 Str : ARRAY [0..20] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 335 Rec : POINTER TO FGasRec; ***** ^ not supported yet 336 B : BOOLEAN; 337 J : CARDINAL; 338 Code,Size : CARDINAL; 339 FieldRec : InputFieldRecord; 340 List : GenList; 341 Title1 : ARRAY[0..80] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 342 Handle : CARDINAL; 343 344 BEGIN 345 IF NOT PromptYN('Warning Display gas history could take several minutes',DF1) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 346 THEN 347 RETURN 348 END; 349 OpenGasDBF(TRUE); ***** ^ not supported yet ***** ^ not supported yet 350 GetGasByCust(CustID,'','I',List); (* get all items *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 351 CloseGasDBF(); ***** ^ not supported yet ***** ^ not supported yet 352 353 InitDisplayFrame(DF,CurrentWindow); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 354 AddStrField(DF,2,2,Title,75); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 355 GetFieldRec(DF,1,FieldRec); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 356 FieldRec.typ := DispCode; (* headline = display code *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 357 PutFieldRec(FieldRec,DF,1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 358 DF^.headline := 2; ***** ^ not supported yet ***** ^ not supported yet 359 IF ListLength(List) > 0 (* some tanks are outstanding *) ***** ^ not supported yet ***** ^ not supported yet 360 THEN 361 FOR J := 1 TO ListLength(List) DO ***** ^ not supported yet ***** ^ not supported yet 362 (*************************************************************************** 363 Size InvoiceOut DateOut DueDate InvoiceIn DateIn DaysLate Charge '; 364 0123456789012345678901234567890123456789012345678901234567890123456781234567*) 365 366 GetElmtAdr(List,J,Rec,Size,Code); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 367 Fill(ADR(Line),SIZE(Line),' '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 368 OverWrite(Rec^.Gas.ITEMNBR,Line,1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 369 OverWrite(Rec^.Gas.INVNBR,Line,8); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 370 DateToStr(Rec^.Gas.DATEOUT,Str,B); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 371 OverWrite(Str,Line,20); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 372 DateToStr(Rec^.Gas.DUEDATE,Str,B); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 373 OverWrite(Str,Line,29); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 374 OverWrite(Rec^.Gas.ININVNBR,Line,38); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 375 DateToStr(Rec^.Gas.DATEIN,Str,B); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 376 OverWrite(Str,Line,49); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 377 CardinalToStr(Rec^.Gas.DAYSLATE,4,Str); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 378 OverWrite(Str,Line,60); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 379 AddMenuItem(DF,2,J+2,Line,78,0,' '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 380 END; 381 ShowDisplayFrame(DF,1,13,80,24); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 382 Control(DF); ***** ^ not supported yet ***** ^ not supported yet 383 IF PromptYN('Do you wish to print Y/N?',DF) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 384 THEN 385 GetCurrCustName(Title1); ***** ^ not supported yet ***** ^ not supported yet 386 Append(Title1,' - Gas History'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 387 NormalTitle(Title1); ***** ^ not supported yet ***** ^ not supported yet 388 Handle := OpenReportDevice(); ***** ^ not supported yet ***** ^ not supported yet 389 PrintFrame(DF,Handle); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 390 CloseReportDevice(Handle); ***** ^ not supported yet ***** ^ not supported yet 391 END; 392 393 END; (* end of if > 0 *) 394 CloseDisplayFrame(DF); ***** ^ not supported yet ***** ^ not supported yet 395 DisposeList(List); ***** ^ not supported yet ***** ^ not supported yet 396 397 END ListHistory; ***** ^ not supported yet 398 END Gas. ***** ^ not supported yet 554 errors