CUSTOMER.LST 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  1. Listing:
  2. 1 IMPLEMENTATION MODULE Customer;
  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 ModBase3 IMPORT UpdateDBFile,WriteDBRec,DeleteRecord,ReadDBRec,
  15. 14 AppendBlank;
  16. 15 FROM PMIGlobals IMPORT PMIScreens,Config,NormalTitle;
  17. 16 FROM DBStuff IMPORT MakeSeqNbr,MakeKey;
  18. 17 FROM DBUtils IMPORT ChangeDateField,ChangeRealField,PrintTitle;
  19. 18 FROM Scrn2DBF IMPORT FrameToDBF, DBFToFrame;
  20. 19 FROM NumTypes IMPORT Real8;
  21. 20 FROM DateFunctions IMPORT Date;
  22. 21 FROM Numbers IMPORT Max;
  23. 22 FROM PosUtils IMPORT Equal;
  24. 23 FROM StrEdit IMPORT CrunchBlanks,DeleteRightJustified,Append,CAPstr,
  25. 24 AssignStr,DeleteChar;
  26. 25 FROM M2Strings IMPORT Length,Assign,Concat;
  27. 26 FROM LowLevel IMPORT Fill;
  28. 27 FROM StringIO IMPORT PrintMessage,ErrorMessage,WriteEol,WriteStr;
  29. 28 (* these next two are from stonybrook - the pmi version doesn't work*)
  30. 29
  31. 30 FROM SmartScreen IMPORT ClearScreen;
  32. 31 FROM ScrnUtl1 IMPORT FieldNum;
  33. 32 FROM ScrnUtl2 IMPORT CloseDisplayFrame;
  34. 33 FROM VWindows IMPORT ClearPart, CurrentWindow, SetCursorHeight;
  35. 34 FROM ScrnTypes IMPORT DisplayFrame,InitDisplayFrame,AFrameName,DisplayFile;
  36. 35 FROM FramePainter IMPORT ShowDisplayFrame,RedrawField;
  37. 36 FROM InputManager IMPORT ControlFrame;
  38. 37 FROM FrameManager IMPORT EraseFrame;
  39. 38 FROM Prompts IMPORT Prompt,PromptStr,PromptNum,PromptYN;
  40. 39 FROM SYSTEM IMPORT ADR,SIZE,ADDRESS;
  41. 40 FROM ControlUtils IMPORT ControlSeparately, LoadFrameList,Control,ChangeField;
  42. 41 FROM DspFiles IMPORT OpenDisplayFile,ReadDisplayFrame;
  43. 42 FROM HandleIO IMPORT FileExists,OpenFile,CloseHandle;
  44. 43 FROM Prompts IMPORT Prompt;
  45. ***** ^ duplicate identifier
  46. ***** ^ duplicate identifier
  47. 44 FROM ManualInvoice IMPORT AddManualInvoice;
  48. 45 FROM GenLists IMPORT GenList, NewList,ListLength,GetElmt,
  49. 46 GetElmtAdr,DisposeList;
  50. 47
  51. 48 FROM Invoice IMPORT ControlInvoice,PayInvoice,InvoiceHistory,
  52. 49 MakeInvoicePrintLine,InvoiceDaysLate,GetOutstanding;
  53. 50 FROM DBFCustomer IMPORT CustomerDBF, OpenCustomerDBF,
  54. 51 CloseCustomerDBF,CustomerRec,FindCustomerByCin,FindCustomerByName,
  55. 52 NextCustomer,PrevCustomer,FirstCustomer,LastCustomer,MoveCustomerFromDBF,
  56. 53 MoveCustomerToDBF;
  57. 54 FROM Payments IMPORT ShowPaymentHist;
  58. 55 FROM Gas IMPORT ListOutstanding,ListHistory;
  59. 56
  60. 57 VAR
  61. 58 Status : INTEGER;
  62. 59 Environ : ARRAY [0..60] OF CHAR;
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. 60 J : CARDINAL;
  66. 61 FirstTime: BOOLEAN;
  67. 62 NextFrame,EndingFrame : AFrameName;
  68. 63 SelChar : CHAR;
  69. 64 NoData : BOOLEAN; (* true when no data is on the screen *)
  70. 65 CustomerDF : DisplayFrame;
  71. 66 DSPFile : DisplayFile;
  72. 67 PullDnMenu : GenList;
  73. 68 CurrentCust : CustomerRec;
  74. 69
  75. 70
  76. 71
  77. 72 PROCEDURE GetCustNbr( VAR CustNbr : ARRAY OF CHAR);
  78. ***** ^ not supported yet
  79. 73 BEGIN
  80. 74 Assign(CurrentCust.CIN,CustNbr);
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. 75 CrunchBlanks(CustNbr);
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. 76 END GetCustNbr;
  89. ***** ^ not supported yet
  90. 77
  91. 78 PROCEDURE GetCustTerms(VAR Terms : ARRAY OF CHAR);
  92. ***** ^ not supported yet
  93. 79 BEGIN
  94. 80 Assign(CurrentCust.TERMS,Terms );
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. 81 END GetCustTerms;
  100. ***** ^ not supported yet
  101. 82
  102. 83 PROCEDURE GetCustSalesRep(VAR Rep : ARRAY OF CHAR);
  103. ***** ^ not supported yet
  104. 84 BEGIN
  105. 85 Assign(CurrentCust.SALESREP,Rep );
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. ***** ^ not supported yet
  109. ***** ^ not supported yet
  110. 86 END GetCustSalesRep;
  111. ***** ^ not supported yet
  112. 87
  113. 88 PROCEDURE GetCustSalesRepCom(VAR Percent : Real8);
  114. 89 BEGIN
  115. 90 Percent := CurrentCust.SALEREPCOM;
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. ***** ^ not supported yet
  119. 91 END GetCustSalesRepCom;
  120. ***** ^ not supported yet
  121. 92
  122. 93 PROCEDURE GetCustShipVia(VAR Ship : ARRAY OF CHAR);
  123. ***** ^ not supported yet
  124. 94 BEGIN
  125. 95 Assign( CurrentCust.SHIPVIA,Ship);
  126. ***** ^ not supported yet
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. ***** ^ not supported yet
  130. 96 END GetCustShipVia;
  131. ***** ^ not supported yet
  132. 97
  133. 98 PROCEDURE GetCustDisAmount(VAR DcntAmount : Real8);
  134. 99 BEGIN
  135. 100 DcntAmount := CurrentCust.DISCAMOUNT;
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. 101 END GetCustDisAmount;
  140. ***** ^ not supported yet
  141. 102
  142. 103 PROCEDURE GetCustDisCntLvl(VAR DefaultLvl : CARDINAL);
  143. 104 BEGIN
  144. 105 DefaultLvl := CurrentCust.DISCLEVEL;
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. 106 END GetCustDisCntLvl;
  148. ***** ^ not supported yet
  149. 107
  150. 108 PROCEDURE GetCustTaxable(VAR Taxable : CHAR);
  151. 109 BEGIN
  152. 110 Taxable := CurrentCust.TAXABLE;
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. 111 CAPstr(Taxable);
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. 112 END GetCustTaxable;
  159. ***** ^ not supported yet
  160. 113
  161. 114 PROCEDURE GetCustFreeFrght(VAR FreeFrght : CHAR);
  162. 115 BEGIN
  163. 116 FreeFrght := CurrentCust.FREEFRGHT;
  164. ***** ^ not supported yet
  165. ***** ^ not supported yet
  166. 117 CAPstr(FreeFrght);
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. 118 END GetCustFreeFrght;
  170. ***** ^ not supported yet
  171. 119
  172. 120
  173. 121 PROCEDURE GetCustAddr(VAR Addr : AddressRec; AddrType : AddressTypes);
  174. ***** ^ undeclared identifier
  175. ***** ^ undeclared identifier
  176. 122 VAR J : CARDINAL;
  177. 123 BEGIN
  178. 124 Fill(ADR(Addr),SIZE(Addr),0);
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. 125 J := 1;
  186. 126 WITH CurrentCust DO
  187. ***** ^ not supported yet
  188. 127 IF AddrType = Billing
  189. ***** ^ not supported yet
  190. ***** ^ undeclared identifier
  191. 128 THEN
  192. 129 Assign(NAME,Addr.Line[0]);
  193. ***** ^ not supported yet
  194. ***** ^ undeclared identifier
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. 130 Assign( BILLTOZP,Addr.ZipCode);
  199. ***** ^ not supported yet
  200. ***** ^ undeclared identifier
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. 131 Assign( BILLTOA1,Addr.Line[1]);
  204. ***** ^ not supported yet
  205. ***** ^ undeclared identifier
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. 132 CrunchBlanks(Addr.Line[1]);
  210. ***** ^ not supported yet
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 133 IF Length(Addr.Line[1]) > 0
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. 134 THEN INC(J);
  220. ***** ^ undeclared identifier
  221. ***** ^ not supported yet
  222. 135 END;
  223. 136 Assign( BILLTOA2,Addr.Line[J]);
  224. ***** ^ not supported yet
  225. ***** ^ undeclared identifier
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. 137 CrunchBlanks(Addr.Line[J]);
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. 138 IF Length(Addr.Line[J]) > 0
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. 139 THEN INC(J);
  240. ***** ^ undeclared identifier
  241. ***** ^ not supported yet
  242. 140 END;
  243. 141 Assign( BILLTOA3,Addr.Line[J]);
  244. ***** ^ not supported yet
  245. ***** ^ undeclared identifier
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. 142 CrunchBlanks(Addr.Line[J]);
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. ***** ^ not supported yet
  253. ***** ^ not supported yet
  254. 143 IF Length(Addr.Line[J]) = 0
  255. ***** ^ not supported yet
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. 144 THEN DEC(J);
  260. ***** ^ undeclared identifier
  261. ***** ^ not supported yet
  262. 145 END;
  263. 146 Append(Addr.Line[J],' ');
  264. ***** ^ not supported yet
  265. ***** ^ not supported yet
  266. ***** ^ not supported yet
  267. ***** ^ not supported yet
  268. ***** ^ not supported yet
  269. 147 Append(Addr.Line[J],BILLTOZP);
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. ***** ^ not supported yet
  274. ***** ^ undeclared identifier
  275. 148 ELSE
  276. 149 Assign( NAME,Addr.Line[0]);
  277. ***** ^ not supported yet
  278. ***** ^ undeclared identifier
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. 150 Assign( SHIPTOZP,Addr.ZipCode);
  283. ***** ^ not supported yet
  284. ***** ^ undeclared identifier
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. 151 Assign( SHIPTOA1,Addr.Line[1]);
  288. ***** ^ not supported yet
  289. ***** ^ undeclared identifier
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. 152 CrunchBlanks(Addr.Line[1]);
  294. ***** ^ not supported yet
  295. ***** ^ not supported yet
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. 153 IF Length(Addr.Line[1]) > 0
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. 154 THEN INC(J);
  304. ***** ^ undeclared identifier
  305. ***** ^ not supported yet
  306. 155 END;
  307. 156 Assign( SHIPTOA2,Addr.Line[J]);
  308. ***** ^ not supported yet
  309. ***** ^ undeclared identifier
  310. ***** ^ not supported yet
  311. ***** ^ not supported yet
  312. ***** ^ not supported yet
  313. 157 CrunchBlanks(Addr.Line[J]);
  314. ***** ^ not supported yet
  315. ***** ^ not supported yet
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. 158 IF Length(Addr.Line[J]) > 0
  319. ***** ^ not supported yet
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. 159 THEN INC(J);
  324. ***** ^ undeclared identifier
  325. ***** ^ not supported yet
  326. 160 END;
  327. 161 Assign( SHIPTOA3,Addr.Line[J] );
  328. ***** ^ not supported yet
  329. ***** ^ undeclared identifier
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. ***** ^ not supported yet
  333. 162 CrunchBlanks(Addr.Line[J]);
  334. ***** ^ not supported yet
  335. ***** ^ not supported yet
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. 163 IF Length(Addr.Line[J]) = 0
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. ***** ^ not supported yet
  343. 164 THEN DEC(J);
  344. ***** ^ undeclared identifier
  345. ***** ^ not supported yet
  346. 165 END;
  347. 166 Append(Addr.Line[J],' ');
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. ***** ^ not supported yet
  351. ***** ^ not supported yet
  352. ***** ^ not supported yet
  353. 167 Append(Addr.Line[J],' ');
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. ***** ^ not supported yet
  359. 168 Append(Addr.Line[J],SHIPTOZP);
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. ***** ^ not supported yet
  364. ***** ^ undeclared identifier
  365. 169 END;
  366. 170 END; (* end of with *)
  367. ***** ^ not supported yet
  368. 171 END GetCustAddr;
  369. ***** ^ not supported yet
  370. 172
  371. 173 PROCEDURE GetCurrCustName(VAR Name : ARRAY OF CHAR);
  372. ***** ^ not supported yet
  373. 174 BEGIN
  374. 175 Assign( CurrentCust.NAME,Name);
  375. ***** ^ not supported yet
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. ***** ^ not supported yet
  379. 176 END GetCurrCustName;
  380. ***** ^ not supported yet
  381. 177
  382. 178 PROCEDURE SetCustomerRec(Cust : CustomerRec);
  383. 179 BEGIN
  384. 180 CurrentCust := Cust;
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. 181 END SetCustomerRec;
  388. ***** ^ not supported yet
  389. 182
  390. 183 PROCEDURE UpdateCustomerFile();
  391. 184 BEGIN
  392. 185 MoveCustomerToDBF(CurrentCust);
  393. ***** ^ not supported yet
  394. ***** ^ not supported yet
  395. 186 WriteDBRec(CustomerDBF);
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. 187 END UpdateCustomerFile;
  399. ***** ^ not supported yet
  400. 188
  401. 189
  402. 190 PROCEDURE SetCustLastInvDate( D : Date);
  403. 191 BEGIN
  404. 192 CurrentCust.LASTINV := D;
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. 193 ChangeDateField(CustomerDF,D,'LASTINV');
  409. ***** ^ not supported yet
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. ***** ^ not supported yet
  413. 194 (* RedrawField(CustomerDF,FieldNum(CustomerDF,'LASTINV'),FALSE); *)
  414. 195 UpdateCustomerFile();
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. 196 END SetCustLastInvDate;
  418. ***** ^ not supported yet
  419. 197
  420. 198 PROCEDURE SetCustOutStd(AmountOut : Real8);
  421. 199 BEGIN
  422. 200 CurrentCust.AMTOUT := AmountOut;
  423. ***** ^ not supported yet
  424. ***** ^ not supported yet
  425. ***** ^ not supported yet
  426. 201 ChangeRealField(CustomerDF,AmountOut,'AMTOUT');
  427. ***** ^ not supported yet
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. 202 RedrawField(CustomerDF,FieldNum(CustomerDF,'AMTOUT'),FALSE);
  432. ***** ^ not supported yet
  433. ***** ^ not supported yet
  434. ***** ^ not supported yet
  435. ***** ^ not supported yet
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. 203 UpdateCustomerFile();
  439. ***** ^ not supported yet
  440. ***** ^ not supported yet
  441. 204 END SetCustOutStd;
  442. ***** ^ not supported yet
  443. 205
  444. 206 PROCEDURE AddCustOutStd(AmountOut : Real8);
  445. 207 BEGIN
  446. 208 CurrentCust.AMTOUT := CurrentCust.AMTOUT + AmountOut;
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. ***** ^ not supported yet
  450. ***** ^ not supported yet
  451. ***** ^ not supported yet
  452. 209 ChangeRealField(CustomerDF,CurrentCust.AMTOUT,'AMTOUT');
  453. ***** ^ not supported yet
  454. ***** ^ not supported yet
  455. ***** ^ not supported yet
  456. ***** ^ not supported yet
  457. ***** ^ not supported yet
  458. 210 RedrawField(CustomerDF,FieldNum(CustomerDF,'AMTOUT'),FALSE);
  459. ***** ^ not supported yet
  460. ***** ^ not supported yet
  461. ***** ^ not supported yet
  462. ***** ^ not supported yet
  463. ***** ^ not supported yet
  464. ***** ^ not supported yet
  465. 211 UpdateCustomerFile();
  466. ***** ^ not supported yet
  467. ***** ^ not supported yet
  468. 212 END AddCustOutStd;
  469. ***** ^ not supported yet
  470. 213
  471. 214 PROCEDURE AddCustYTD(AddAmount : Real8);
  472. 215 BEGIN
  473. 216 CurrentCust.YTDPURCH := CurrentCust.YTDPURCH + AddAmount;
  474. ***** ^ not supported yet
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. ***** ^ not supported yet
  478. ***** ^ not supported yet
  479. 217 IF CurrentCust.YTDPURCH < 0.0
  480. ***** ^ not supported yet
  481. ***** ^ not supported yet
  482. 218 THEN
  483. 219 CurrentCust.YTDPURCH := 0.0;
  484. ***** ^ not supported yet
  485. ***** ^ not supported yet
  486. 220 END;
  487. 221 ChangeRealField(CustomerDF,CurrentCust.YTDPURCH,'YTDPURCH');
  488. ***** ^ not supported yet
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. 222 (* RedrawField(CustomerDF,FieldNum(CustomerDF,'YTDPURCH'),FALSE); *)
  494. 223 UpdateCustomerFile();
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. 224 END AddCustYTD;
  498. ***** ^ not supported yet
  499. 225
  500. 226 PROCEDURE GetCustName(CIN : ARRAY OF CHAR; VAR Name : ARRAY OF CHAR);
  501. ***** ^ not supported yet
  502. ***** ^ not supported yet
  503. 227 VAR
  504. 228 TMP : CustomerRec;
  505. 229 BEGIN
  506. 230 MakeKey(CIN);
  507. ***** ^ not supported yet
  508. ***** ^ not supported yet
  509. 231 IF NOT FindCustomerByCin(CIN)
  510. ***** ^ not supported yet
  511. ***** ^ not supported yet
  512. 232 THEN AssignStr( '?????',Name);
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. ***** ^ not supported yet
  516. 233 ELSE
  517. 234 MoveCustomerFromDBF(CurrentCust);
  518. ***** ^ not supported yet
  519. ***** ^ not supported yet
  520. 235 Assign(CurrentCust.NAME,Name);
  521. ***** ^ not supported yet
  522. ***** ^ not supported yet
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. 236 END;
  526. 237 END GetCustName;
  527. ***** ^ not supported yet
  528. 238
  529. 239 PROCEDURE PrintLabels();
  530. 240 (* print shipping labels*)
  531. 241
  532. 242 CONST
  533. 243 ShipLines = CHR(12);
  534. ***** ^ undeclared identifier
  535. ***** ^ not supported yet
  536. 244 FF = CHR(12);
  537. ***** ^ undeclared identifier
  538. ***** ^ not supported yet
  539. 245
  540. 246 NorLength = CHR(66);
  541. ***** ^ undeclared identifier
  542. ***** ^ not supported yet
  543. 247 (* L1:=ARRAY OF CHAR (CHR(27),'C');
  544. 248 L2:ARRAY OF CHAR=[CHR(27),'C',NorLength]; *)
  545. 249 VAR
  546. 250 Cnt : CARDINAL;
  547. 251 J,K : CARDINAL;
  548. 252 PrtHand : CARDINAL;
  549. 253 EM : ErrorMessage;
  550. 254 Addr : AddressRec;
  551. ***** ^ undeclared identifier
  552. 255 L1 : ARRAY[0..2] OF CHAR;
  553. ***** ^ not supported yet
  554. ***** ^ not supported yet
  555. 256 L2 : ARRAY[0..3] OF CHAR;
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. 257 BEGIN
  559. 258 Concat(27C,'C',L1);
  560. ***** ^ not supported yet
  561. ***** ^ not supported yet
  562. 259 Concat(L1,NorLength,L2);
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. ***** ^ not supported yet
  566. 260 Cnt := PromptNum(' Enter number of labels to print ',1);
  567. ***** ^ not supported yet
  568. ***** ^ not supported yet
  569. ***** ^ not supported yet
  570. 261 EM := OpenFile(PrtHand,Config.LabelPrt);
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. ***** ^ not supported yet
  575. 262 (* put the form length here *)
  576. 263 (* WriteStr(PrtHand,L1); *) (* set form length to lenght of lables*)
  577. 264 WriteStr(PrtHand,CHAR(18));
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. 265 FOR J := 1 TO Cnt DO
  581. 266 WriteStr(PrtHand,'FROM ');
  582. ***** ^ not supported yet
  583. ***** ^ not supported yet
  584. 267 WriteEol(PrtHand,Config.CompanyName);
  585. ***** ^ not supported yet
  586. ***** ^ not supported yet
  587. ***** ^ not supported yet
  588. 268 WriteStr(PrtHand,' ');
  589. ***** ^ not supported yet
  590. ***** ^ not supported yet
  591. 269 WriteEol(PrtHand,Config.CompanyAddr1);
  592. ***** ^ not supported yet
  593. ***** ^ not supported yet
  594. ***** ^ not supported yet
  595. 270 WriteStr(PrtHand,' ');
  596. ***** ^ not supported yet
  597. ***** ^ not supported yet
  598. 271 WriteEol(PrtHand,Config.CompanyAddr2);
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. ***** ^ not supported yet
  602. 272 WriteEol(PrtHand,''); (* go to the from part *)
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. 273 WriteEol(PrtHand,'');
  606. ***** ^ not supported yet
  607. ***** ^ not supported yet
  608. 274 WriteEol(PrtHand,'');
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. 275 WriteEol(PrtHand,'');
  612. ***** ^ not supported yet
  613. ***** ^ not supported yet
  614. 276 WriteEol(PrtHand,'');
  615. ***** ^ not supported yet
  616. ***** ^ not supported yet
  617. 277 WriteStr(PrtHand,'TO ');
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. 278 GetCustAddr(Addr,Shipping);
  621. ***** ^ not supported yet
  622. ***** ^ not supported yet
  623. ***** ^ undeclared identifier
  624. 279 FOR K := 0 TO 3 DO
  625. 280 WriteEol(PrtHand,Addr.Line[K]);
  626. ***** ^ not supported yet
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. ***** ^ not supported yet
  630. 281 WriteStr(PrtHand,' ');
  631. ***** ^ not supported yet
  632. ***** ^ not supported yet
  633. 282 END;
  634. 283 FOR K := 1 TO 6 DO
  635. 284 WriteEol(PrtHand,'');
  636. ***** ^ not supported yet
  637. ***** ^ not supported yet
  638. 285 END;
  639. 286 END;
  640. 287 (* WriteStr(PrtHand,L2); (* reset lenght at 66 lines / inch *)*)
  641. 288 EM := CloseHandle(PrtHand);
  642. ***** ^ not supported yet
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. 289 END PrintLabels;
  646. ***** ^ not supported yet
  647. 290
  648. 291
  649. 292
  650. 293 PROCEDURE FileMenu(SelChar: CHAR);
  651. 294 VAR
  652. 295 B : BOOLEAN;
  653. 296 Str : ARRAY [0..80] OF CHAR;
  654. ***** ^ not supported yet
  655. ***** ^ not supported yet
  656. 297 BEGIN
  657. 298 CASE SelChar OF
  658. 299 'A' : ReadDisplayFrame(PMIScreens,CustomerDF,'Customer'); (*Clear out any of the fields *)
  659. ***** ^ not supported yet
  660. ***** ^ not supported yet
  661. ***** ^ not supported yet
  662. ***** ^ not supported yet
  663. 300 MakeSeqNbr('Cust',Config.CustNbrPre,Str);
  664. ***** ^ not supported yet
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. ***** ^ not supported yet
  668. ***** ^ not supported yet
  669. 301 ChangeField(CustomerDF,Str,'CIN',TRUE);
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. ***** ^ not supported yet
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. 302 ShowDisplayFrame(CustomerDF,0,0,0,0);
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. ***** ^ not supported yet
  679. 303 Control(CustomerDF); (* alow user input *)
  680. ***** ^ not supported yet
  681. ***** ^ not supported yet
  682. 304 AppendBlank(CustomerDBF);
  683. ***** ^ not supported yet
  684. ***** ^ not supported yet
  685. 305 B := FrameToDBF(CustomerDBF,CustomerDF); (* do something if couldn't add*)
  686. ***** ^ not supported yet
  687. ***** ^ not supported yet
  688. ***** ^ not supported yet
  689. 306 MoveCustomerFromDBF(CurrentCust);
  690. ***** ^ not supported yet
  691. ***** ^ not supported yet
  692. 307 WITH CurrentCust DO
  693. ***** ^ not supported yet
  694. 308 CrunchBlanks(BILLTOA1);
  695. ***** ^ not supported yet
  696. ***** ^ undeclared identifier
  697. 309 IF (BILLTOA1[0] = CHR(0))
  698. ***** ^ undeclared identifier
  699. ***** ^ not supported yet
  700. ***** ^ undeclared identifier
  701. ***** ^ not supported yet
  702. 310 THEN
  703. 311 Assign( SHIPTOA1,BILLTOA1);
  704. ***** ^ not supported yet
  705. ***** ^ undeclared identifier
  706. ***** ^ undeclared identifier
  707. 312 Assign( SHIPTOA2,BILLTOA2);
  708. ***** ^ not supported yet
  709. ***** ^ undeclared identifier
  710. ***** ^ undeclared identifier
  711. 313 Assign(SHIPTOA3,BILLTOA3 );
  712. ***** ^ not supported yet
  713. ***** ^ undeclared identifier
  714. ***** ^ undeclared identifier
  715. 314 Assign( SHIPTOZP,BILLTOZP);
  716. ***** ^ not supported yet
  717. ***** ^ undeclared identifier
  718. ***** ^ undeclared identifier
  719. 315 MoveCustomerToDBF(CurrentCust);
  720. ***** ^ not supported yet
  721. ***** ^ not supported yet
  722. 316
  723. 317 DBFToFrame(CustomerDBF,CustomerDF);
  724. ***** ^ not supported yet
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. 318 ShowDisplayFrame(CustomerDF,0,0,0,0);
  728. ***** ^ not supported yet
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. 319 END;
  732. 320 END; (* end of with *)
  733. ***** ^ not supported yet
  734. 321
  735. 322 WriteDBRec(CustomerDBF);
  736. ***** ^ not supported yet
  737. ***** ^ not supported yet
  738. 323
  739. 324 |'F' : FirstCustomer();
  740. ***** ^ not supported yet
  741. ***** ^ not supported yet
  742. 325 DBFToFrame(CustomerDBF,CustomerDF);
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 326 ShowDisplayFrame(CustomerDF,0,0,0,0);
  747. ***** ^ not supported yet
  748. ***** ^ not supported yet
  749. ***** ^ not supported yet
  750. 327 |'L' : LastCustomer();
  751. ***** ^ not supported yet
  752. ***** ^ not supported yet
  753. 328 DBFToFrame(CustomerDBF,CustomerDF);
  754. ***** ^ not supported yet
  755. ***** ^ not supported yet
  756. ***** ^ not supported yet
  757. 329 ShowDisplayFrame(CustomerDF,0,0,0,0);
  758. ***** ^ not supported yet
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. 330
  762. 331 |'N' : IF NextCustomer()
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. 332 THEN
  766. 333 DBFToFrame(CustomerDBF,CustomerDF);
  767. ***** ^ not supported yet
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. 334 ShowDisplayFrame(CustomerDF,0,0,0,0);
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. 335 END;
  775. 336
  776. 337 |'P' : IF PrevCustomer()
  777. ***** ^ not supported yet
  778. ***** ^ not supported yet
  779. 338 THEN
  780. 339 DBFToFrame(CustomerDBF,CustomerDF);
  781. ***** ^ not supported yet
  782. ***** ^ not supported yet
  783. ***** ^ not supported yet
  784. 340 ShowDisplayFrame(CustomerDF,0,0,0,0);
  785. ***** ^ not supported yet
  786. ***** ^ not supported yet
  787. ***** ^ not supported yet
  788. 341 END;
  789. 342
  790. 343
  791. 344 |'C' : (* The first unused letter in the index name or 'Q' *)
  792. 345 Fill(ADR(Str),SIZE(Str),0);
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. ***** ^ undeclared identifier
  796. ***** ^ not supported yet
  797. ***** ^ undeclared identifier
  798. ***** ^ not supported yet
  799. 346
  800. 347 PromptStr('Enter Customer Cin ',Str);
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. ***** ^ undeclared identifier
  804. 348
  805. 349 MakeKey(Str);
  806. ***** ^ not supported yet
  807. ***** ^ undeclared identifier
  808. 350 IF NOT FindCustomerByCin(Str)
  809. ***** ^ not supported yet
  810. ***** ^ undeclared identifier
  811. 351 THEN
  812. 352 Prompt('Customer Not Found');
  813. ***** ^ not supported yet
  814. ***** ^ not supported yet
  815. 353 ELSE
  816. 354 DBFToFrame(CustomerDBF,CustomerDF);
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. ***** ^ not supported yet
  820. 355 ShowDisplayFrame(CustomerDF,0,0,0,0);
  821. ***** ^ not supported yet
  822. ***** ^ not supported yet
  823. ***** ^ not supported yet
  824. 356 END;
  825. 357
  826. 358
  827. 359 |'M' : (* The first unused letter in the index name or 'Q' *)
  828. 360 Fill(ADR(Str),SIZE(Str),0);
  829. ***** ^ not supported yet
  830. ***** ^ not supported yet
  831. ***** ^ undeclared identifier
  832. ***** ^ not supported yet
  833. ***** ^ undeclared identifier
  834. ***** ^ not supported yet
  835. 361
  836. 362 PromptStr('Enter Customer Nameidx ',Str);
  837. ***** ^ not supported yet
  838. ***** ^ not supported yet
  839. ***** ^ undeclared identifier
  840. 363
  841. 364 MakeKey(Str);
  842. ***** ^ not supported yet
  843. ***** ^ undeclared identifier
  844. 365 IF NOT FindCustomerByName(Str)
  845. ***** ^ not supported yet
  846. ***** ^ undeclared identifier
  847. 366 THEN (* always display the cust or the closet one *)
  848. 367 END;
  849. 368 DBFToFrame(CustomerDBF,CustomerDF);
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. ***** ^ not supported yet
  853. 369 ShowDisplayFrame(CustomerDF,0,0,0,0);
  854. ***** ^ not supported yet
  855. ***** ^ not supported yet
  856. ***** ^ not supported yet
  857. 370 END; (* end of case *)
  858. 371 END FileMenu;
  859. ***** ^ not supported yet
  860. 372
  861. 373 PROCEDURE EditMenu(SelChar : CHAR);
  862. 374 VAR
  863. 375 B : BOOLEAN;
  864. 376 BEGIN
  865. 377 CASE SelChar OF
  866. 378 'U' : Control(CustomerDF);
  867. ***** ^ not supported yet
  868. ***** ^ not supported yet
  869. 379 B := FrameToDBF(CustomerDBF,CustomerDF);
  870. ***** ^ not supported yet
  871. ***** ^ not supported yet
  872. ***** ^ not supported yet
  873. 380 WriteDBRec(CustomerDBF);
  874. ***** ^ not supported yet
  875. ***** ^ not supported yet
  876. 381 |'D' : IF PromptYN('About to delete customer - continue ?',CustomerDF)
  877. ***** ^ not supported yet
  878. ***** ^ not supported yet
  879. ***** ^ not supported yet
  880. 382 THEN
  881. 383 DeleteRecord(CustomerDBF);
  882. ***** ^ not supported yet
  883. ***** ^ not supported yet
  884. 384 B :=NextCustomer();
  885. ***** ^ not supported yet
  886. ***** ^ not supported yet
  887. 385 FileMenu('P');
  888. ***** ^ not supported yet
  889. ***** ^ not supported yet
  890. 386 END;
  891. 387 END;
  892. 388 END EditMenu;
  893. ***** ^ not supported yet
  894. 389
  895. 390
  896. 391 PROCEDURE InvoiceMenu(SelChar: CHAR);
  897. 392 VAR
  898. 393 Inv : ARRAY[0..15] OF CHAR;
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. 394 BEGIN
  902. 395 MoveCustomerFromDBF(CurrentCust);
  903. ***** ^ not supported yet
  904. ***** ^ not supported yet
  905. 396 CASE SelChar OF
  906. 397 'A' : ControlInvoice('N');
  907. ***** ^ not supported yet
  908. ***** ^ not supported yet
  909. 398 |'E' : ControlInvoice('E'); (*edit invoice *)
  910. ***** ^ not supported yet
  911. ***** ^ not supported yet
  912. 399 |'P' : ControlInvoice('P');
  913. ***** ^ not supported yet
  914. ***** ^ not supported yet
  915. 400 |'C' : ControlInvoice('C');
  916. ***** ^ not supported yet
  917. ***** ^ not supported yet
  918. 401 |'Y' : PayInvoice();
  919. ***** ^ not supported yet
  920. ***** ^ not supported yet
  921. 402 |'M' : AddManualInvoice();
  922. ***** ^ not supported yet
  923. ***** ^ not supported yet
  924. 403
  925. 404
  926. 405 END; (* end of case *)
  927. 406 ShowDisplayFrame(CustomerDF,0,0,0,0); (* clear out the invoice stuff*)
  928. ***** ^ not supported yet
  929. ***** ^ not supported yet
  930. ***** ^ not supported yet
  931. 407 END InvoiceMenu;
  932. ***** ^ not supported yet
  933. 408
  934. 409 PROCEDURE PrintMenu(SelChar : CHAR);
  935. 410 BEGIN
  936. 411 MoveCustomerFromDBF(CurrentCust);
  937. ***** ^ not supported yet
  938. ***** ^ not supported yet
  939. 412 CrunchBlanks(CurrentCust.CIN);
  940. ***** ^ not supported yet
  941. ***** ^ not supported yet
  942. ***** ^ not supported yet
  943. 413 CASE SelChar OF
  944. 414 'H' : ListOutstanding(CurrentCust.CIN);
  945. ***** ^ not supported yet
  946. ***** ^ not supported yet
  947. ***** ^ not supported yet
  948. 415 |'L' : PrintLabels();
  949. ***** ^ not supported yet
  950. ***** ^ not supported yet
  951. 416 |'E' : ListHistory(CurrentCust.CIN,CustomerDF);
  952. ***** ^ not supported yet
  953. ***** ^ not supported yet
  954. ***** ^ not supported yet
  955. ***** ^ not supported yet
  956. 417 |'Y' : ShowPaymentHist(CurrentCust.CIN);
  957. ***** ^ not supported yet
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. 418 |'V' : InvoiceHistory();
  961. ***** ^ not supported yet
  962. ***** ^ not supported yet
  963. 419 END;
  964. 420 END PrintMenu;
  965. ***** ^ not supported yet
  966. 421
  967. 422 PROCEDURE ControlCustomer();
  968. 423 BEGIN
  969. 424 (* OpenCustomerDBF(TRUE); *)
  970. 425 ClearScreen();
  971. ***** ^ not supported yet
  972. ***** ^ not supported yet
  973. 426 InitDisplayFrame(CustomerDF,CurrentWindow);
  974. ***** ^ not supported yet
  975. ***** ^ not supported yet
  976. ***** ^ not supported yet
  977. 427 NewList(PullDnMenu);
  978. ***** ^ not supported yet
  979. ***** ^ not supported yet
  980. 428 LoadFrameList(PMIScreens,'TopMenu',PullDnMenu);
  981. ***** ^ not supported yet
  982. ***** ^ not supported yet
  983. ***** ^ not supported yet
  984. ***** ^ not supported yet
  985. 429 NoData := TRUE;
  986. 430 ReadDisplayFrame(PMIScreens,CustomerDF,'Customer');
  987. ***** ^ not supported yet
  988. ***** ^ not supported yet
  989. ***** ^ not supported yet
  990. ***** ^ not supported yet
  991. 431 REPEAT
  992. 432 NextFrame := 'TopMenu';
  993. ***** ^ not supported yet
  994. ***** ^ not supported yet
  995. 433 ControlSeparately(PullDnMenu,NextFrame,SelChar,EndingFrame);
  996. ***** ^ not supported yet
  997. ***** ^ not supported yet
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. 434 IF Equal(EndingFrame,'FileMenu')
  1001. ***** ^ not supported yet
  1002. ***** ^ not supported yet
  1003. ***** ^ not supported yet
  1004. 435 THEN FileMenu(SelChar);
  1005. ***** ^ not supported yet
  1006. ***** ^ not supported yet
  1007. 436 ELSIF Equal(EndingFrame,'EditMenu')
  1008. ***** ^ not supported yet
  1009. ***** ^ not supported yet
  1010. ***** ^ not supported yet
  1011. 437 THEN EditMenu(SelChar);
  1012. ***** ^ not supported yet
  1013. ***** ^ not supported yet
  1014. 438 ELSIF Equal(EndingFrame,'InvoiceMenu')
  1015. ***** ^ not supported yet
  1016. ***** ^ not supported yet
  1017. ***** ^ not supported yet
  1018. 439 THEN InvoiceMenu(SelChar);
  1019. ***** ^ not supported yet
  1020. ***** ^ not supported yet
  1021. 440 ELSIF Equal(EndingFrame,'PrintMenu')
  1022. ***** ^ not supported yet
  1023. ***** ^ not supported yet
  1024. ***** ^ not supported yet
  1025. 441 THEN PrintMenu(SelChar);
  1026. ***** ^ not supported yet
  1027. ***** ^ not supported yet
  1028. 442 END;
  1029. 443
  1030. 444 UNTIL SelChar='X'; (* Assumes 'X' is only used to exit *)
  1031. 445 CloseDisplayFrame(CustomerDF);
  1032. ***** ^ not supported yet
  1033. ***** ^ not supported yet
  1034. 446 (* CloseCustomerDBF();*)
  1035. 447 ClearScreen();
  1036. ***** ^ not supported yet
  1037. ***** ^ not supported yet
  1038. 448
  1039. 449
  1040. 450 END ControlCustomer;
  1041. ***** ^ not supported yet
  1042. 451
  1043. 452 END Customer.
  1044. ***** ^ not supported yet
  1045. 591 errors