GAS.LST 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  1. Listing:
  2. 1 IMPLEMENTATION MODULE Gas;
  3. 2 (*
  4. 3 * ModBase
  5. 4 * Release 3.0
  6. 5 * (c) Copyright 1986 - 1991 PMI
  7. 6 * P.O. Box 8402
  8. 7 * Green Bay Wi 53308
  9. 8 * All Rights Reserved
  10. 9 * by Ed Ross
  11. 10 *)
  12. 11
  13. 12
  14. 13
  15. 14 FROM ModBase3 IMPORT AppendBlank,ReadDBRec, WriteDBRec,Record;
  16. 15 FROM NumTypes IMPORT Real8,REALToReal8;
  17. 16 FROM DBFGas IMPORT GasRec,MoveGasFromDBF,MoveGasToDBF;
  18. 17 FROM LowLevel IMPORT Fill;
  19. 18 FROM StrEdit IMPORT Append,OverWrite,AssignStr;
  20. 19 FROM StrConv IMPORT CardinalToStr;
  21. 20 FROM M2Strings IMPORT CompareStr,Assign;
  22. 21 FROM ScrnUtl2 IMPORT CloseDisplayFrame;
  23. 22 FROM ScrnUtl1 IMPORT GetFieldRec,PutFieldRec,FieldNum,FieldListTotal;
  24. 23 FROM ScrnTypes IMPORT DisplayFrame,InitDisplayFrame,AFrameName,
  25. 24 DispCode,ContinueInput,CancelInput,SubmitInput,InputFieldRecord;
  26. 25 FROM FramePainter IMPORT ShowDisplayFrame,RedrawField;
  27. 26 FROM Prompts IMPORT PromptYN,Prompt,PromptNum;
  28. 27 FROM ControlUtils IMPORT Control,AddStrField,AddMenuItem;
  29. 28 FROM PMIGlobals IMPORT Today,TodayP30,TodayP30Str,Config,
  30. 29 OpenReportDevice,CloseReportDevice,NormalTitle;
  31. 30 FROM SYSTEM IMPORT ADR,SIZE;
  32. 31 FROM PosUtils IMPORT Equal;
  33. 32 FROM GenLists IMPORT ListLength,GenList,DisposeList,GetElmtAdr,
  34. 33 SortList,GetElmt,NilList;
  35. 34 FROM DateFunctions IMPORT Date,DaysSince1900,DateToStr;
  36. 35 FROM DBStuff IMPORT ConditionType,MakeKey,FindAll,ReadAllRecs,DeleteAllRecs;
  37. 36 FROM DBUtils IMPORT PrintFrame;
  38. 37 FROM Customer IMPORT GetCurrCustName;
  39. 38 FROM DBFGas IMPORT GasRec,GasDBF,GasIdx,OpenGasDBF,CloseGasDBF,
  40. ***** ^ duplicate identifier
  41. ***** ^ duplicate identifier
  42. 39 GasOutIdx,GasInIdx;
  43. 40 FROM SYSTEM IMPORT SIZE,ADDRESS;
  44. ***** ^ duplicate identifier
  45. ***** ^ duplicate identifier
  46. 41 FROM VWindows IMPORT CurrentWindow;
  47. 42
  48. 43 FROM Storage IMPORT ALLOCATE;
  49. 44
  50. 45 TYPE
  51. 46 FGasRec = RECORD
  52. 47 Gas: GasRec;
  53. 48 LI : LONGINT;
  54. 49 END;
  55. ***** ^ not supported yet
  56. 50
  57. 51 PROCEDURE SortByDate (P1 : ADDRESS; C1 :CARDINAL; P2 : ADDRESS; C2 : CARDINAL): INTEGER;
  58. 52 VAR
  59. 53 Gas1, Gas2 : POINTER TO FGasRec;
  60. ***** ^ not supported yet
  61. 54 BEGIN
  62. 55 Gas1 := P1; (* sort by invoice by item types *)
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. 56 Gas2 := P2;
  66. ***** ^ not supported yet
  67. ***** ^ not supported yet
  68. 57 IF Equal(Gas1^.Gas.INVNBR,Gas2^.Gas.INVNBR)
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. ***** ^ not supported yet
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. ***** ^ not supported yet
  76. 58 THEN
  77. 59 RETURN CompareStr(Gas1^.Gas.ITEMNBR,Gas2^.Gas.ITEMNBR)
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. 60 ELSE
  86. 61 RETURN CompareStr(Gas1^.Gas.INVNBR,Gas2^.Gas.INVNBR); (* inv numbers sort by date*)
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. ***** ^ not supported yet
  94. 62 END;
  95. 63 END SortByDate;
  96. ***** ^ not supported yet
  97. 64
  98. 65
  99. 66 PROCEDURE ReadARec(VAR AddressOfRec : ADDRESS;
  100. 67 VAR SizeOfRec: CARDINAL);
  101. 68
  102. 69 VAR
  103. 70 P : POINTER TO FGasRec;
  104. ***** ^ not supported yet
  105. 71 BEGIN
  106. 72 SizeOfRec := SIZE(FGasRec);
  107. ***** ^ not supported yet
  108. ***** ^ not supported yet
  109. 73 ALLOCATE(P,SizeOfRec);
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. 74 MoveGasFromDBF(P^.Gas);
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. 75 P^.LI := Record(GasDBF);
  118. ***** ^ not supported yet
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. ***** ^ not supported yet
  122. 76 AddressOfRec := P;
  123. ***** ^ not supported yet
  124. ***** ^ not supported yet
  125. 77 END ReadARec;
  126. ***** ^ not supported yet
  127. 78
  128. 79
  129. 80
  130. 81 PROCEDURE DeleteGasFromInv(InvNbr : ARRAY OF CHAR);
  131. ***** ^ not supported yet
  132. 82 VAR
  133. 83 TheList : GenList;
  134. 84 J : CARDINAL;
  135. 85 LI : LONGINT;
  136. 86 Gas : GasRec;
  137. 87 Code : CARDINAL;
  138. 88 BEGIN
  139. 89 OpenGasDBF(TRUE);
  140. ***** ^ not supported yet
  141. ***** ^ not supported yet
  142. 90 MakeKey(InvNbr);
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. 91 NilList(TheList);
  146. ***** ^ not supported yet
  147. ***** ^ not supported yet
  148. 92 FindAll(GasOutIdx,InvNbr,EQ,TheList);
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. ***** ^ undeclared identifier
  153. ***** ^ not supported yet
  154. 93 DeleteAllRecs(GasDBF,TheList); (* delete all recs from check out*)
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. 94 FindAll(GasInIdx,InvNbr,EQ,TheList); (* find any check in recs *)
  159. ***** ^ not supported yet
  160. ***** ^ not supported yet
  161. ***** ^ not supported yet
  162. ***** ^ undeclared identifier
  163. ***** ^ not supported yet
  164. 95 IF ListLength(TheList) > 0
  165. ***** ^ not supported yet
  166. ***** ^ not supported yet
  167. 96 THEN
  168. 97 FOR J := 1 TO ListLength(TheList) DO
  169. ***** ^ not supported yet
  170. ***** ^ not supported yet
  171. 98 GetElmt(TheList,J,LI,Code);
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. 99 ReadDBRec(GasDBF,LI);
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. 100 MoveGasFromDBF(Gas);
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. 101 Gas.STATUS := 'O'; (* make outstanding*)
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. 102 Gas.ININVNBR := '';
  186. ***** ^ not supported yet
  187. ***** ^ not supported yet
  188. 103 MoveGasToDBF(Gas);
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. 104 WriteDBRec(GasDBF);
  192. ***** ^ not supported yet
  193. ***** ^ not supported yet
  194. 105 END;
  195. 106 END;
  196. 107 DisposeList(TheList);
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 108 CloseGasDBF();
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. 109 END DeleteGasFromInv;
  203. ***** ^ not supported yet
  204. 110
  205. 111
  206. 112
  207. 113
  208. 114 PROCEDURE CheckOutGas(CustID,OutInvoiceNbr,InvtryItem : ARRAY OF CHAR;
  209. ***** ^ not supported yet
  210. 115 Quant : CARDINAL;InvDate: Date);
  211. 116 VAR
  212. 117 Rec : GasRec;
  213. 118 J : CARDINAL;
  214. 119 BEGIN
  215. 120 OpenGasDBF(TRUE);
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. 121 Fill(ADR(Rec),SIZE(Rec),0);
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. 122 WITH Rec DO
  226. ***** ^ not supported yet
  227. 123 Assign( CustID,CIN );
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ undeclared identifier
  231. 124 Assign( OutInvoiceNbr,INVNBR );
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ undeclared identifier
  235. 125 Assign( InvtryItem,ITEMNBR);
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. ***** ^ undeclared identifier
  239. 126 DATEOUT := InvDate;
  240. ***** ^ undeclared identifier
  241. ***** ^ not supported yet
  242. 127 DUEDATE := TodayP30;
  243. ***** ^ undeclared identifier
  244. ***** ^ not supported yet
  245. 128 STATUS := 'O';
  246. ***** ^ undeclared identifier
  247. 129 END;
  248. ***** ^ not supported yet
  249. 130
  250. 131 FOR J := 1 TO Quant DO
  251. ***** ^ undeclared identifier
  252. ***** ^ undeclared identifier
  253. 132 AppendBlank(GasDBF);
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. 133 MoveGasToDBF(Rec);
  257. ***** ^ not supported yet
  258. ***** ^ undeclared identifier
  259. 134 WriteDBRec(GasDBF);
  260. ***** ^ not supported yet
  261. ***** ^ not supported yet
  262. 135 END;
  263. 136 CloseGasDBF();
  264. ***** ^ not supported yet
  265. ***** ^ not supported yet
  266. 137 END CheckOutGas;
  267. ***** ^ not supported yet
  268. 138
  269. 139 PROCEDURE GetGasByCust(CustID,InvtryItem : ARRAY OF CHAR;Status : CHAR;
  270. ***** ^ not supported yet
  271. 140 VAR TheList : GenList);
  272. 141 VAR
  273. 142 Str : ARRAY[0..30] OF CHAR;
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. 143 J : CARDINAL;
  277. 144 BEGIN
  278. 145 Assign(CustID,Str ); (* form the partial key *)
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. 146 Append(Str,Status);
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. 147 Append(Str,InvtryItem);
  287. ***** ^ not supported yet
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. 148 MakeKey(Str); (* upcase remove blanks *)
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. 149 NilList(TheList);
  294. ***** ^ not supported yet
  295. ***** ^ not supported yet
  296. 150 FindAll(GasIdx,Str,BeginsWith,TheList);
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. ***** ^ undeclared identifier
  301. ***** ^ not supported yet
  302. 151 ReadAllRecs(GasDBF,ReadARec,TheList);
  303. ***** ^ not supported yet
  304. ***** ^ not supported yet
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. 152 SortList(TheList,SortByDate);
  308. ***** ^ not supported yet
  309. ***** ^ not supported yet
  310. ***** ^ not supported yet
  311. 153 END GetGasByCust;
  312. ***** ^ not supported yet
  313. 154
  314. 155
  315. 156 PROCEDURE CheckInGas(CustID,InInvoiceNbr,InvtryItem: ARRAY OF CHAR;
  316. ***** ^ not supported yet
  317. 157 Quant : CARDINAL; InvDate : Date);
  318. 158 VAR
  319. 159 OutList : GenList;
  320. 160 J : CARDINAL;
  321. 161 Size, Code : CARDINAL;
  322. 162 LL : CARDINAL;
  323. 163 Str : ARRAY[0..30] OF CHAR;
  324. ***** ^ not supported yet
  325. ***** ^ not supported yet
  326. 164 Str2 : ARRAY[0..5] OF CHAR;
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. 165 Rec : POINTER TO FGasRec;
  330. ***** ^ not supported yet
  331. 166 D1,D2 : CARDINAL;
  332. 167 BEGIN
  333. 168 OpenGasDBF(TRUE);
  334. ***** ^ not supported yet
  335. ***** ^ not supported yet
  336. 169 InvtryItem[1] := '0'; (* find by the size checkout *)
  337. ***** ^ not supported yet
  338. ***** ^ not supported yet
  339. 170 GetGasByCust(CustID,InvtryItem,'O',OutList);
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. ***** ^ not supported yet
  343. ***** ^ not supported yet
  344. 171
  345. 172 LL := ListLength(OutList);
  346. ***** ^ not supported yet
  347. ***** ^ not supported yet
  348. 173 IF Quant <= LL (* can handle this - more tanks out than turned in*)
  349. 174 THEN
  350. 175 FOR J := 1 TO Quant DO
  351. 176 GetElmtAdr(OutList,J,Rec,Size,Code);
  352. ***** ^ not supported yet
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. 177 Rec^.Gas.DATEIN := InvDate;
  357. ***** ^ not supported yet
  358. ***** ^ not supported yet
  359. ***** ^ not supported yet
  360. ***** ^ not supported yet
  361. 178 Assign( InInvoiceNbr,Rec^.Gas.ININVNBR );
  362. ***** ^ not supported yet
  363. ***** ^ not supported yet
  364. ***** ^ not supported yet
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. 179 Rec^.Gas.STATUS := 'I'; (* change status *)
  368. ***** ^ not supported yet
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. 180 D2 := DaysSince1900(Rec^.Gas.DUEDATE);
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. ***** ^ not supported yet
  376. 181 D1 := DaysSince1900(Rec^.Gas.DATEIN);
  377. ***** ^ not supported yet
  378. ***** ^ not supported yet
  379. ***** ^ not supported yet
  380. ***** ^ not supported yet
  381. 182 IF D1 > D2
  382. 183 THEN
  383. 184 Rec^.Gas.DAYSLATE := D1 - D2;
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. 185 END;
  388. 186 ReadDBRec(GasDBF,Rec^.LI); (* position the database *)
  389. ***** ^ not supported yet
  390. ***** ^ not supported yet
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. 187 MoveGasToDBF(Rec^.Gas); (* update the record *)
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. 188 WriteDBRec(GasDBF);
  398. ***** ^ not supported yet
  399. ***** ^ not supported yet
  400. 189 END; (* end of for *)
  401. 190 ELSE (* here were in trouble - the cust wants to return more*)
  402. 191 (* tanks than what I have recored as outstanding *)
  403. 192 D1 := Quant - LL; (* number to be checked in without being checkou*)
  404. 193 CardinalToStr(D1,4,Str2);
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. 194 Str := ' WARNING - ';
  408. ***** ^ not supported yet
  409. ***** ^ not supported yet
  410. 195 Append(Str,Str2);
  411. ***** ^ not supported yet
  412. ***** ^ not supported yet
  413. ***** ^ not supported yet
  414. 196 Append(Str,' More tanks checked out than on record');
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. 197 Prompt(Str);
  419. ***** ^ not supported yet
  420. ***** ^ not supported yet
  421. 198 CheckOutGas(CustID,'??????',InvtryItem,D1,InvDate); (* check out with out an in*)
  422. ***** ^ not supported yet
  423. ***** ^ not supported yet
  424. ***** ^ not supported yet
  425. ***** ^ not supported yet
  426. ***** ^ not supported yet
  427. 199 (* make a recursive call to check in - this time it should work*)
  428. 200 CheckInGas(CustID,InInvoiceNbr,InvtryItem,Quant,InvDate);
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. ***** ^ not supported yet
  432. ***** ^ not supported yet
  433. ***** ^ not supported yet
  434. 201 END;
  435. 202
  436. 203 CloseGasDBF();
  437. ***** ^ not supported yet
  438. ***** ^ not supported yet
  439. 204 END CheckInGas;
  440. ***** ^ not supported yet
  441. 205
  442. 206
  443. 207
  444. 208
  445. 209 PROCEDURE GasAmountDue(CustID, InvtryItem : ARRAY OF CHAR;Quant : CARDINAL;
  446. ***** ^ not supported yet
  447. 210 InvDate : Date;
  448. 211 VAR AmountDue : Real8;
  449. 212 VAR Notes : ARRAY OF CHAR); (* filled in if late*)
  450. ***** ^ not supported yet
  451. 213 VAR Str : ARRAY[0..40] OF CHAR;
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. 214 Str2 : ARRAY[0..5] OF CHAR;
  455. ***** ^ not supported yet
  456. ***** ^ not supported yet
  457. 215 DaysLate : CARDINAL;
  458. 216 List : GenList;
  459. 217 Rec : POINTER TO FGasRec;
  460. ***** ^ not supported yet
  461. 218 J, Size,Code : CARDINAL;
  462. 219 D1, D2 : CARDINAL;
  463. 220 DL : Real8;
  464. 221 BEGIN
  465. 222 OpenGasDBF(TRUE);
  466. ***** ^ not supported yet
  467. ***** ^ not supported yet
  468. 223 InvtryItem[1] := '0'; (* make it look like a check out *)
  469. ***** ^ not supported yet
  470. ***** ^ not supported yet
  471. 224 GetGasByCust(CustID,InvtryItem,'O',List);
  472. ***** ^ not supported yet
  473. ***** ^ not supported yet
  474. ***** ^ not supported yet
  475. ***** ^ not supported yet
  476. 225 DaysLate := 0;
  477. 226 D1 := DaysSince1900(InvDate);
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. 227 IF Quant > ListLength(List)
  481. ***** ^ not supported yet
  482. ***** ^ not supported yet
  483. 228 THEN Quant := ListLength(List);
  484. ***** ^ not supported yet
  485. ***** ^ not supported yet
  486. 229 END;
  487. 230 FOR J := 1 TO Quant DO
  488. 231 GetElmtAdr(List,J,Rec,Size,Code);
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. 232 D2 := DaysSince1900(Rec^.Gas.DUEDATE);
  494. ***** ^ not supported yet
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. ***** ^ not supported yet
  498. 233 IF D1 > D2 (* late *)
  499. 234
  500. 235 THEN
  501. 236 Str := 'Tank late by ';
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. 237 CardinalToStr(D1-D2,5,Str2);
  505. ***** ^ not supported yet
  506. ***** ^ not supported yet
  507. 238 Append(Str,Str2);
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. ***** ^ not supported yet
  511. 239 Append(Str,' Days - Charge for ');
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. 240 DaysLate := DaysLate + PromptNum(Str,D1 - D2);
  516. ***** ^ not supported yet
  517. ***** ^ not supported yet
  518. ***** ^ not supported yet
  519. 241 END;
  520. 242 END; (* end for J := quant *)
  521. 243
  522. 244 DL := REALToReal8(FLOAT(DaysLate));
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. ***** ^ undeclared identifier
  526. ***** ^ not supported yet
  527. 245 AmountDue := DL * Config.OvertimeCharge;
  528. ***** ^ not supported yet
  529. ***** ^ not supported yet
  530. ***** ^ not supported yet
  531. ***** ^ not supported yet
  532. 246 IF DaysLate > 0
  533. 247 THEN
  534. 248 AssignStr( 'Late charge for ',Notes);
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. 249 CardinalToStr(DaysLate,3,Str);
  539. ***** ^ not supported yet
  540. ***** ^ not supported yet
  541. 250 Append(Str,Notes);
  542. ***** ^ not supported yet
  543. ***** ^ not supported yet
  544. ***** ^ not supported yet
  545. 251 Append(Notes,' tank days ');
  546. ***** ^ not supported yet
  547. ***** ^ not supported yet
  548. ***** ^ not supported yet
  549. 252 END;
  550. 253 DisposeList(List);
  551. ***** ^ not supported yet
  552. ***** ^ not supported yet
  553. 254 CloseGasDBF();
  554. ***** ^ not supported yet
  555. ***** ^ not supported yet
  556. 255 END GasAmountDue;
  557. ***** ^ not supported yet
  558. 256
  559. 257
  560. 258
  561. 259
  562. 260 PROCEDURE ListOutstanding(CustID : ARRAY OF CHAR);
  563. ***** ^ not supported yet
  564. 261 CONST
  565. 262 Title =
  566. 263 ' Tank Size Invoice Out Invoice Date Due Date ';
  567. ***** ^ not supported yet
  568. 264 (*
  569. 265 0123456789012345678901234567890123456789012345678901234567890*)
  570. 266
  571. 267 VAR
  572. 268 DF : DisplayFrame;
  573. 269 Handle : CARDINAL;
  574. 270 Line : ARRAY[0..80] OF CHAR;
  575. ***** ^ not supported yet
  576. ***** ^ not supported yet
  577. 271 Str : ARRAY [0..20] OF CHAR;
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. 272 Rec : POINTER TO FGasRec;
  581. ***** ^ not supported yet
  582. 273 B : BOOLEAN;
  583. 274 J : CARDINAL;
  584. 275 Code,Size : CARDINAL;
  585. 276 FieldRec : InputFieldRecord;
  586. 277 List : GenList;
  587. 278 Title1 : ARRAY[0..80] OF CHAR;
  588. ***** ^ not supported yet
  589. ***** ^ not supported yet
  590. 279
  591. 280 BEGIN
  592. 281
  593. 282 OpenGasDBF(TRUE);
  594. ***** ^ not supported yet
  595. ***** ^ not supported yet
  596. 283 GetGasByCust(CustID,'','O',List); (* get all items *)
  597. ***** ^ not supported yet
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. 284 CloseGasDBF();
  601. ***** ^ not supported yet
  602. ***** ^ not supported yet
  603. 285
  604. 286 InitDisplayFrame(DF,CurrentWindow);
  605. ***** ^ not supported yet
  606. ***** ^ not supported yet
  607. ***** ^ not supported yet
  608. 287 AddStrField(DF,2,2,Title,75);
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. ***** ^ not supported yet
  612. ***** ^ not supported yet
  613. 288 GetFieldRec(DF,1,FieldRec);
  614. ***** ^ not supported yet
  615. ***** ^ not supported yet
  616. ***** ^ not supported yet
  617. 289 FieldRec.typ := DispCode; (* headline = display code *)
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. ***** ^ not supported yet
  621. 290 PutFieldRec(FieldRec,DF,1);
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. 291 DF^.headline := 2;
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. 292 IF ListLength(List) > 0 (* some tanks are outstanding *)
  630. ***** ^ not supported yet
  631. ***** ^ not supported yet
  632. 293 THEN
  633. 294 FOR J := 1 TO ListLength(List) DO
  634. ***** ^ not supported yet
  635. ***** ^ not supported yet
  636. 295 GetElmtAdr(List,J,Rec,Size,Code);
  637. ***** ^ not supported yet
  638. ***** ^ not supported yet
  639. ***** ^ not supported yet
  640. ***** ^ not supported yet
  641. 296 Fill(ADR(Line),SIZE(Line),' ');
  642. ***** ^ not supported yet
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. ***** ^ not supported yet
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. 297 OverWrite(Rec^.Gas.ITEMNBR,Line,1);
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. ***** ^ not supported yet
  652. ***** ^ not supported yet
  653. ***** ^ not supported yet
  654. ***** ^ not supported yet
  655. 298 OverWrite(Rec^.Gas.INVNBR,Line,14);
  656. ***** ^ not supported yet
  657. ***** ^ not supported yet
  658. ***** ^ not supported yet
  659. ***** ^ not supported yet
  660. ***** ^ not supported yet
  661. ***** ^ not supported yet
  662. 299 DateToStr(Rec^.Gas.DATEOUT,Str,B);
  663. ***** ^ not supported yet
  664. ***** ^ not supported yet
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. ***** ^ not supported yet
  668. ***** ^ not supported yet
  669. 300 OverWrite(Str,Line,29);
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. ***** ^ not supported yet
  673. ***** ^ not supported yet
  674. 301 DateToStr(Rec^.Gas.DUEDATE,Str,B);
  675. ***** ^ not supported yet
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. 302 OverWrite(Str,Line,47);
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. ***** ^ not supported yet
  685. ***** ^ not supported yet
  686. 303 AddMenuItem(DF,2,J+2,Line,78,0,' ');
  687. ***** ^ not supported yet
  688. ***** ^ not supported yet
  689. ***** ^ not supported yet
  690. ***** ^ not supported yet
  691. 304 END;
  692. 305 ShowDisplayFrame(DF,1,13,80,24);
  693. ***** ^ not supported yet
  694. ***** ^ not supported yet
  695. ***** ^ not supported yet
  696. 306 Control(DF);
  697. ***** ^ not supported yet
  698. ***** ^ not supported yet
  699. 307 IF PromptYN('Do you wish to print Y/N?',DF)
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. ***** ^ not supported yet
  703. 308 THEN
  704. 309 GetCurrCustName(Title1);
  705. ***** ^ not supported yet
  706. ***** ^ not supported yet
  707. 310 Append(Title1,' - Gas Outstanding');
  708. ***** ^ not supported yet
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. 311 Handle := OpenReportDevice();
  712. ***** ^ not supported yet
  713. ***** ^ not supported yet
  714. 312 NormalTitle(Title1);
  715. ***** ^ not supported yet
  716. ***** ^ not supported yet
  717. 313
  718. 314 PrintFrame(DF,Handle);
  719. ***** ^ not supported yet
  720. ***** ^ not supported yet
  721. ***** ^ not supported yet
  722. 315 CloseReportDevice(Handle);
  723. ***** ^ not supported yet
  724. ***** ^ not supported yet
  725. 316 END;
  726. 317
  727. 318 END; (* end of if > 0 *)
  728. 319 CloseDisplayFrame(DF);
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. 320 DisposeList(List);
  732. ***** ^ not supported yet
  733. ***** ^ not supported yet
  734. 321
  735. 322 END ListOutstanding;
  736. ***** ^ not supported yet
  737. 323
  738. 324 PROCEDURE ListHistory(CustID : ARRAY OF CHAR; DF1 : DisplayFrame);
  739. ***** ^ not supported yet
  740. 325 CONST
  741. 326 Title =
  742. 327 ' Size InvoiceOut DateOut DueDate InvoiceIn DateIn DaysLate Charge ';
  743. ***** ^ not supported yet
  744. 328 (*
  745. 329 0123456789012345678901234567890123456789012345678901234567890*)
  746. 330
  747. 331 VAR
  748. 332 DF : DisplayFrame;
  749. 333 Line : ARRAY[0..80] OF CHAR;
  750. ***** ^ not supported yet
  751. ***** ^ not supported yet
  752. 334 Str : ARRAY [0..20] OF CHAR;
  753. ***** ^ not supported yet
  754. ***** ^ not supported yet
  755. 335 Rec : POINTER TO FGasRec;
  756. ***** ^ not supported yet
  757. 336 B : BOOLEAN;
  758. 337 J : CARDINAL;
  759. 338 Code,Size : CARDINAL;
  760. 339 FieldRec : InputFieldRecord;
  761. 340 List : GenList;
  762. 341 Title1 : ARRAY[0..80] OF CHAR;
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. 342 Handle : CARDINAL;
  766. 343
  767. 344 BEGIN
  768. 345 IF NOT PromptYN('Warning Display gas history could take several minutes',DF1)
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. 346 THEN
  773. 347 RETURN
  774. 348 END;
  775. 349 OpenGasDBF(TRUE);
  776. ***** ^ not supported yet
  777. ***** ^ not supported yet
  778. 350 GetGasByCust(CustID,'','I',List); (* get all items *)
  779. ***** ^ not supported yet
  780. ***** ^ not supported yet
  781. ***** ^ not supported yet
  782. 351 CloseGasDBF();
  783. ***** ^ not supported yet
  784. ***** ^ not supported yet
  785. 352
  786. 353 InitDisplayFrame(DF,CurrentWindow);
  787. ***** ^ not supported yet
  788. ***** ^ not supported yet
  789. ***** ^ not supported yet
  790. 354 AddStrField(DF,2,2,Title,75);
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. 355 GetFieldRec(DF,1,FieldRec);
  796. ***** ^ not supported yet
  797. ***** ^ not supported yet
  798. ***** ^ not supported yet
  799. 356 FieldRec.typ := DispCode; (* headline = display code *)
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. 357 PutFieldRec(FieldRec,DF,1);
  804. ***** ^ not supported yet
  805. ***** ^ not supported yet
  806. ***** ^ not supported yet
  807. ***** ^ not supported yet
  808. 358 DF^.headline := 2;
  809. ***** ^ not supported yet
  810. ***** ^ not supported yet
  811. 359 IF ListLength(List) > 0 (* some tanks are outstanding *)
  812. ***** ^ not supported yet
  813. ***** ^ not supported yet
  814. 360 THEN
  815. 361 FOR J := 1 TO ListLength(List) DO
  816. ***** ^ not supported yet
  817. ***** ^ not supported yet
  818. 362 (***************************************************************************
  819. 363 Size InvoiceOut DateOut DueDate InvoiceIn DateIn DaysLate Charge ';
  820. 364 0123456789012345678901234567890123456789012345678901234567890123456781234567*)
  821. 365
  822. 366 GetElmtAdr(List,J,Rec,Size,Code);
  823. ***** ^ not supported yet
  824. ***** ^ not supported yet
  825. ***** ^ not supported yet
  826. ***** ^ not supported yet
  827. 367 Fill(ADR(Line),SIZE(Line),' ');
  828. ***** ^ not supported yet
  829. ***** ^ not supported yet
  830. ***** ^ not supported yet
  831. ***** ^ not supported yet
  832. ***** ^ not supported yet
  833. ***** ^ not supported yet
  834. 368 OverWrite(Rec^.Gas.ITEMNBR,Line,1);
  835. ***** ^ not supported yet
  836. ***** ^ not supported yet
  837. ***** ^ not supported yet
  838. ***** ^ not supported yet
  839. ***** ^ not supported yet
  840. ***** ^ not supported yet
  841. 369 OverWrite(Rec^.Gas.INVNBR,Line,8);
  842. ***** ^ not supported yet
  843. ***** ^ not supported yet
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ not supported yet
  847. ***** ^ not supported yet
  848. 370 DateToStr(Rec^.Gas.DATEOUT,Str,B);
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. ***** ^ not supported yet
  853. ***** ^ not supported yet
  854. ***** ^ not supported yet
  855. 371 OverWrite(Str,Line,20);
  856. ***** ^ not supported yet
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. ***** ^ not supported yet
  860. 372 DateToStr(Rec^.Gas.DUEDATE,Str,B);
  861. ***** ^ not supported yet
  862. ***** ^ not supported yet
  863. ***** ^ not supported yet
  864. ***** ^ not supported yet
  865. ***** ^ not supported yet
  866. ***** ^ not supported yet
  867. 373 OverWrite(Str,Line,29);
  868. ***** ^ not supported yet
  869. ***** ^ not supported yet
  870. ***** ^ not supported yet
  871. ***** ^ not supported yet
  872. 374 OverWrite(Rec^.Gas.ININVNBR,Line,38);
  873. ***** ^ not supported yet
  874. ***** ^ not supported yet
  875. ***** ^ not supported yet
  876. ***** ^ not supported yet
  877. ***** ^ not supported yet
  878. ***** ^ not supported yet
  879. 375 DateToStr(Rec^.Gas.DATEIN,Str,B);
  880. ***** ^ not supported yet
  881. ***** ^ not supported yet
  882. ***** ^ not supported yet
  883. ***** ^ not supported yet
  884. ***** ^ not supported yet
  885. ***** ^ not supported yet
  886. 376 OverWrite(Str,Line,49);
  887. ***** ^ not supported yet
  888. ***** ^ not supported yet
  889. ***** ^ not supported yet
  890. ***** ^ not supported yet
  891. 377 CardinalToStr(Rec^.Gas.DAYSLATE,4,Str);
  892. ***** ^ not supported yet
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. ***** ^ not supported yet
  896. ***** ^ not supported yet
  897. 378 OverWrite(Str,Line,60);
  898. ***** ^ not supported yet
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. ***** ^ not supported yet
  902. 379 AddMenuItem(DF,2,J+2,Line,78,0,' ');
  903. ***** ^ not supported yet
  904. ***** ^ not supported yet
  905. ***** ^ not supported yet
  906. ***** ^ not supported yet
  907. 380 END;
  908. 381 ShowDisplayFrame(DF,1,13,80,24);
  909. ***** ^ not supported yet
  910. ***** ^ not supported yet
  911. ***** ^ not supported yet
  912. 382 Control(DF);
  913. ***** ^ not supported yet
  914. ***** ^ not supported yet
  915. 383 IF PromptYN('Do you wish to print Y/N?',DF)
  916. ***** ^ not supported yet
  917. ***** ^ not supported yet
  918. ***** ^ not supported yet
  919. 384 THEN
  920. 385 GetCurrCustName(Title1);
  921. ***** ^ not supported yet
  922. ***** ^ not supported yet
  923. 386 Append(Title1,' - Gas History');
  924. ***** ^ not supported yet
  925. ***** ^ not supported yet
  926. ***** ^ not supported yet
  927. 387 NormalTitle(Title1);
  928. ***** ^ not supported yet
  929. ***** ^ not supported yet
  930. 388 Handle := OpenReportDevice();
  931. ***** ^ not supported yet
  932. ***** ^ not supported yet
  933. 389 PrintFrame(DF,Handle);
  934. ***** ^ not supported yet
  935. ***** ^ not supported yet
  936. ***** ^ not supported yet
  937. 390 CloseReportDevice(Handle);
  938. ***** ^ not supported yet
  939. ***** ^ not supported yet
  940. 391 END;
  941. 392
  942. 393 END; (* end of if > 0 *)
  943. 394 CloseDisplayFrame(DF);
  944. ***** ^ not supported yet
  945. ***** ^ not supported yet
  946. 395 DisposeList(List);
  947. ***** ^ not supported yet
  948. ***** ^ not supported yet
  949. 396
  950. 397 END ListHistory;
  951. ***** ^ not supported yet
  952. 398 END Gas.
  953. ***** ^ not supported yet
  954. 554 errors