PMIMAINT.LST 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. Listing:
  2. 1 IMPLEMENTATION MODULE PMIMaint;
  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 FROM PMIGlobals IMPORT Config,PMIScreens;
  15. 14 FROM NumTypes IMPORT Real8;
  16. 15 FROM Numbers IMPORT Max;
  17. 16 FROM PosUtils IMPORT Equal;
  18. 17 FROM StrEdit IMPORT CrunchBlanks,DeleteRightJustified,Append,CAPstr,DeleteChar;
  19. 18 FROM M2Strings IMPORT Length;
  20. 19 FROM LowLevel IMPORT Fill;
  21. 20 FROM StringIO IMPORT PrintMessage,ErrorMessage,WriteEol,WriteStr,outp;
  22. 21 FROM SmartScreen IMPORT ClearScreen;
  23. 22 FROM ScrnUtl1 IMPORT FieldNum;
  24. 23 FROM ScrnUtl2 IMPORT CloseDisplayFrame;
  25. 24 FROM VWindows IMPORT ClearPart, CurrentWindow, SetCursorHeight;
  26. 25 FROM ScrnTypes IMPORT DisplayFrame,InitDisplayFrame,AFrameName;
  27. 26 FROM FramePainter IMPORT ShowDisplayFrame,RedrawField;
  28. 27 FROM InputManager IMPORT ControlFrame;
  29. 28 FROM FrameManager IMPORT EraseFrame;
  30. 29 FROM Prompts IMPORT PromptYN;
  31. 30 FROM SYSTEM IMPORT ADR,SIZE,ADDRESS;
  32. 31 FROM ControlUtils IMPORT ControlSeparately, LoadFrameList,Control,ChangeField;
  33. 32 FROM DspFiles IMPORT OpenDisplayFile,ReadDisplayFrame;
  34. 33
  35. 34
  36. 35
  37. 36 FROM DBFCustomer IMPORT CustomerDBF,MoveCustomerToDBF,MoveCustomerFromDBF,
  38. 37 CustomerRec, OpenCustomerDBF,CloseCustomerDBF,PackCustomer;
  39. 38 FROM ModBase3 IMPORT ReadDBRec,WriteDBRec,NumberRecords;
  40. 39
  41. 40 FROM DBFInvtry IMPORT PackInvtry;
  42. 41 FROM DBFInvoice IMPORT PackInvoice;
  43. 42 FROM DBFGas IMPORT PackGas;
  44. 43 FROM DBFPayments IMPORT PackPayments;
  45. 44 FROM DBFOrder IMPORT PackOrder;
  46. 45
  47. 46
  48. 47 VAR
  49. 48 DF : DisplayFrame;
  50. 49 NxtFrame : AFrameName;
  51. 50
  52. 51 PROCEDURE PackDatabase();
  53. 52 TYPE
  54. 53 PackType = (PCust,PPay,PInv,PInvy,PGas,POrder);
  55. 54 VAR
  56. 55 WhatToPack : SET OF PackType;
  57. ***** ^ not supported yet
  58. 56
  59. 57 BEGIN
  60. 58 WhatToPack := WhatToPack / WhatToPack;
  61. ***** ^ not supported yet
  62. ***** ^ not supported yet
  63. ***** ^ not supported yet
  64. 59 IF PromptYN(' Pack Customer ',DF)
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. ***** ^ not supported yet
  68. 60 THEN
  69. 61 INCL(WhatToPack,PCust);
  70. ***** ^ undeclared identifier
  71. ***** ^ not supported yet
  72. ***** ^ not supported yet
  73. 62 END;
  74. 63 IF PromptYN(' Pack Payments ',DF)
  75. ***** ^ not supported yet
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. 64 THEN
  79. 65 INCL(WhatToPack,PPay);
  80. ***** ^ undeclared identifier
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. 66 END;
  84. 67 IF PromptYN(' Pack Invoices ',DF)
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. 68 THEN
  89. 69 INCL(WhatToPack,PInv);
  90. ***** ^ undeclared identifier
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. 70 END;
  94. 71 IF PromptYN(' Pack Inventory ',DF)
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. 72 THEN
  99. 73 INCL(WhatToPack,PInvy);
  100. ***** ^ undeclared identifier
  101. ***** ^ not supported yet
  102. ***** ^ not supported yet
  103. 74 END;
  104. 75 IF PromptYN(' Pack Helium ',DF)
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 76 THEN
  109. 77 INCL(WhatToPack,PGas);
  110. ***** ^ undeclared identifier
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. 78 END;
  114. 79 IF PromptYN(' Pack Orders ',DF)
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. 80 THEN
  119. 81 INCL(WhatToPack,POrder);
  120. ***** ^ undeclared identifier
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. 82 END;
  124. 83 ClearScreen();
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. 84 IF PPay IN WhatToPack
  128. ***** ^ not supported yet
  129. ***** ^ not supported yet
  130. 85 THEN
  131. 86 WriteEol(outp,' Packing Payments database ');
  132. ***** ^ not supported yet
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. 87 PackPayments();
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. 88 END;
  139. 89
  140. 90 IF PCust IN WhatToPack
  141. ***** ^ not supported yet
  142. ***** ^ not supported yet
  143. 91 THEN
  144. 92 WriteEol(outp,' Packing customer database ');
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. ***** ^ not supported yet
  148. 93 PackCustomer();
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. 94 END;
  152. 95
  153. 96 IF PInv IN WhatToPack
  154. ***** ^ not supported yet
  155. ***** ^ not supported yet
  156. 97 THEN
  157. 98 WriteEol(outp,' Packing Invoice database ');
  158. ***** ^ not supported yet
  159. ***** ^ not supported yet
  160. ***** ^ not supported yet
  161. 99 PackInvoice();
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. 100 END;
  165. 101
  166. 102 IF PInvy IN WhatToPack
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. 103 THEN
  170. 104 WriteEol(outp,' Packing Inventory database ');
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. 105 PackInvtry();
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. 106 END;
  178. 107
  179. 108 IF PGas IN WhatToPack
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. 109 THEN
  183. 110 WriteEol(outp,' Packing Gas database ');
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. 111 PackGas();
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. 112 END;
  191. 113 IF POrder IN WhatToPack
  192. ***** ^ not supported yet
  193. ***** ^ not supported yet
  194. 114 THEN
  195. 115 WriteEol(outp,'Packing orderdatabase');
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 116 PackOrder();
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. 117 END;
  203. 118 END PackDatabase;
  204. ***** ^ not supported yet
  205. 119
  206. 120 PROCEDURE ResetCustYTD();
  207. 121 VAR
  208. 122 Cust : CustomerRec;
  209. 123 LI : LONGINT;
  210. 124 BEGIN
  211. 125 IF NOT PromptYN(' Reset Customer YTD Purchases? ',DF)
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. 126 THEN
  216. 127 RETURN;
  217. 128 END;
  218. 129 OpenCustomerDBF(FALSE);
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. 130 ClearScreen();
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. 131 FOR LI := 1 TO NumberRecords(CustomerDBF) DO
  225. ***** ^ not supported yet
  226. ***** ^ not supported yet
  227. 132 ReadDBRec(CustomerDBF,LI);
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. 133 MoveCustomerFromDBF(Cust);
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. 134 WriteStr(outp,' Processing ');
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. 135 WriteEol(outp,Cust.NAME);
  239. ***** ^ not supported yet
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. 136 Cust.YTDPURCH := 0.0;
  244. ***** ^ not supported yet
  245. ***** ^ not supported yet
  246. 137 MoveCustomerToDBF(Cust);
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. 138 WriteDBRec(CustomerDBF);
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. 139 END;
  253. 140 CloseCustomerDBF();
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. 141 END ResetCustYTD;
  257. ***** ^ not supported yet
  258. 142
  259. 143 PROCEDURE Maintain();
  260. 144
  261. 145 BEGIN
  262. 146 InitDisplayFrame(DF,CurrentWindow);
  263. ***** ^ not supported yet
  264. ***** ^ not supported yet
  265. ***** ^ not supported yet
  266. 147 ReadDisplayFrame(PMIScreens,DF,'Maint');
  267. ***** ^ not supported yet
  268. ***** ^ not supported yet
  269. ***** ^ not supported yet
  270. ***** ^ not supported yet
  271. 148 REPEAT
  272. 149 ClearScreen();
  273. ***** ^ not supported yet
  274. ***** ^ not supported yet
  275. 150 ShowDisplayFrame(DF,0,0,0,0);
  276. ***** ^ not supported yet
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. 151 ControlFrame(DF,1,'',FALSE,NxtFrame);
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. ***** ^ not supported yet
  283. 152 IF Equal(NxtFrame,'PackDB')
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. 153 THEN PackDatabase();
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. 154 ELSIF Equal(NxtFrame,'ResetCust')
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. ***** ^ not supported yet
  294. 155 THEN ResetCustYTD();
  295. ***** ^ not supported yet
  296. ***** ^ not supported yet
  297. 156 END;
  298. 157 UNTIL Equal(NxtFrame,'Exit');
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. 158 CloseDisplayFrame(DF);
  303. ***** ^ not supported yet
  304. ***** ^ not supported yet
  305. 159 END Maintain;
  306. ***** ^ not supported yet
  307. 160
  308. 161
  309. 162
  310. 163 END PMIMaint.
  311. ***** ^ not supported yet
  312. 147 errors