home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / propmgr2.zip / EDIT.TNT < prev    next >
Text File  |  1986-09-03  |  7KB  |  247 lines

  1. * DATE 07/20/84  17:59
  2. * edit.cmd
  3. * this program will edit the current record
  4. STOR CHR(PEEK (063)) TO dr
  5. * if deleted it cant be edited so
  6. RECA
  7. * store field variables into mem variables for editing
  8. STOR tenant TO mtenant
  9. STOR bcode TO mbcode
  10. STOR tunit TO mtunit
  11. STOR baddr TO mbaddr
  12. STOR tcontac TO mtcontac
  13. STOR tphone TO mtphone
  14. STOR alt TO malt
  15. STOR altad TO maltad
  16. STOR altcty TO maltcty
  17. STOR ttype TO mttype
  18. STOR trentpc TO mtrentpc
  19. STOR texpir TO mtexpir
  20. STOR trentpcr TO mtrenpcr
  21. STOR tfirst TO mtfirst
  22. STOR tsec TO mtsec
  23. STOR tsecb TO mtsecb
  24. STOR tlate TO mtlate
  25. STOR trent TO mtrent
  26. STOR taddl TO mtaddl
  27. STOR trente TO mtrente
  28. STOR trentm TO mtrentm
  29. STOR trentp TO mtrentp
  30. STOR trentpd TO mtrentpd
  31. STOR tlatec TO mtlatec
  32. STOR trentd TO mtrentd
  33. STOR trenty TO mtrenty
  34. STOR trentt TO mtrentt
  35. STOR tflag TO mtflag
  36. STOR tnotes TO mtnotes
  37. STOR tupdate TO mtupdate
  38. * set up screen and prompt for editing
  39. ERAS
  40. STOR 'Edit Tenant Data' TO mode
  41. STOR 'Enter the new or corrected information' TO prompt1
  42. STOR "Control 'Q' to end edit session" TO prompt2
  43. @ 0,26 SAY mode
  44. @ 1, 0 SAY " -------------------------------------------------"
  45. @ 1,50 SAY "-----------------------------"
  46. @ 3, 2 SAY "Tenant:"
  47. @ 3,53 SAY "Code:"
  48. @ 4, 4 SAY "Unit:"
  49. @ 4,26 SAY "Building:"
  50. @ 5, 1 SAY "Contact:"
  51. @ 5,52 SAY "Phone:"
  52. @ 6,09 SAY "Alternate mailing address: "
  53. @ 7,01 SAY "Address:"
  54. @ 8,04 SAY "City:"
  55. @ 10, 4 SAY "Type:"
  56. @ 10,19 SAY "Addl Percentage:"
  57. @ 10,48 SAY "1st Lease:"
  58. @ 11,04 SAY "Base:"
  59. @ 11,47 SAY "Expiration:"
  60. @ 12, 0 SAY "Security:"
  61. @ 12,30 SAY "Bank:"
  62. @ 12,48 SAY "Late Date:"
  63. @ 13, 4 SAY "Rent:"
  64. @ 13,25 SAY "Late Chgs:"
  65. @ 13,48 SAY "Addl Rent:"
  66. @ 14, 3 SAY "G & E:"
  67. @ 14,24 SAY "Other Chgs:"
  68. @ 15, 0 SAY "Rent Due:"
  69. @ 15,22 SAY "Last Payment:"
  70. @ 15,49 SAY "Amt Paid:"
  71. @ 16,00 SAY "Total Yr:"
  72. @ 16,30 SAY "Flag:"
  73. @ 16,52 SAY "Total:"
  74. @ 18, 3 SAY "Notes:"
  75. @ 18,51 SAY "Update:"
  76. @ 19, 0 SAY " -------------------------------------------------"
  77. @ 19,50 SAY "-----------------------------"
  78. @ 20, 7 SAY prompt1
  79. @ 21, 7 SAY prompt2
  80. @ 3,10 GET mtenant
  81. @ 3,59 GET mbcode PICTURE '99999'
  82. @ 4,10 GET mtunit
  83. @ 4,36 GET mbaddr
  84. @ 5,10 GET mtcontac
  85. @ 5,59 GET mtphone PICTURE '(999)999-9999'
  86. @ 6,36 GET malt PICTURE '!'
  87. @ 7,10 GET maltad
  88. @ 8,10 GET maltcty
  89. @ 10,10 GET mttype PICTURE '!'
  90. @ 10,36 GET mtrentpc
  91. @ 10,59 GET mtfirst PICTURE '99/99/99'
  92. @ 11,10 GET mtrenpcr
  93. @ 11,59 GET mtexpir PICTURE '99/99/99'
  94. @ 12,10 GET mtsec
  95. @ 12,36 GET mtsecb
  96. @ 12,59 GET mtlate PICTURE '99'
  97. @ 13,10 GET mtrent
  98. @ 13,36 GET mtlatec
  99. @ 13,59 GET mtaddl
  100. @ 14,10 GET mtrente
  101. @ 14,36 GET mtrentm
  102. @ 15,10 GET mtrentd
  103. @ 15,36 GET mtrentpd PICTURE '99/99/99'
  104. @ 15,59 GET mtrentp
  105. @ 16,10 GET mtrenty
  106. @ 16,36 GET mtflag PICTURE '99/99/99''
  107. @ 16,59 GET mtrentt
  108. @ 18,10 GET mtnotes
  109. @ 18,61 GET mtupdate PICTURE '99/99/99'
  110. READ
  111. CLEA GETS
  112. * test if there is a bad field validation
  113. DO CASE
  114. CASE mbcode = ' '
  115.  STOR t TO error
  116. CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  117.  STOR t TO error
  118. CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  119.  STOR t TO error
  120. CASE (mttype = 'P'.OR. mttype = 'O') .AND.(.NOT.(mtrentpc >0.AND. mtrenpcr >0))
  121.  STOR t TO error
  122. OTHE
  123.  STOR f TO error
  124. ENDC
  125. * if test for error was true then fix the fields that need fixing
  126. IF error
  127. * erase the lines to be used for prompts
  128.  @ 00,00
  129.  @ 20,00
  130.  @ 21,00
  131. * tell them to correct it
  132.  @ 0,18 SAY 'Please Correct the Indicated Data'
  133. * keep looping until all fields are fixed
  134.  STOR t to an:error
  135.  DO WHIL an:error
  136.   DO CASE
  137.   CASE mbcode = ' '
  138.    @ 20,00
  139.    @ 21,00
  140.    @ 20,15 SAY 'Must have a tenant code                              '
  141.    @ 03,59 GET mbcode PICTURE '99999'
  142.    READ
  143.   CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  144.    @ 20,00
  145.    @ 21,00
  146.    @ 20,15 SAY "Must answer 'Y' or 'N' to alternate address"
  147.    @ 06,36 GET malt PICTURE '!'
  148.    READ
  149.   CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  150.    @ 20,00
  151.    @ 21,00
  152.    @ 20,05 SAY "Type must be 'R' for Regular, 'P' for Percentage which uses the higher of"
  153.    @ 21,05 SAY "the percentage or the base rent or 'O' for Overage plus base rent"
  154.    @ 10,10 GET mttype PICTURE '!'
  155.    READ
  156.   CASE (mttype = 'P'.OR. mttype = 'O').AND.(.NOT.(mtrentpc>0.AND. mtrenpcr> 0))
  157.    @ 20,00
  158.    @ 21,00
  159.    @ 20,05 SAY 'If a percentage or overage lease, you must state the percentage'
  160.    @ 21,05 SAY 'AND the base for calculating the percentage rent'
  161.    @ 10,36 GET mtrentpc
  162.    @ 11,10 GET mtrenpcr
  163.    READ
  164.   OTHE
  165.    STOR f TO an:error
  166.   ENDC
  167.  ENDD while an:error
  168. ENDI error
  169. STOR 'N' TO command
  170. @ 20,00
  171. @ 21,00
  172. @ 20,15 SAY 'Are there any more changes ?                        '
  173. @ 20,48 GET command picture '!'
  174. READ
  175. IF command = 'Y'
  176.  @ 0,00
  177.  @ 0,26 SAY mode
  178.  @ 3,10 GET mtenant
  179.  @ 3,59 GET mbcode PICTURE '99999'
  180.  @ 4,10 GET mtunit
  181.  @ 4,36 GET mbaddr
  182.  @ 5,10 GET mtcontac
  183.  @ 5,59 GET mtphone PICTURE '(999)999-9999'
  184.  @ 6,36 GET malt PICTURE '!'
  185.  @ 7,10 GET maltad
  186.  @ 8,10 GET maltcty
  187.  @ 10,10 GET mttype PICTURE '!'
  188.  @ 10,36 GET mtrentpc
  189.  @ 10,59 GET mtfirst PICTURE '99/99/99'
  190.  @ 11,10 GET mtrenpcr
  191.  @ 11,59 GET mtexpir PICTURE '99/99/99'
  192.  @ 12,10 GET mtsec
  193.  @ 12,36 GET mtsecb
  194.  @ 12,59 GET mtlate PICTURE '99'
  195.  @ 13,10 GET mtrent
  196.  @ 13,36 GET mtlatec
  197.  @ 13,59 GET mtaddl
  198.  @ 14,10 GET mtrente
  199.  @ 14,36 GET mtrentm
  200.  @ 15,10 GET mtrentd
  201.  @ 15,36 GET mtrentpd PICTURE '99/99/99'
  202.  @ 15,59 GET mtrentp
  203.  @ 16,10 GET mtrenty
  204.  @ 16,36 GET mtflag PICTURE '99/99/99'
  205.  @ 16,59 GET mtrentt
  206.  @ 18,10 GET mtnotes
  207.  @ 18,61 GET mtupdate PICTURE '99/99/99'
  208.  @ 20,00
  209.  @ 21,00
  210.  @ 20,04 SAY prompt1
  211.  @ 21,04 SAY prompt2
  212. * let user enter data
  213.  READ
  214.  CLEA GETS
  215. ENDI command = 'Y'
  216. REPL tenant WITH mtenant, bcode WITH mbcode, tunit WITH mtunit
  217. REPL baddr WITH mbaddr, tcontac WITH mtcontac, tphone WITH mtphone
  218. REPL alt WITH malt, altad WITH maltad, altcty WITH maltcty
  219. REPL ttype WITH mttype, texpir WITH mtexpir
  220. REPL trentpc WITH mtrentpc, trentpcr WITH mtrenpcr
  221. REPL tfirst WITH mtfirst, tsec WITH mtsec, tsecb WITH mtsecb
  222. REPL tlate WITH mtlate, trent WITH mtrent, taddl WITH mtaddl
  223. REPL trente WITH mtrente, trentm WITH mtrentm, trentp WITH mtrentp
  224. REPL trentpd WITH mtrentpd, tlatec WITH mtlatec, trentd WITH mtrentd
  225. REPL trenty WITH mtrenty, trentt WITH mtrentt
  226. REPL tflag WITH mtflag, tnotes WITH mtnotes
  227. * ask if an automatic update of the date is wanted
  228. IF $(DATE(),1,2) <> '00'
  229.  STOR 'Y' TO command
  230.  @ 20,00
  231.  @ 21,00
  232.  @ 20,12 SAY 'Do You wish to UpDate to Todays Date (Y/N) ?'
  233.  @ 20,57 GET command PICTURE '!'
  234.  READ
  235.  IF command = 'Y'
  236.   REPL tupdate WITH  DATE()
  237.  ELSE
  238.   REPL tupdate WITH mtupdate
  239.  ENDI $(date)
  240. ENDI command = 'Y'
  241. RELE ALL
  242. * restore original memory
  243. STOR '?' TO command
  244. STOR t TO more
  245. STOR t TO first
  246. RETU
  247.