CLOSE DATA SELECT 1 USE RENTAL sort on hcode to rsort store 'rsort' to dnet set exclusive on do neterror use rsort do while .not. eof() IF ACTIVE = 'Y' .AND. TYPE = 'T' skip else delete skip endif enddo pack unlock set exclusive off close data select 1 use rental select 5 use rsort SELECT 2 USE HOUSE SELECT 5 store date()+31 to dinc DO WHILE .T. STORE SPACE(10) TO HG STORE 'f:\rentinc\' TO HG1 SELECT 5 STORE 'RENT INCREASE' TO TOP1 DO TOP store 45 to ggg SELECT 5 *READ *IF LASTKEY() = 27 * EXIT *ENDIF STORE 'N' TO SEL store 'N' to lten @ 4,0 clear @ 4,0 say 'List tenants (Y/N) - ' get lten picture '!' *@ 5,0 say 'Directory to store files - ' get hg1 read if lten = 'Y' DO WHILE .T. SELECT 5 GOTO TOP STORE 5 TO ROW IF SEL = 'Y' SET PRINTER TO rinc SET DEVICE TO PRINT @ 1,30 SAY 'RENTAL INCREASE REPORT' @ 1,60 SAY DATE() STORE 4 TO ROW ENDIF STORE ROW+1 TO ROW @ ROW,0 SAY SEP STORE ROW+1 TO ROW @ ROW,0 SAY ' NAME CODE OLD RENT NEW RENT LAST INCREASE #DAYS' STORE ROW+1 TO ROW @ ROW,0 SAY SEP STORE ROW+1 TO ROW DO WHILE .NOT. EOF() *IF EFFDATE+365 < DATE()+GGG .AND. ACTIVE = 'Y' .AND. TYPE = 'T' IF ACTIVE = 'Y' .AND. TYPE = 'T' @ ROW,0 SAY NAME+HCODE+STR(OLDRENT,6,0)+' '+STR(NEWRENT,6,0)+' ' +DTOC(EFFDATE) + ' ' + str(date()-effdate,5,0) STORE ROW+1 TO ROW ENDIF SKIP IF ROW = 22 .AND. SEL <> 'Y' @ 22,0 CLEAR STORE ' ' TO SSS @ 23,0 SAY 'Screen full ... Press any key to continue ' get sss read STORE 9 TO ROW endif ENDDO IF SEL = 'Y' EJECT SET DEVICE TO SCREEN SET PRINTER TO @ 23,0 SAY SPACE(80) @ 23,0 SAY 'Report printed' wait EXIT ENDIF STORE 'N' TO SEL @ 23,0 clear @ 23,0 SAY 'Print (Y/N) - ' get sel picture '!' read IF SEL = 'Y' LOOP ELSE EXIT ENDIF ENDDO endif STORE ' ' TO FNAME STORE ' ' TO GL store 'n' to rl do while .t. store hcode to hg select 5 @ 4,0 CLEAR STORE 'RENT INCREASE' TO TOP1 DO TOP @ 4,0 SAY 'Enter House Code - ' get hg picture '!!!!!!!!!!' @ 5,0 SAY 'Retreive last letter printed for this tenant (Y/N) - ' get rl PICTURE '!' READ IF CL = 1 PRESSED = LASTKEY() IF PRESSED = 27 RETURN ENDIF ENDIF if hg = ' ' exit endif LOCATE FOR HCODE = HG .AND. ACTIVE = 'Y' IF EOF() ? ? 'TENATE NOT FOUND' ? WAIT LOOP ENDIF *@ 6,40 SAY 'Current rent - ' + str(newrent,6,0) store incamt to inc *adjust date to next ??/01/?? do while .t. if substr(dtoc(dinc),4,2) <> '01' store dinc+1 to dinc loop endif exit enddo @ 4,30 say name @ 9,0 SAY 'Last increase was $'+str(newrent-oldrent,2)+' on '+dtoc(effdate) +' ('+str(date()-effdate,5,0)+' days ago)' @ 10,0 say 'Current rent is -' +str(newrent,5,0) if rutil = 'W' @ 12,0 say 'We pay water bill ' else @ 14,0 say 'Tenate pays water bill' endif @ 6,0 say 'Amt to increase - ' get inc @ 6,40 say 'Date to start increase - ' get dinc READ IF CL = 1 PRESSED = LASTKEY() IF PRESSED = 27 SKIP LOOP ENDIF ENDIF @ 5,0 CLEAR SELECT 2 STORE HG TO FNAME LOCATE FOR HOUSEC = HG IF EOF() ? ? 'HOUSE NOT FOUND' ? WAIT LOOP ENDIF STORE TRIM(HG)+'I' TO HGG IF RL = 'Y' RESTORE FROM &HGG ADDITIVE ELSE STORE MONTH(DATE()) TO LLC IF LLC = 1 STORE 'JANUARY' TO CCR ENDIF IF LLC = 2 STORE 'FEBRUARY' TO CCR ENDIF IF LLC = 3 STORE 'MARCH' TO CCR ENDIF IF LLC = 4 STORE 'APRIL' TO CCR ENDIF IF LLC = 5 STORE 'MAY' TO CCR ENDIF IF LLC = 6 STORE 'JUNE' TO CCR ENDIF IF LLC = 7 STORE 'JULY' TO CCR ENDIF IF LLC = 8 STORE 'AUGUST' TO CCR ENDIF IF LLC = 9 STORE 'SEPTEMBER' TO CCR ENDIF IF LLC = 10 STORE 'OCTOBER' TO CCR ENDIF IF LLC = 11 STORE 'NOVEMBER' TO CCR ENDIF IF LLC = 12 STORE 'DECEMBER' TO CCR ENDIF IF VAL(SUBSTR(DTOC(DATE()),4,2)) < 10 STORE CCR + ' ' + SUBSTR(DTOC(DATE()),5,1) + ', ' + STR(YEAR(DATE()),4,0) TO PMM ELSE STORE CCR + ' ' + SUBSTR(DTOC(DATE()),4,2) + ', ' + STR(YEAR(DATE()),4,0) TO PMM ENDIF STORE PMM TO RL1 SELECT 5 *un capatialize name store name to uu store at(' ',uu) to er store upper(substr(uu,1,1)) + lower(substr(uu,2,er-2)) to uu1 store substr(uu,er+1,40) to uu store at(' ',uu) to er store upper(substr(uu,1,1)) + lower(substr(uu,2,er-2)) to uu2 store substr(uu,er+1,40) to uu store at(' ',uu) to er store upper(substr(uu,1,1)) + lower(substr(uu,2,er-2)) to uu3 store uu1 + ' ' + uu2 + ' ' + uu3 to rl2 STORE STR(PDRENT,6,2) TO RL6 STORE STR(PDLATE,6,2) TO RL8 SELECT 2 *un capatialize address store address to uu store at(' ',uu) to er store upper(substr(uu,1,1)) + lower(substr(uu,2,er-2)) to uu1 store substr(uu,er+1,40) to uu store at(' ',uu) to er store upper(substr(uu,1,1)) + lower(substr(uu,2,er-2)) to uu2 store substr(uu,er+1,40) to uu store at(' ',uu) to er store upper(substr(uu,1,1)) + lower(substr(uu,2,er-2)) to uu3 store uu1 + ' ' + uu2 + ' ' + uu3 to rl3 *un capatialize csz store csz to uu store at(' ',uu) to er store upper(substr(uu,1,1)) + lower(substr(uu,2,er-2)) to uu1 store substr(uu,er+1,40) to uu2 store uu1 + ' ' + uu2 to rl4 SELECT 5 STORE NEWRENT + inc TO NR store NR + inc to NR1 STORE EFFDATE + 365 TO RL16 SELECT 2 STORE ' ' TO RL11,RL12 STORE '1' TO RLTYPE store 'The rents in this area have increased an average of 35 to 40% Now the ' to rl14 store 'rent for a 2 bedroom averages $950 without central heat and $1050 with.' to rl15 STORE "So I'm going to do a partial increase now, then in 6 months look at the" to rl17 store 'rates again and adjust again if necessary.' to rl18 STORE 'Effective ' + dtoc(dinc) + ' your new monthly rent will be $' + str(nr,4,0) to rl19 STORE 'Then in 6 months on March 1st, 2023 your rent may adjust again.' to rl20 STORE 'As always I will try to keep your rent as low as possible. ' to rl21 store 'If you have any questions please call me.' to rl22 ENDIF SET DELIMITER ON STORE 9 TO ROW *@ 7,0 SAY SEP *@ 5,0 GET RL1 *@ 9,0 GET RL2 *@ 10,0 GET RL3 *@ 11,0 GET RL4 *@ 13,0 GET RL5 *@ 14,0 GET RL10 *@ 16,0 get rl14 *@ 17,0 get rl15 *@ 18,0 get rl16 *@ 19,0 get rl17 *@ 20,0 get rl18 *@ 21,0 get rl19 *@ 22,0 get rl20 *@ 23,0 get rl21 *@ 24,0 GET RL22 *READ *SAVE TO &HGG @ 23,0 CLEAR STORE 'Y' TO PPP store 1 to pppp @ 24,30 SAY 'Letter will be printed to file f:\acct\' + trim(hg) + '.prn' @ 24,0 SAY 'PRINT (Y/N) - ' GET PPP PICTURE '!' READ *@ 24,30 say space(50) *@ 24,40 SAY '# COPIES - ' get pppp *READ @ 24,0 clear store 'Y' to sel1 @ 24,0 say 'Update tenate file with this new rent amount (Y/N) - ' get sel1 picture '!' read IF LASTKEY() = 27 EXIT ENDIF IF SEL1 = 'Y' SELECT 5 store hcode to hh DO LOCKWAIT REPLACE OLDRENT WITH NEWRENT REPLACE EFFDATE WITH DINC REPLACE NEWRENT WITH NR UNLOCK select 1 locate for hcode = hh .and. active = 'Y' .and. type = 'T' if eof() do while .t. @ 24,0 say space(80) @ 24,0 say 'Could not locate ' + hcode + ' rental.dbf not updated' store ' ' to dd @ 24,60 say ' ' get dd read enddo endif DO LOCKWAIT * ? NEWRENT *? DINC *? NR *? HCODE *WAIT REPLACE OLDRENT WITH NEWRENT REPLACE EFFDATE WITH DINC REPLACE NEWRENT WITH NR UNLOCK SELECT 1 USE USE RENTAL @ 24,0 SAY SPACE(80) store ' ' to sss @ 24,0 SAY 'Tenant file ' + HCODE + ' is updated !! ' get sss read select 5 ENDIF IF PPP <> 'Y' @ 24,0 say space(80) @ 24,0 say 'Please wait ' select 5 skip LOOP ENDIF @ 4,0 CLEAR IF DBBB = 'SERVER' SET PRINTER TO LPT2 ELSE store trim(hg) + '.doc' to lll SET PRINTER TO &lll ENDIF SET DEVICE TO PRINT SET PRINT ON do while pppp <> 0 ? ' ' ? ' ' ? ' ' ? 'July 31, 2022' ? ' ' ? 'RENT INCREASE' ? ' ' ? 'From:' ? 'TNS Rentals' ? '4716 Carolina Beach Road' ? 'Wilmington, NC 28412' ? ' ' ? 'To:' ? rl2 ? RL3 ? RL4 ? ' ' *? RL11 ? ' ' ? RL14 ? RL15 *? RL16 ? RL17 ? RL18 ? ' ' ? RL19 ? RL20 ? ' ' ? RL21 ? RL22 ? ' ' ? 'Scott Clark' ? '910-232-1405' store pppp-1 to pppp select 5 skip STORE HCODE TO HG set print to SET PRINT OFF SET DEVICE TO SCREEN enddo set print to SET PRINT OFF SET DEVICE TO SCREEN enddo set print to SET PRINT OFF SET DEVICE TO SCREEN ENDDO