*notes - look at the mav income section and the changes made there especially at the end where values are
*being written to cons_value_mav.  this needs to be placed in the fmv section

SET CENTURY ON
set confirm on
set delete on
set safety off
set excl off
set development off
set debug off
*!*	set talk off
*!*	set status off
*!*	set resource off
*!*	set notify off

clear

close all

use defaults

copy struc extended to temp
use temp

locate for lower(field_name) = 'mavexmpt'

If found()

	l310 = .t.
	
Else

	l310 = .f.
	
EndIf

use defaults
		

If l310 and !mavexmpt

	cboth = ' '

	clear
	
	@ 6,20 say 'Version 2014.07.25'
	
	@10,20 say 'Do you wish to run only the MAV Cons Report? (Y/N)' get cboth
	@12,20 say 'A "Yes" response will not produce the FMV report.'
	read


	clear
	@ 8,20 say 'Preparing MAV Cons Reports'
	
	chost = ' '
	
	mavcons()
	
	clear
	
	
	If lower(cboth) = 'y'
		
		close all
		clear
		return
		
	EndIf	
		
EndIf

*!*	close all
*!*	return

clear

c75   = ' '
chost = ' '

@ 6,20 say 'Version 2014.07.25'
		
@ 8,20 say 'Preparing FMV Cons Reports'

@10,20 say 'Include Personal Property Accts less than FMV 7501? (Y/N)' get c75 ;
valid(lower(c75) = 'y' or lower(c75) = 'n')

read

If at('rockdale',lower(coname)) > 0

	clear
	@10,20 say 'Do you want to EXCLUDE HOST?' get chost valid(lower(chost) = 'y' or lower(chost) = 'n')
	read
	
EndIf	

If file('cons_value.dbf')
	erase cons_value.dbf
EndIf	

If !file('cons_value.dbf')

	create table cons_temps(realkey n(10),;
													parcel_no c(20),;
													perskey n(10),;
													acckey n(10),;
													repropkey n(10),;
													commkey n(10),;
													digclass c(3),;
													digstrat c(3),;
													value40 n(10),;
													acres n(8,2),;
													taxdistric c(2),;
													exmptstate n(10),;
													exmptco n(10),;
													exmptsch n(10))
													
	use cons_temps
	copy to cons_value fox2x
	
Else

	use cons_value excl
	zap
	
EndIf	

close all													
													
											 
TdWide()
*-----------------------------------------------------------------------------
FUNCTION TdWide

  munk = 0
  munkc = 0
  ip = 0
  key = 0
  howmany = 0
  np = 0
  percom = 0
  numdone = 0
  mr1 = 0
  mr2 = 0
  mr3 = 0
  mr4 = 0
  mr5 = 0
  mr6 = 0
  mr9 = 0
  mr1c = 0
  mr2c = 0
  mr3c = 0
  mr4c = 0
  mr5c = 0
  mr6c = 0
  mr9c = 0
  ma1 = 0
  ma2 = 0
  ma3 = 0
  ma4 = 0
  ma5 = 0
  ma6 = 0
  ma9 = 0
  ma1c = 0
  ma2c = 0
  ma3c = 0
  ma4c = 0
  ma5c = 0
  ma6c = 0
  ma9c = 0
  mc1 = 0
  mc2 = 0
  mc3 = 0
  mc4 = 0
  mc5 = 0
  mc6 = 0
  mc9 = 0
  mc1c = 0
  mc2c = 0
  mc3c = 0
  mc4c = 0
  mc5c = 0
  mc6c = 0
  mc9c = 0
  mi1 = 0
  mi2 = 0
  mi3 = 0
  mi4 = 0
  mi5 = 0
  mi6 = 0
  mi9 = 0
  mi1c = 0
  mi2c = 0
  mi3c = 0
  mi4c = 0
  mi5c = 0
  mi6c = 0
  mi9c = 0
  mv1 = 0
  mv2 = 0
  mv3 = 0
  mv4 = 0
  mv5 = 0
  mv6 = 0
  mv9 = 0
  mv1c = 0
  mv2c = 0
  mv3c = 0
  mv4c = 0
  mv5c = 0
  mv6c = 0
  mv9c = 0
  mp1 = 0
  mp2 = 0
  mp3 = 0
  mp4 = 0
  mp5 = 0
  mp6 = 0
  mp9 = 0
  mp1c = 0
  mp2c = 0
  mp3c = 0
  mp4c = 0
  mp5c = 0
  mp6c = 0
  mp9c = 0
  mh1 = 0
  mh2 = 0
  mh3 = 0
  mh4 = 0
  mh5 = 0
  mh6 = 0
  mh9 = 0
  mh1c = 0
  mh2c = 0
  mh3c = 0
  mh4c = 0
  mh5c = 0
  mh6c = 0
  mh9c = 0
  mw1 = 0
  mw2 = 0
  mw3 = 0
  mw4 = 0
  mw5 = 0
  mw6 = 0
  mw9 = 0
  mw1c = 0
  mw2c = 0
  mw3c = 0
  mw4c = 0
  mw5c = 0
  mw6c = 0
  mw9c = 0
  me0 = 0
  me1 = 0
  me2 = 0
  me3 = 0
  me4 = 0
  me5 = 0
  me6 = 0
  me7 = 0
  me8 = 0
  me9 = 0
  me0c = 0
  me1c = 0
  me2c = 0
  me3c = 0
  me4c = 0
  me5c = 0
  me6c = 0
  me7c = 0
  me8c = 0
  me9c = 0
  mu1 = 0
  mu2 = 0
  mu3 = 0
  mu4 = 0
  mu5 = 0
  mu6 = 0
  mu9 = 0
  mu1c = 0
  mu2c = 0
  mu3c = 0
  mu4c = 0
  mu5c = 0
  mu6c = 0
  mu9c = 0
  mt1 = 0
  mt2 = 0
  mt3 = 0
  mt4 = 0
  mt5 = 0
  mt6 = 0
  mt9 = 0
  mt1c = 0
  mt2c = 0
  mt3c = 0
  mt4c = 0
  mt5c = 0
  mt6c = 0
  mt9c = 0
  pcnt = 0
  mb1  = 0
  mb3  = 0
  mb4  = 0
  mb5  = 0
  mb6  = 0
  mb1c = 0
  mb3c = 0
  mb4c = 0
  mb5c = 0
  mb6c = 0
**
  mj1  = 0
  mj3  = 0
  mj4  = 0
  mj5  = 0
  mj6  = 0
  mj9  = 0
  mj1c = 0
  mj3c = 0
  mj4c = 0
  mj5c = 0
  mj6c = 0
  mj9c = 0
**
  mf1  = 0
  mf3  = 0
  mf4  = 0
  mf5  = 0
  mf6  = 0
  mf9  = 0
  mf1c = 0
  mf3c = 0
  mf4c = 0
  mf5c = 0
  mf6c = 0
  mf9c = 0
  r1ac = 0
  r3ac = 0
  r4ac = 0
  r5ac = 0
  r9ac = 0
  i3ac = 0
  i4ac = 0
  i5ac = 0
  i9ac = 0
  c1ac = 0
  c3ac = 0
  c4ac = 0
  c5ac = 0
  c9ac = 0  
  a1ac = 0
  a3ac = 0
  a4ac = 0
  a5ac = 0
  a9ac = 0  
  v3ac = 0
  v4ac = 0
  v5ac = 0
  v9ac = 0    
  w3ac = 0
  w4ac = 0
  w5ac = 0
  w9ac = 0  
  t3ac = 0
  t4ac = 0
  t5ac = 0
  t9ac = 0  
  p3ac = 0
  p4ac = 0
  p5ac = 0
  p9ac = 0 
  h3ac = 0
  h4ac = 0
  h5ac = 0
  h9ac = 0
  u2ac = 0    
  u3ac = 0
  u4ac = 0
  u5ac = 0
  u9ac = 0    
  e0ac = 0
  e1ac = 0
  e2ac = 0
  e3ac = 0  
  e4ac = 0
  e5ac = 0
  e6ac = 0
  e7ac = 0
  e8ac = 0
  e9ac = 0
  b3ac = 0
  b4ac = 0
  b5ac = 0
  j3ac = 0
  j4ac = 0
  j5ac = 0
  j9ac = 0
  f3ac = 0
  f4ac = 0
  f5ac = 0
  f9ac = 0  
   
  sx = 0
  sxcount = 0
    
	HOMECNT = 0
	S1 = 0
	S1COUNT = 0
	S2S = 0
	S2  = 0
	S2C = 0
	S2COUNT = 0
	
	sccount = 0
	SC65 = 0
	SC  = 0
	SCC = 0
	
	sdcount = 0
	sd65 = 0
	sd = 0
	sdc = 0
	
	secount = 0
	se65 = 0
	se = 0
		
	sgcount = 0
	sg = 0
	
	S2COUNT = 0
	S3 = 0
	S3COUNT = 0
	S3C = 0
	S3S  = 0
	S4S = 0
	S4 = 0
	S4C = 0
	s465 = 0
	S4COUNT = 0
	
	S5 = 0
	S5COUNT = 0
	SS = 0
	SSCOUNT = 0
	
	
	S6 = 0
	S6count = 0
	ss = 0
	sscount = 0
	sss = 0
	ssc = 0
	S8 = 0
	S8count = 0
	S9 = 0
	S9count = 0
	s6s = 0
	s7s = 0
	s8s = 0
	s9s = 0
	sb  = 0
	sbcount = 0
	sy = 0
	sycount = 0
	
	PREF1 = 0
	PREF2 = 0
	PREF1CT = 0
	PREF2CT = 0
	ACPREF  = 0
	CUFMV1 = 0
	CUFMV2 = 0
	CUACC = 0
	CUTOT = 0
	CUCNT = 0
	SwTot = 0
	SwCnt = 0
	SwFmv1 = 0
	SwFmv2 = 0
	SwAcc  = 0
	SjTot = 0
	SjCnt = 0
	SjFmv1 = 0
	SjFmv2 = 0
	
	td  = space(2)
	tdx = '  '
	L1s = 0 && variable for Lowndes school & county
	L1 = 0  && variable for Lowndes state
	L1Count = 0
	L2S = 0
	L2 = 0
	L2C = 0
	L2COUNT = 0
	L3S = 0
	L3 = 0
	L3C = 0
	L3COUNT =	0
	L4S = 0
	L4 = 0
	L4C = 0
	L4COUNT = 0
	L5S = 0
	L5 = 0
	L5C = 0
	L5COUNT =	0
	L6S = 0
	L6 = 0
	L6C = 0
	L6COUNT =	0
	L7S = 0
	L7 = 0
	L7C = 0
	L7COUNT =	0
	L8S = 0
	L8 = 0
	L8C = 0
	L8COUNT =	0
	L9S = 0
	L9 = 0
	L9C = 0
	L9COUNT =	0	
	L2AC = 0
	L2AS = 0
	L2A = 0
	L2ACount = 0
	S5ACount = 0
	S5A = 0
	L10 = 0
	L10COUNT = 0
	HistCnt = 0
	HistEx = 0
	TranCnt = 0
	TranEx = 0
	F1  = 0
	F1C = 0
	F1S = 0
	f1cnt = 0
	F3  = 0
	F3C = 0
	F3S = 0
	f3cnt = 0
	F4  = 0
	F4C = 0
	F4S = 0
	F4cnt = 0
	F5  = 0
	F5C = 0
	F5S = 0
	F5cnt = 0
	Fs  = 0
	FsC = 0
	FsS = 0
	Fscnt = 0
	F15 = 0
	F15C = 0
	F15S = 0
	F15cnt = 0
	F16  = 0
	F16C = 0
	F16S = 0
	F16cnt = 0
	fs16 = 0
	fs16c = 0
	fs16s = 0
	fs16cnt = 0
	L15  = 0
	L15C = 0
	L15S = 0
	L15cnt = 0
	L16  = 0
	L16C = 0
	L16S = 0
	L16cnt = 0
	LS16  = 0
	LS16C = 0
	LS16S = 0
	LS16cnt = 0
	
	
  RbTot = 0
  RbNum = 0
  RaTot = 0
  RaNum = 0
  RiTot = 0
  RiNum = 0
  RzTot = 0
  RzNum = 0
  RfTot = 0
  RfNum = 0
  RpTot = 0
  RpNum = 0
  RCurr = 0
  RCurrNum = 0
  AbTot = 0
  AbNum = 0
  AaTot = 0
  AaNum = 0
  AiTot = 0
  AiNum = 0
  AzTot = 0
  AzNum = 0
  AfTot = 0
  AfNum = 0
  ApTot = 0
  ApNum = 0
  ACurr = 0
  ACurrNum = 0
  CbTot = 0
  CbNum = 0
  CaTot = 0
  CaNum = 0
  CiTot = 0
  CiNum = 0
  CzTot = 0
  CzNum = 0
  CfTot = 0
  CfNum = 0
  CpTot = 0
  CPNum = 0
  CCurr = 0
  CCurrNum = 0
  IbTot = 0
  IbNum = 0
  IaTot = 0
  IaNum = 0
  IiTot = 0
  IiNum = 0
  IzTot = 0
  IzNum = 0
  IfTot = 0
  IfNum = 0
  IpTot = 0
  IpNum = 0
  ICurr = 0
  ICurrNum = 0
  UbTot = 0
  UbNum = 0
  UaTot = 0
  UaNum = 0
  UiTot = 0
  UiNum = 0
  UzTot = 0
  UzNum = 0
  UfTot = 0
  UfNum = 0
  UpTot = 0
  UpNum = 0
  UCurr = 0
  UCurrNum = 0
  CurrNum = 0
  CurrTot = 0
  FreeNum = 0
  FreeTot = 0
  SpNum = 0
  SpTot = 0
  MessX = 'Creating Consolidation Report'
  HMany = 0
  E1Tot = 0
  E1Num = 0
  E2Tot = 0
  E2Num = 0
  E3Tot = 0
  E3Num = 0
  E4Tot = 0
  E4Num = 0
  E5Tot = 0
  E5Num = 0
  E6Tot = 0
  E6Num = 0
  E7Tot = 0
  E7Num = 0
  E8Tot = 0
  E8Num = 0
  E9Tot = 0
  E9Num = 0
  E0Tot = 0
  E0Num = 0
  
	mv    = 0
	mvc   = 0
	mh    = 0
	mhc   = 0 
	ti    = 0
	tic   = 0
	hd    = 0
	hdc   = 0
	linc  = .f.
  
  StExVal = 0
  BnExCnt = 0
  BnExVal = 0
  MoExCnt = 0
  MoExVal = 0
  ShExVal = 0
  GrVal = 0
  GrAc = 0
  GrCnt = 0
  

	close all
	
	sele G
	use Defaults shared
	
	sele H
	use tdtemp
	
	sele 15
	use landsubs
	set order to realkey
	
	sele 16
	use inc_detail
	set order to realkey
	
	sele 17
	use cons_value
	
*!*		sele 18
*!*		use commcnt excl
*!*		zap
	
	sele A
	Use Realprop shared
	set order to RealKey
	
	go top
	clear
	
*!*		@ 6,20 say 'Version 2013.05.29'
	
	
	@ 8,20 say 'Preparing FMV Consolidation Report'
	
	Do While .not. Eof() .and. Key <> 27
	
		@10,20 say 'Consolidating Land Values'
		@12,20 say recno()
		
	  Key = InKey()
	
		ltd = .f.
		
		If realprop.income
		
			linc = .t.
			
		Else
		
			linc = .f.
			
		EndIf		
		
		sele tdtemp
		
		go top
		
		Do While !eof()
		
			If taxdistric = realprop.taxdistric
			
				ltd = .t.
				exit
				
			EndIf
			
			skip
			
		EndDo
		
*!*			loca for taxdistric = realprop.taxdstric
*!*			  
*!*			If found()
*!*				ltd = .t.  
*!*			EndIf
		
		sele realprop
			
	  If !ltd 
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  EndIf
	  
	  If digclass < 'A' or digclass > 'W'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,;
      					realprop.digstrat,;
      					iif(sale_val,round(saleland1*.4,0),round(a_value+p_value*.4,0)),alias(),realprop.totalacres,;
      					realprop.taxdistric)
	  	
	  	munk = munk + 1
	  	
	  	skip
	  	
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf

	  
	  EndIf
	  
	  If digstrat < '0' or digstrat > '9'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,;
      					realprop.digstrat,;
      					iif(sale_val,round(saleland1*.4,0),round(a_value+p_value*.4,0)),alias(),realprop.totalacres,;
      					realprop.taxdistric)

			munk = munk + 1
			
	  	skip
	  	
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  
	  	
	  EndIf
	  
	  If sale_val and digclass <> 'E'
				
			nval1 = ' '
			ncnt1 = ' '
			nacr1 = ' '
			aac   = 0
			pac   = 0

			If digclass = 'P' or digclass = 'V' or digclass='J'
			
				sele landsubs
				seek realprop.realkey
	      
	      Do While !eof() and realkey = realprop.realkey
	      
	      	If !pref and sub_type <> 'CUV'
	      	
	      		aac  = aac + acres
	      		
	      	Else
	      	
	      		If sub_type <> 'CUV' and sub_type <> 'FLP'
	      	
		      		pac = pac + acres
		      		
		      	EndIf	
	      			
	      	EndIf
	      	
	      	skip
	      	
	      EndDo
	      
	      sele realprop
	      
	    Else
	    
	    	aac = totalacres
	    	
	    EndIf  
			
  		If saleland1 > 0
  		
  			nval1 = 'm' + iif(digclass = 'P' or digclass = 'V' or digclass = 'J', 'A', digclass) + digstrat
  			ncnt1 = 'm' + iif(digclass = 'P' or digclass = 'V' or digclass = 'J', 'A', digclass) + digstrat + 'c'
  			nacr1 = iif(digclass = 'P' or digclass = 'V' or digclass = 'J', 'A', digclass) + digstrat + 'ac'
  			
  			&nval1 = &nval1 + round(saleland1*.4,0)
  			&ncnt1 = &ncnt1 + 1
  			&nacr1 = &nacr1 + aac
  			
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,iif(digclass = 'P' or digclass = 'V' or digclass = 'J','A',digclass),;
	      					realprop.digstrat,;
	      					round(saleland1*.4,0),alias(),aac,;
	      					realprop.taxdistric)
  			
  		EndIf

			nval1 = ' '
			ncnt1 = ' '
  		nacr1 = ' '

  		
  		If saleland2 > 0
  		
  			Do Case
  			
	  			Case digclass = 'P'
	  			
		  			nval1 = 'mP' + digstrat
		  			ncnt1 = 'mP' + digstrat + 'c'
	  				nacr1 = 'P' + digstrat + 'ac'
	  			  			
		  			&nval1 = &nval1 + round(saleland2*.4,0)
		  			&ncnt1 = &ncnt1 + 1
		  			&nacr1 = &nacr1 + pac
		  			  			
			      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
			      					round(saleland2*.4,0),alias(),pac,;
			      					realprop.taxdistric)
	  			
					Case digclass = 'V'
					
					
		  			nval1 = 'mV' + digstrat
		  			ncnt1 = 'mV' + digstrat + 'c'
	  				nacr1 = 'V' + digstrat + 'ac'
	  			  			
		  			&nval1 = &nval1 + round(saleland2*.4,0)
		  			&ncnt1 = &ncnt1 + 1
		  			&nacr1 = &nacr1 + pac
		  			  			
			      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
			      					round(saleland2*.4,0),alias(),pac,;
			      					realprop.taxdistric)
				
					Case digclass = 'J'
					
					
		  			nval1 = 'mJ' + digstrat
		  			ncnt1 = 'mJ' + digstrat + 'c'
	  				nacr1 = 'J' + digstrat + 'ac'
	  			  			
		  			&nval1 = &nval1 + round(saleland2*.4,0)
		  			&ncnt1 = &ncnt1 + 1
		  			&nacr1 = &nacr1 + pac
		  			  			
			      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'J',realprop.digstrat,;
			      					round(saleland2*.4,0),alias(),pac,;
			      					realprop.taxdistric)


				EndCase
  		
  		EndIf
  		
  		If digclass = 'J'

  			nval1 = 'mf' + digstrat
  			ncnt1 = 'mf' + digstrat + 'c'
  			nacr1 = 'f' + digstrat + 'ac'
  		
				sele f
				use flpamain
				set order to realkey
				
				seek realprop.realkey
				
				If found()
				
					&nval1 = &nval1 + round(currflpa * .4,0)
					
					sele realprop
					
					&nacr1  = &nacr1 + flpamain.covacres
					&ncnt1 = &ncnt1 + 1

					If flpamain.currflpa > 0 
				    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'F',realprop.digstrat,;
				    					round(flpamain.currflpa * .4,0),alias(),flpamain.covacres,realprop.taxdistric)
				  EndIf 
				  
				EndIf  
				   					
  		EndIf
	  
	  	sele realprop
	  	skip

		  pcnt = pcnt + 1	  	

	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf		
	  
	  EndIf

		If !linc

			Do Case
			  Case DigClass = 'A' .and. P_Value = 0 
					MDigA()
			  Case DigClass = 'R' 
			    MDigR()
			  Case DigClass = 'C' 
			    MDigC()
			  Case DigClass = 'I' 
			    MDigI()
		  	Case DigClass = 'V' 
			    MDigV()
			  Case DigClass = 'W' 
			    MDigW()
			  Case DigClass = 'T' 
			    MDigT()
			  Case DigClass = 'P' &&.or. P_Value > 0 
			    MDigP()
			  Case DigClass = 'E' 
			    MDigE()
			  Case DigClass = 'U' 
			    MDigU()
			  Case DigClass = 'H' 
			    MDigH()
			  Case Digclass = 'B'
			  	MDigB()
			  Case Digclass = 'J'
			  	mDigJ()	  
	  	  Otherwise
			    munk = munk + IIF(OvRideVal > 0,OvRideVal,A_Value)
			    munkc = munkc + 1
		  	  munk = munk + IIF(OvRideVal = 0,P_Value,0)
		    	If OvRideVal = 0 .and. P_Value > 0
		      	munkc = munkc + 1
			    EndIf    
			EndCase
			
		Else
		
			If realprop.sale_val
				lsb3 = .t.
			Else
				lsb3 = .f.
			EndIf
					
			sele inc_detail
			seek realprop.realkey
			
			If found()
			
				Do Case
				
					Case inc_land > 0
						nland = inc_land
					Otherwise
						nland = realprop.a_value + realprop.p_value
							
				EndCase
			
			
				Do Case
				
					Case realprop.digclass = 'E'

				  	Do Case
				  	
					    Case realprop.Digstrat = '0'
					    
								If inc_imp > 0
									me0  = me0 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me0c = me0c + 1
								EndIf	
					    
					      me0 = me0 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me0c = me0c + 1
					      e0ac = e0ac +realprop.totalacres      
				  	
					    Case realprop.Digstrat = '1'
					    
								If inc_imp > 0
									me1  = me1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me1c = me1c + 1
								EndIf	
					    
					      me1 = me1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me1c = me1c + 1
					      e1ac = e1ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '2'

								If inc_imp > 0
									me2  = me2 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me2c = me2c + 1
								EndIf	

					      me2 = me2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me2c = me2c + 1
					      e2ac = e2ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '3'

								If inc_imp > 0
									me3  = me3 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me3c = me3c + 1
								EndIf	

					      me3 = me3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me3c = me3c + 1
					      e3ac = e3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'

								If inc_imp > 0
									me4  = me4 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me4c = me4c + 1
								EndIf	
					    					    
					      me4 = me4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me4c = me4c + 1
					      e4ac = e4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'

								If inc_imp > 0
									me5  = me5 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me5c = me5c + 1
								EndIf	
					    
					      me5 = me5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me5c = me5c + 1
					      e5ac = e5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					    
								If inc_imp > 0
									me6  = me6 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me6c = me6c + 1
								EndIf	
					    
					      me6 = me6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me6c = me6c + 1
					      e6ac = e6ac +realprop.totalacres      					      
					      
					    Case realprop.Digstrat = '7'
					    
								If inc_imp > 0
									me7  = me7 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me7c = me7c + 1
								EndIf	
					    
					      me7 = me7 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me7c = me7c + 1
					      e7ac = e7ac +realprop.totalacres      
					      
					    Case realprop.Digstrat = '8'
					    
								If inc_imp > 0
									me8  = me8 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me8c = me8c + 1
								EndIf	
					    
					      me8 = me8 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me8c = me8c + 1
					      e8ac = e8ac +realprop.totalacres      


					    Case realprop.Digstrat = '9'
					    
								If inc_imp > 0
									me9  = me9 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me9c = me9c + 1
								EndIf	
					    
					      me9 = me9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me9c = me9c + 1
					      e9ac = e9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase
				
				  Case inc_cs = 'A' 
				  
						If inc_imp > 0
					  	ma1  = ma1 + round(inc_imp * .4,0)
					  	ma1c = ma1c + 1
					  EndIf	

				  	Do Case
					    Case realprop.DigStrat = '1'
					      ma1 = ma1 + round(nland * .4,0)
					      ma1c = ma1c + 1
					    Case realprop.Digstrat = '2'
					      ma2 = ma2 + round(nland * .4,0)
					      ma2c = ma2c + 1
					    Case realprop.Digstrat = '3'
					      ma3 = ma3 + round(nland * .4,0)
					      ma3c = ma3c + 1
					      a3ac = a3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      ma4 = ma4 + round(nland * .4,0)
					      ma4c = ma4c + 1
					      a4ac = a4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      ma5 = ma5 + round(nland * .4,0)
					      ma5c = ma5c + 1
					      a5ac = a5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      ma6 = ma6 + round(nland * .4,0)
					      ma6c = ma6c + 1
					    Case realprop.Digstrat = '9'
					      ma9 = ma9 + round(nland * .4,0)
					      ma9c = ma9c + 1
					      a9ac = a9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'R' 

						If inc_imp > 0
							mr1  = mr1 + round(inc_imp * .4,0)
							mr1c = mr1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mr1 = mr1 + round(nland * .4,0)
					      mr1c = mr1c + 1
					    Case realprop.Digstrat = '2'
					      mr2 = mr2 + round(nland * .4,0)
					      mr2c = mr2c + 1
					    Case realprop.Digstrat = '3'
					      mr3 = mr3 + round(nland * .4,0)
					      mr3c = mr3c + 1
					      r3ac = r3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mr4 = mr4 + round(nland * .4,0)
					      mr4c = mr4c + 1
					      r4ac = r4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mr5 = mr5 + round(nland * .4,0)
					      mr5c = mr5c + 1
					      r5ac = r5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mr6 = mr6 + round(nland * .4,0)
					      mr6c = mr6c + 1
					    Case realprop.Digstrat = '9'
					      mr9 = mr9 + round(nland * .4,0)
					      mr9c = mr9c + 1
					      r9ac = r9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'C' 

						If inc_imp > 0
						
							mc1  = mc1 + round(inc_imp * .4,0)
							mc1c = mc1c + 1

*!*								sele commcnt
*!*								appen blank
*!*								replace realkey with realprop.realkey
*!*								
*!*								sele inc_detail
							
						EndIf	
						
				  	Do Case  && check this cae out
				  		
				  		Case realprop.digclass = 'E'

						  	Do Case
						  	
							    Case realprop.Digstrat = '0'
							    
										If inc_imp > 0
											me0  = me0 + round(inc_imp * .4,0)
											me0c = me0c + 1
										EndIf	
							    
							      me0 = me0 + round(nland * .4,0)
							      me0c = me0c + 1
							      e0ac = e0ac +realprop.totalacres      
						  	
							    Case realprop.Digstrat = '1'
							    
										If inc_imp > 0
											me1  = me1 + round(inc_imp * .4,0)
											me1c = me1c + 1
										EndIf	
							    
							      me1 = me1 + round(nland * .4,0)
							      me1c = me1c + 1
							      e1ac = e1ac +realprop.totalacres      					      					      
							    Case realprop.Digstrat = '2'

										If inc_imp > 0
											me2  = me2 + round(inc_imp * .4,0)
											me2c = me2c + 1
										EndIf	

							      me2 = me2 + round(nland * .4,0)
							      me2c = me2c + 1
							      e2ac = e2ac +realprop.totalacres      					      					      
							    Case realprop.Digstrat = '3'

										If inc_imp > 0
											me3  = me3 + round(inc_imp * .4,0)
											me3c = me3c + 1
										EndIf	

							      me3 = me3 + round(nland * .4,0)
							      me3c = me3c + 1
							      e3ac = e3ac + realprop.TotalAcres
							    Case realprop.Digstrat = '4'

										If inc_imp > 0
											me4  = me4 + round(inc_imp * .4,0)
											me4c = me4c + 1
										EndIf	
							    					    
							      me4 = me4 + round(nland * .4,0)
							      me4c = me4c + 1
							      e4ac = e4ac +realprop.totalacres      
							    Case realprop.Digstrat = '5'

										If inc_imp > 0
											me5  = me5 + round(inc_imp * .4,0)
											me5c = me5c + 1
										EndIf	
							    
							      me5 = me5 + round(nland * .4,0)
							      me5c = me5c + 1
							      e5ac = e5ac +realprop.totalacres      
							    Case realprop.Digstrat = '6'
							    
										If inc_imp > 0
											me6  = me6 + round(inc_imp * .4,0)
											me6c = me6c + 1
										EndIf	
							    
							      me6 = me6 + round(nland * .4,0)
							      me6c = me6c + 1
							      e6ac = e6ac +realprop.totalacres      					      
							      
							    Case realprop.Digstrat = '7'
							    
										If inc_imp > 0
											me7  = me7 + round(inc_imp * .4,0)
											me7c = me7c + 1
										EndIf	
							    
							      me7 = me7 + round(nland * .4,0)
							      me7c = me7c + 1
							      e7ac = e7ac +realprop.totalacres      
							      
							    Case realprop.Digstrat = '8'
							    
										If inc_imp > 0
											me8  = me8 + round(inc_imp * .4,0)
											me8c = me8c + 1
										EndIf	
							    
							      me8 = me8 + round(nland * .4,0)
							      me8c = me8c + 1
							      e8ac = e8ac +realprop.totalacres      


							    Case realprop.Digstrat = '9'
							    
										If inc_imp > 0
											me9  = me9 + round(inc_imp * .4,0)
											me9c = me9c + 1
										EndIf	
							    
							      me9 = me9 + round(nland * .4,0)
							      me9c = me9c + 1
							      e9ac = e9ac +realprop.totalacres      
							    OtherWise
							      munk = munk + round(nland * .4,0)
							      munkc = munkc + 1
						    EndCase

				  		
				  		
				  			
*!*					  			Do Case
*!*					  				
*!*					  				Case realprop.totalacres < 5
*!*					  					mc3 = mc3 + round(inc_land *.4,0)
*!*					  					mc3c = mc3c + 1
*!*					  				Case realprop.totalacres >= 5 and realprop.totalacres <= 25
*!*					  					mc4 = mc4 + round(inc_land *.4,0)
*!*					  					mc4c = mc4c + 1
*!*					  				Case realprop.totalacres > 25
*!*					  					mc5 = mc5 + round(inc_land *.4,0)
*!*					  					mc5c = mc5c + 1

*!*					  			EndCase
				  			
					    Case realprop.Digstrat = '1'
					      mc1 = mc1 + round(nland * .4,0)
					      mc1c = mc1c + 1
					      
*!*						      sele commcnt
*!*						      append blank
*!*						      replace realkey with realprop.realkey
*!*						      sele inc_detail
					      
					    Case realprop.Digstrat = '2'
					      mc2 = mc2 + round(nland * .4,0)
					      mc2c = mc2c + 1
					    Case realprop.Digstrat = '3'
					      mc3 = mc3 + round(nland * .4,0)
					      mc3c = mc3c + 1
					      c3ac = c3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mc4 = mc4 + round(nland * .4,0)
					      mc4c = mc4c + 1
					      c4ac = c4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mc5 = mc5 + round(nland * .4,0)
					      mc5c = mc5c + 1
					      c5ac = c5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mc6 = mc6 + round(nland * .4,0)
					      mc6c = mc6c + 1
					    Case realprop.Digstrat = '9'
					      mc9 = mc9 + round(nland * .4,0)
					      mc9c = mc9c + 1
					      c9ac = c9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'I' 

						If inc_imp > 0
							mi1  = mi1 + round(inc_imp * .4,0)
							mi1c = mi1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mi1 = mi1 + round(nland * .4,0)
					      mi1c = mi1c + 1
					    Case realprop.Digstrat = '2'
					      mi2 = mi2 + round(nland * .4,0)
					      mi2c = mi2c + 1
					    Case realprop.Digstrat = '3'
					      mi3 = mi3 + round(nland * .4,0)
					      mi3c = mi3c + 1
					      i3ac = i3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mi4 = mi4 + round(nland * .4,0)
					      mi4c = mi4c + 1
					      i4ac = i4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mi5 = mi5 + round(nland * .4,0)
					      mi5c = mi5c + 1
					      i5ac = i5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mi6 = mi6 + round(nland * .4,0)
					      mi6c = mi6c + 1
					    Case realprop.Digstrat = '9'
					      mi9 = mi9 + round(nland * .4,0)
					      mi9c = mi9c + 1
					      i9ac = i9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

			  	Case inc_cs = 'V' 

						If inc_imp > 0
							mv1  = mv1 + round(inc_imp * .4,0)
							mv1c = mv1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mv1 = mv1 + round(nland * .4,0)
					      mv1c = mv1c + 1
					    Case realprop.Digstrat = '2'
					      mv2 = mv2 + round(nland * .4,0)
					      mv2c = mv2c + 1
					    Case realprop.Digstrat = '3'
					      mv3 = mv3 + round(nland * .4,0)
					      mv3c = mv3c + 1
					      v3ac = v3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mv4 = mv4 + round(nland * .4,0)
					      mv4c = mv4c + 1
					      v4ac = v4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mv5 = mv5 + round(nland * .4,0)
					      mv5c = mv5c + 1
					      v5ac = v5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mv6 = mv6 + round(nland * .4,0)
					      mv6c = mv6c + 1
					    Case realprop.Digstrat = '9'
					      mv9 = mv9 + round(nland * .4,0)
					      mv9c = mv9c + 1
					      v9ac = v9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'W' 

						If inc_imp > 0
							mw1  = mw1 + round(inc_imp * .4,0)
							mw1c = mw1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mw1 = mw1 + round(nland * .4,0)
					      mw1c = mw1c + 1
					    Case realprop.Digstrat = '2'
					      mw2 = mw2 + round(nland * .4,0)
					      mw2c = mw2c + 1
					    Case realprop.Digstrat = '3'
					      mw3 = mw3 + round(nland * .4,0)
					      mw3c = mw3c + 1
					      w3ac = w3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mw4 = mw4 + round(nland * .4,0)
					      mw4c = mw4c + 1
					      w4ac = w4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mw5 = mw5 + round(nland * .4,0)
					      mw5c = mw5c + 1
					      w5ac = w5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mw6 = mw6 + round(nland * .4,0)
					      mw6c = mw6c + 1
					    Case realprop.Digstrat = '9'
					      mw9 = mw9 + round(nland * .4,0)
					      mw9c = mw9c + 1
					      w9ac = w9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase


				  Case inc_cs = 'T' 

						If inc_imp > 0
							mt1  = mt1 + round(inc_imp * .4,0)
							mt1c = mt1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mt1 = mt1 + round(nland * .4,0)
					      mt1c = mt1c + 1
					    Case realprop.Digstrat = '2'
					      mt2 = mt2 + round(nland * .4,0)
					      mt2c = mt2c + 1
					    Case realprop.Digstrat = '3'
					      mt3 = mt3 + round(nland * .4,0)
					      mt3c = mt3c + 1
					      t3ac = t3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mt4 = mt4 + round(nland * .4,0)
					      mt4c = mt4c + 1
					      t4ac = t4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mt5 = mt5 + round(nland * .4,0)
					      mt5c = mt5c + 1
					      t5ac = t5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mt6 = mt6 + round(nland * .4,0)
					      mt6c = mt6c + 1
					    Case realprop.Digstrat = '9'
					      mt9 = mt9 + round(nland * .4,0)
					      mt9c = mt9c + 1
					      t9ac = t9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'P'

						If inc_imp > 0
							mp1  = mp1 + round(inc_imp * .4,0)
							mp1c = mp1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mp1 = mp1 + round(nland * .4,0)
					      mp1c = mp1c + 1
					    Case realprop.Digstrat = '2'
					      mp2 = mp2 + round(nland * .4,0)
					      mp2c = mp2c + 1
					    Case realprop.Digstrat = '3'
					      mp3 = mp3 + round(nland * .4,0)
					      mp3c = mp3c + 1
					      p3ac = p3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mp4 = mp4 + round(nland * .4,0)
					      mp4c = mp4c + 1
					      p4ac = p4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mp5 = mp5 + round(nland * .4,0)
					      mp5c = mp5c + 1
					      p5ac = p5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mp6 = mp6 + round(nland * .4,0)
					      mp6c = mp6c + 1
					    Case realprop.Digstrat = '9'
					      mp9 = mp9 + round(nland * .4,0)
					      mp9c = mp9c + 1
					      p9ac = p9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'E' 

				  	Do Case
				  	
					    Case realprop.Digstrat = '0'
					    
								If inc_imp > 0
									me0  = me0 + round(inc_imp * .4,0)
									me0c = me0c + 1
								EndIf	
					    
					      me0 = me0 + round(nland * .4,0)
					      me0c = me0c + 1
					      e0ac = e0ac +realprop.totalacres      
				  	
					    Case realprop.Digstrat = '1'
					    
								If inc_imp > 0
									me1  = me1 + round(inc_imp * .4,0)
									me1c = me1c + 1
								EndIf	
					    
					      me1 = me1 + round(nland * .4,0)
					      me1c = me1c + 1
					      e1ac = e1ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '2'

								If inc_imp > 0
									me2  = me2 + round(inc_imp * .4,0)
									me2c = me2c + 1
								EndIf	

					      me2 = me2 + round(nland * .4,0)
					      me2c = me2c + 1
					      e2ac = e2ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '3'

								If inc_imp > 0
									me3  = me3 + round(inc_imp * .4,0)
									me3c = me3c + 1
								EndIf	

					      me3 = me3 + round(nland * .4,0)
					      me3c = me3c + 1
					      e3ac = e3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'

								If inc_imp > 0
									me4  = me4 + round(inc_imp * .4,0)
									me4c = me4c + 1
								EndIf	
					    					    
					      me4 = me4 + round(nland * .4,0)
					      me4c = me4c + 1
					      e4ac = e4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'

								If inc_imp > 0
									me5  = me5 + round(inc_imp * .4,0)
									me5c = me5c + 1
								EndIf	
					    
					      me5 = me5 + round(nland * .4,0)
					      me5c = me5c + 1
					      e5ac = e5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					    
								If inc_imp > 0
									me6  = me6 + round(inc_imp * .4,0)
									me6c = me6c + 1
								EndIf	
					    
					      me6 = me6 + round(nland * .4,0)
					      me6c = me6c + 1
					      e6ac = e6ac +realprop.totalacres      					      
					      
					    Case realprop.Digstrat = '7'
					    
								If inc_imp > 0
									me7  = me7 + round(inc_imp * .4,0)
									me7c = me7c + 1
								EndIf	
					    
					      me7 = me7 + round(nland * .4,0)
					      me7c = me7c + 1
					      e7ac = e7ac +realprop.totalacres      
					      
					    Case realprop.Digstrat = '8'
					    
								If inc_imp > 0
									me8  = me8 + round(inc_imp * .4,0)
									me8c = me8c + 1
								EndIf	
					    
					      me8 = me8 + round(nland * .4,0)
					      me8c = me8c + 1
					      e8ac = e8ac +realprop.totalacres      


					    Case realprop.Digstrat = '9'
					    
								If inc_imp > 0
									me9  = me9 + round(inc_imp * .4,0)
									me9c = me9c + 1
								EndIf	
					    
					      me9 = me9 + round(nland * .4,0)
					      me9c = me9c + 1
					      e9ac = e9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase


				  Case inc_cs = 'U' 

						If inc_imp > 0
							mu1  = mu1 + round(inc_imp * .4,0)
							mu1c = mu1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mu1 = mu1 + round(nland * .4,0)
					      mu1c = mu1c + 1
					    Case realprop.Digstrat = '2'
					      mu2 = mu2 + round(nland * .4,0)
					      mu2c = mu2c + 1
					    Case realprop.Digstrat = '3'
					      mu3 = mu3 + round(nland * .4,0)
					      mu3c = mu3c + 1
					      u3ac = u3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mu4 = mu4 + round(nland * .4,0)
					      mu4c = mu4c + 1
					      u4ac = u4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mu5 = mu5 + round(nland * .4,0)
					      mu5c = mu5c + 1
					      u5ac = u5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mu6 = mu6 + round(nland * .4,0)
					      mu6c = mu6c + 1
					    Case realprop.Digstrat = '9'
					      mu9 = mu9 + round(nland * .4,0)
					      mu9c = mu9c + 1
					      u9ac = u9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'H' 

						If inc_imp > 0
							mh1  = mh1 + round(inc_imp * .4,0)
							mh1c = mh1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mh1 = mh1 + round(nland * .4,0)
					      mh1c = mh1c + 1
					    Case realprop.Digstrat = '2'
					      mh2 = mh2 + round(nland * .4,0)
					      mh2c = mh2c + 1
					    Case realprop.Digstrat = '3'
					      mh3 = mh3 + round(nland * .4,0)
					      mh3c = mh3c + 1
					      h3ac = h3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mh4 = mh4 + round(nland * .4,0)
					      mh4c = mh4c + 1
					      h4ac = h4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mh5 = mh5 + round(nland * .4,0)
					      mh5c = mh5c + 1
					      h5ac = h5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mh6 = mh6 + round(nland * .4,0)
					      mh6c = mh6c + 1
					    Case realprop.Digstrat = '9'
					      mh9 = mh9 + round(nland * .4,0)
					      mh9c = mh9c + 1
					      h9ac = h9ac + realprop.totalAcres      
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase
***B
				  Case inc_cs = 'B' 

						If inc_imp > 0
							mb1  = mb1 + round(inc_imp * .4,0)
							mb1c = mb1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mb1 = mb1 + round(nland * .4,0)
					      mb1c = mb1c + 1
					    Case realprop.Digstrat = '3'
					      mb3 = mb3 + round(nland * .4,0)
					      mb3c = mb3c + 1
					      b3ac = b3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mb4 = mb4 + round(nland * .4,0)
					      mb4c = mb4c + 1
					      b4ac = b4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mb5 = mb5 + round(nland * .4,0)
					      mb5c = mb5c + 1
					      b5ac = b5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mb6 = mb6 + round(nland * .4,0)
					      mb6c = mb6c + 1
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

**J

				  Case inc_cs = 'J' 

						If inc_imp > 0
							ma1  = ma1 + round(inc_imp * .4,0)
							ma1c = ma1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mj1 = mj1 + round(nland * .4,0)
					      mj1c = mj1c + 1
					      mf1 = round(realprop.flbaseval * .4,0)
					      f1ac = realprop.totalacres
					      mf1c = mf1c + 1
					    Case realprop.Digstrat = '3'
					      mj3 = mj3 + round(nland * .4,0)
					      mj3c = mj3c + 1
					      j3ac = j3ac + realprop.TotalAcres
					      mf3 = round(realprop.flbaseval * .4,0)
					      f3ac = realprop.totalacres
					      mf3c = mf3c + 1
					    Case realprop.Digstrat = '4'
					      mj4 = mj4 + round(nland * .4,0)
					      mj4c = mj4c + 1
					      j4ac = j4ac +realprop.totalacres
					      mf4 = round(realprop.flbaseval * .4,0)
					      f4ac = realprop.totalacres
					      mf4c = mf4c + 1
					    Case realprop.Digstrat = '5'
					      mj5 = mj5 + round(nland * .4,0)
					      mj5c = mj5c + 1
					      j5ac = j5ac +realprop.totalacres
					      mf5 = round(realprop.flbaseval * .4,0)
					      f5ac = realprop.totalacres
					      mf5c = mf5c + 1
					    Case realprop.Digstrat = '6'
					      mj6 = mj6 + round(nland * .4,0)
					      mj6c = mj6c + 1
					      mf6 = round(realprop.flbaseval * .4,0)
					      f6ac = realprop.totalacres
					      mf6c = mf6c + 1
					    Case realprop.Digstrat = '9'
					      mj9 = mj9 + round(nland * .4,0)
					      mj9c = mj9c + 1
					      mf9 = round(realprop.flbaseval * .4,0)
					      f9ac = realprop.totalacres
					      mf9c = mf9c + 1
					    OtherWise
					      munk = munk + round(nland * .4,0)
					      munkc = munkc + 1
				    EndCase

		  	  Otherwise
		  	  
		  	  	sele realprop
		  	  	
				    munk = munk + IIF(OvRideVal > 0,OvRideVal,A_Value)
				    munkc = munkc + 1
			  	  munk = munk + IIF(OvRideVal = 0,P_Value,0)
			    	If OvRideVal = 0 .and. P_Value > 0
			      	munkc = munkc + 1
				    EndIf 
				    
				    sele inc_detail
				       
				EndCase
				
				
				If inc_imp > 0

					cons_value(realkey,realprop.parcel_no,0,0,0,0,left(inc_cs,1),'1',;
										round(inc_imp * .4,0),alias(),0,realprop.taxdistric)
										
				EndIf
				
				If nland > 0
				
					If realprop.digclass = 'E' and inc_cs <> 'E'
					
						Do Case
						
							Case realprop.totalacres < 5
							
								cons_value(realkey,realprop.parcel_no,0,0,0,0,left(inc_cs,1),'3',;
													round(nland * .4,0),alias(),realprop.totalacres,realprop.taxdistric)
													
							Case realprop.totalacres >= 5 and realprop.totalacres <= 25
							
								cons_value(realkey,realprop.parcel_no,0,0,0,0,left(inc_cs,1),'4',;
													round(nland * .4,0),alias(),realprop.totalacres,realprop.taxdistric)

							Case realprop.totalacres > 25
							
								cons_value(realkey,realprop.parcel_no,0,0,0,0,left(inc_cs,1),'5',;
													round(nland * .4,0),alias(),realprop.totalacres,realprop.taxdistric)
							
						EndCase

					Else

						cons_value(realkey,realprop.parcel_no,0,0,0,0,left(inc_cs,1),realprop.digstrat,;
											round(nland * .4,0),alias(),realprop.totalacres,realprop.taxdistric)

					EndIf
					
				EndIf						
				
			EndIf
			
		EndIf	
		
		sele realprop
		
	  pcnt = pcnt + 1
	  skip

	EndDo
	
	sele B
	Use Reprop shared
	set relation to RealKey into A
	ConsRep()

	sele H
	use tdtemp
	
	sele 14
	use acc_ctrl
	index on acctype + comp_no to x14
	
	sele C
	Use Acessory shared

	Do While .not. Eof() .and. Key <> 27
	
		@10,0 clear to 10,45
		
		@10,20 say 'Consolidating Acc Imp Values'
		@12,20 say recno()
		
	  Key = InKey()

		linc = .f.
	 
 	  sele realprop
	  seek acessory.realkey
	  
	  If income and !sale_val
	  	linc = .t.
	  EndIf
	  	
	  lfr = .f.
	  
	  If found()
	  	lfr = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
			sele acc_ctrl
			seek 'A' + acessory.comp_no
			
			If price_code = '3'
			
				ltd = .f.
				
			EndIf	
			
  
	  	sele acessory

	  	If linc
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	
	  
	  If !lfr
	  	sele acessory
	  	skip
	  	If eof()
	  		exit
	  	Else
	  		loop
	  	EndIf
	  Else
	  	sele acessory
	  EndIf
	  
	  If digclass < 'A' or digclass > 'W'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,digstrat,;
      					iif(realprop.sale_val,round((sb346val+sb346add)*.4,0),round(iif(ovr_val>0,ovr_val,imp_val)*.4,0)),;
      					alias(),0,;
      					realprop.taxdistric)
			
			munk = munk + 1	      					
      					
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  	
	  EndIf


	  If digstrat < '0' or digstrat > '9'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,digstrat,;
      					iif(realprop.sale_val,round((sb346val+sb346add)*.4,0),round(iif(ovr_val>0,ovr_val,imp_val)*.4,0)),;
      					alias(),0,;
      					realprop.taxdistric)
      					
			munk = munk + 1
				      					
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
		  
	  EndIf
	  				

	  If realprop.sale_val and realkey = realprop.realkey and realkey > 0 and acc_type = 'A'
			
			nval1 = ' '
			ncnt1 = ' '
			nacr1 = ' '
  		
			nval1 = 'm' + digclass + digstrat
			ncnt1 = 'm' + digclass + digstrat + 'c'
			
			&nval1 = &nval1 + round((sb346val + sb346add)*.4,0)
			&ncnt1 = &ncnt1 + 1
	  
      cons_value(realprop.realkey,realprop.parcel_no,0,acckey,0,0,acessory.digclass,acessory.digstrat,;
      					round((sb346val + sb346add)*.4,0),alias(),0,realprop.taxdistric)

			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf		
	  
	  EndIf			

	  
	  Do Case
	  	Case RealKey = 0
	  		skip
	  		If eof()
	  			exit
	  		EndIf	
		  Case DigClass = 'A' .and. RealKey = a->RealKey and acc_type = 'A'
		  	Do Case
			    Case DigStrat = '1'
			      ma1 = ma1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      ma1c = ma1c + 1

			    Case Digstrat = '2'
			      ma2 = ma2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      ma2c = ma2c + 1
			      
			    Case Digstrat = '3'
			      ma3 = ma3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      ma3c = ma3c + 1
			      
			    Case Digstrat = '4'
			      ma4 = ma4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      ma4c = ma4c + 1
			      
			    Case Digstrat = '5'
			      ma5 = ma5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      ma5c = ma5c + 1
			      
			    Case Digstrat = '6'
			      ma6 = ma6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      ma6c = ma6c + 1
			      
			    Case Digstrat = '9'
			      ma9 = ma9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      ma9c = ma9c + 1
			      
			    Otherwise
			      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
			      
			  EndCase  
	  Case DigClass = 'R' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mr1 = mr1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mr1c = mr1c + 1
		      
		    Case Digstrat = '2'
		      mr2 = mr2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mr2c = mr2c + 1
		      
		    Case Digstrat = '3'
		      mr3 = mr3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mr3c = mr3c + 1
		      
		    Case Digstrat = '4'
		      mr4 = mr4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mr4c = mr4c + 1
		      
		    Case Digstrat = '5'
		      mr5 = mr5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mr5c = mr5c + 1
		      
		    Case Digstrat = '6'
		      mr6 = mr6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mr6c = mr6c + 1
		      
		    Case Digstrat = '9'
		      mr9 = mr9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mr9c = mr9c + 1

		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		      
		  EndCase  
	  Case DigClass = 'C' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mc1 = mc1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mc1c = mc1c + 1
	      
*!*			      sele commcnt
*!*			      append blank
*!*			      replace realkey with acessory.realkey,;
*!*			      				acckey with acessory.acckey
*!*			      sele acessory				
		      				

		    Case Digstrat = '2'
		      mc2 = mc2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mc2c = mc2c + 1
		      
		    Case Digstrat = '3'
		      mc3 = mc3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mc3c = mc3c + 1
		      
		    Case Digstrat = '4'
		      mc4 = mc4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mc4c = mc4c + 1
		      
		    Case Digstrat = '5'
		      mc5 = mc5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mc5c = mc5c + 1
		      
		    Case Digstrat = '6'
		      mc6 = mc6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mc6c = mc6c + 1
		      
		    Case Digstrat = '9'
		      mc9 = mc9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mc9c = mc9c + 1
		      
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		      
		  EndCase  
	  Case DigClass = 'I' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mi1 = mi1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mi1c = mi1c + 1
		      
		    Case Digstrat = '2'
		      mi2 = mi2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mi2c = mi2c + 1
		      
		    Case Digstrat = '3'
		      mi3 = mi3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mi3c = mi3c + 1
		      
		    Case Digstrat = '4'
		      mi4 = mi4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mi4c = mi4c + 1
		      
		    Case Digstrat = '5'
		      mi5 = mi5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mi5c = mi5c + 1
		      
		    Case Digstrat = '6'
		      mi6 = mi6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mi6c = mi6c + 1
		      
		    Case Digstrat = '9'
		      mi9 = mi9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mi9c = mi9c + 1
		      
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		      
		  EndCase		      
	  Case DigClass = 'V' .and. RealKey = a->RealKey and acc_type = 'A'
	    Do Case
		    Case DigStrat = '1'
		      mv1 = mv1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mv1c = mv1c + 1
		    Case Digstrat = '2'
		      mv2 = mv2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mv2c = mv2c + 1
		    Case Digstrat = '3'
		      mv3 = mv3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mv3c = mv3c + 1
		    Case Digstrat = '4'
		      mv4 = mv4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mv4c = mv4c + 1
		    Case Digstrat = '5'
		      mv5 = mv5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mv5c = mv5c + 1
		    Case Digstrat = '6'
		      mv6 = mv6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mv6c = mv6c + 1
		    Case Digstrat = '9'
		      mv9 = mv9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mv9c = mv9c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		  EndCase		      
	  Case DigClass = 'W' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mw1 = mw1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mw1c = mw1c + 1
		    Case Digstrat = '2'
		      mw2 = mw2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mw2c = mw2c + 1
		    Case Digstrat = '3'
		      mw3 = mw3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mw3c = mw3c + 1
		    Case Digstrat = '4'
		      mw4 = mw4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mw4c = mw4c + 1
		    Case Digstrat = '5'
		      mw5 = mw5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mw5c = mw5c + 1
		    Case Digstrat = '6'
		      mw6 = mw6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mw6c = mw6c + 1
		    Case Digstrat = '9'
		      mw9 = mw9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mw9c = mw9c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		  EndCase		      
	  Case DigClass = 'T' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mt1 = mt1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mt1c = mt1c + 1
		    Case Digstrat = '2'
		      mt2 = mt2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mt2c = mt2c + 1
		    Case Digstrat = '3'
		      mt3 = mt3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mt3c = mt3c + 1
		    Case Digstrat = '4'
		      mt4 = mt4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mt4c = mt4c + 1
		    Case Digstrat = '5'
		      mt5 = mt5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mt5c = mt5c + 1
		    Case Digstrat = '6'
		      mt6 = mt6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mt6c = mt6c + 1
		    Case Digstrat = '9'
		      mt9 = mt9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mt9c = mt9c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		  EndCase		      
	  Case DigClass = 'P' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mp1 = mp1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mp1c = mp1c + 1
		    Case Digstrat = '2'
		      mp2 = mp2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mp2c = mp2c + 1
		    Case Digstrat = '3'
		      mp3 = mp3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mp3c = mp3c + 1
		    Case Digstrat = '4'
		      mp4 = mp4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mp4c = mp4c + 1
		    Case Digstrat = '5'
		      mp5 = mp5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mp5c = mp5c + 1
		    Case Digstrat = '6'
		      mp6 = mp6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mp6c = mp6c + 1
		    Case Digstrat = '9'
		      mp9 = mp9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mp9c = mp9c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		  EndCase    
	  Case DigClass = 'H' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mh1 = mh1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mh1c  = mh1c + 1
		    Case Digstrat = '2'
		      mh2 = mh2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mh2c  = mh2c + 1
		    Case Digstrat = '3'
		      mh3 = mh3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mh3c  = mh3c + 1
		    Case Digstrat = '4'
		      mh4 = mh4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mh4c  = mh4c + 1
		    Case Digstrat = '5'
		      mh5 = mh5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mh5c  = mh5c + 1
		    Case Digstrat = '6'
		      mh6 = mh6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mh6c  = mh6c + 1
		    Case Digstrat = '9'
		      mh9 = mh9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mh9c  = mh9c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc  = munkc + 1
		  EndCase
	  Case DigClass = 'E' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '0'
		      me0 = me0 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me0c = me0c + 1
		    Case DigStrat = '1'
		      me1 = me1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me1c = me1c + 1
		    Case Digstrat = '2'
		      me2 = me2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me2c = me2c + 1
		    Case Digstrat = '3'
		      me3 = me3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me3c = me3c + 1
		    Case Digstrat = '4'
		      me4 = me4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me4c = me4c + 1
		    Case Digstrat = '5'
		      me5 = me5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me5c = me5c + 1
		    Case Digstrat = '6'
		      me6 = me6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me6c = me6c + 1
		    Case Digstrat = '7'
		      me7 = me7 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me7c = me7c + 1
		    Case Digstrat = '8'
		      me8 = me8 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me8c = me8c + 1
		    Case Digstrat = '9'
		      me9 = me9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      me9c = me9c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		  EndCase
	  Case DigClass = 'U' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mu1 = mu1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mu1c = mu1c + 1
		    Case Digstrat = '2'
		      mu2 = mu2 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mu2c = mu2c + 1
		    Case Digstrat = '3'
		      mu3 = mu3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mu3c = mu3c + 1
		    Case Digstrat = '4'
		      mu4 = mu4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mu4c = mu4c + 1
		    Case Digstrat = '5'
		      mu5 = mu5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mu5c = mu5c + 1
		    Case Digstrat = '6'
		      mu6 = mu6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mu6c = mu6c + 1
		    Case Digstrat = '9'
		      mu9 = mu9 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mu9c = mu9c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		  EndCase
		  
**B

	  Case DigClass = 'B' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mb1 = mb1 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mb1c = mb1c + 1
		    Case Digstrat = '3'
		      mb3 = mb3 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mb3c = mb3c + 1
		    Case Digstrat = '4'
		      mb4 = mb4 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mb4c = mb4c + 1
		    Case Digstrat = '5'
		      mb5 = mb5 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mb5c = mb5c + 1
		    Case Digstrat = '6'
		      mb6 = mb6 + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      mb6c = mb6c + 1
		    OtherWise
		      munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		      munkc = munkc + 1
		  EndCase
		  
	  OtherWise
	  	If acc_type = 'A'
		    munk = munk + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		    munkc = munkc + 1
		  EndIf  
  EndCase
  
  	If acc_type = 'A'

      cons_value(realprop.realkey,realprop.parcel_no,0,acckey,0,0,acessory.digclass,acessory.digstrat,;
      					iif(Ovr_Val > 0,round(Ovr_Val*.4,0),round(Imp_Val*.4,0)),alias(),0,realprop.taxdistric)
  	
  	EndIf
	  skip

	EndDo
	
	AddComm()	
	
****starting homestead exemption stuff
	sele H
	use tdtemp

	sele f
	use conmai
	set order to realkey
	
	sele 14
	use flpamain
	set order to realkey
	
	sele A
	go top
  clear
  ntift = 0
  

  sele A
  copy struc to sacount
  
  sele 35
  use sacount
  
  sele a
  go top
  clear
  @ 8, 0 say padc('Summing Pref Land',80)

  Do While !Eof()

		ltd = .f.
		
		sele tdtemp
		
		loca for taxdistric = realprop.taxdistric
		  
		If found()
			ltd = .t.  
		EndIf
		
		sele realprop
			
	  If !ltd 
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  EndIf

	 
		If val(realprop.pcy) > 0
			If defaults.digyr - val(pcy) >= 10
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
			
			EndIf
		EndIf	
	 

	  If OvrideVal = 0 .and. P_Value > 0 and digclass = 'P'
	  	Pref1 = Pref1 + iif(sale_val, round(saleland2*.4,0), round(P_Value*.4,0))
	  	Pref1Ct = Pref1Ct + 1
	  	
	  	sele sacount
	  	appen blank
	  	
	  	repl realkey with realprop.realkey
	  	
      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','A',;
      					0,alias(),0,realprop.taxdistric)
	  	
	  	
	  	sele realprop
	  	
	  EndIf	
	  If OvrideVal > 0 .and. DigClass = 'P'
			Pref2 = Pref2 + iif(sale_val, round(saleland2*.4,0), round(OvrideVal*.4,0))
	  	Pref2Ct = Pref2Ct + 1
	  	
	  	sele sacount
	  	appen blank
	  	
	  	repl realkey with realprop.realkey

      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','A',;
      					0,alias(),0,realprop.taxdistric)
	  	
	  	sele realprop
	  	
	  EndIf	
	  
		skip
	EndDo	
	

	sele A

	sele C

	go top
	clear
	@ 8, 0 say padc('Summing Pref Accessories',80)
	Do While !eof()

		If realkey = 0
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf
		
		

		sele realprop
		seek acessory.realkey
		
		

		If !found()
			sele acessory
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf

		lfr = .f.
		
	  If found()
	  	lft = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele acessory
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	

		sele realprop		
		
		If lfr
			If val(realprop.ccy) > 0
				If defaults.digyr - val(pcy) >= 10
					sele acessory
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
			Else
				sele acessory
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf	
		EndIf			

		sele acessory


		If DigClass = 'P' and !realprop.sale_val
			AcPref = AcPref + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		EndIf

		If DigClass = 'P' and realprop.sale_val
			AcPref = AcPref + round((sb346val + sb346add)*.4,0)
		EndIf


		skip	

	EndDo




	sele A
	go top
	clear
	@ 8, 0 say padc('Summing CU Land',80)
	Do While !eof()

		ltd = .f.
		
		sele tdtemp
		
		loca for taxdistric = realprop.taxdistric
		  
		If found()
			ltd = .t.  
		EndIf
		
		sele realprop
			
	  If !ltd 
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  EndIf
	 
		If val(realprop.ccy) > 0
			If defaults.digyr - val(ccy) >= 10
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
			
			EndIf
		EndIf	
	 
		If sale_val .and. digclass='V' and defaults.digyr - val(realprop.ccy) < 10
		
			CuFmv1 = CuFmv1 + round(saleland1*.4,0)

			cons_value(realkey,realprop.parcel_no,0,0,0,0,'V','L',;
								round(saleland1*.4,0),alias(),0,realprop.taxdistric)
			
		EndIf	


		If OvrideVal = 0 .and. digclass='V' and defaults.digyr - val(realprop.ccy) < 10 and !sale_val
			CuFmv1 = CuFmv1 + (round((A_Value + P_Value)*.4,0))

			cons_value(realkey,realprop.parcel_no,0,0,0,0,'V','L',;
								round((A_Value + P_Value)*.4,0),alias(),0,realprop.taxdistric)
								
			
		EndIf	
		
		If OvrideVal > 0 .and. digclass='V' and defaults.digyr - val(realprop.ccy) < 10 and !sale_val 	
			CuFmv2 = CuFmv2 + round((ovrideval)*.4,0)

			cons_value(realkey,realprop.parcel_no,0,0,0,0,'V','L',;
								round(ovrideval*.4,0),alias(),0,realprop.taxdistric)
								
						
		EndIf

		If sale_val .and. digclass='W' and defaults.digyr - val(realprop.ccy) < 10
		
			SwFmv1 = SwFmv1 + round(saleland1*.4,0)

      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','W',;
      					0,alias(),0,realprop.taxdistric)
			
		EndIf	

		
		If OvrideVal = 0 .and. digclass='W' and defaults.digyr - val(realprop.ccy) < 10 and !sale_val 
			SwFmv1 = SwFmv1 + (round((A_Value + P_Value)*.4,0))

      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','W',;
      					0,alias(),0,realprop.taxdistric)
			
		EndIf	
		
		If OvrideVal > 0 .and. digclass='W' and defaults.digyr - val(realprop.ccy) < 10 and !sale_val 
			SwFmv2 = SwFmv2 + round((ovrideval)*.4,0)
			
      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','W',;
      					0,alias(),0,realprop.taxdistric)
						
		EndIf
		
		skip	
	EndDo
		
	  
	sele A

	sele C

	go top
	clear
	@ 8, 0 say padc('Summing CU Accessories',80)

	Do While !eof()

		sele realprop
		seek acessory.realkey

		If !found()
			sele acessory
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf

		lfr = .f.
		
	  If found()
	  	lfr = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele acessory
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	
		
			
		If lfr
			If val(realprop.ccy) > 0
				If defaults.digyr - val(realprop.ccy) >= 10
					sele acessory
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
			Else
				sele acessory
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf	
		EndIf			



		sele acessory

	  If DigClass = 'V' and defaults.digyr - val(realprop.ccy) < 10 and !realprop.sale_val 
			CuAcc = CuAcc + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
			
			cons_value(realkey,realprop.parcel_no,0,0,0,0,'V','A',;
								 iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0)),alias(),0,realprop.taxdistric)
			
		EndIf
		
	  If DigClass = 'V' and defaults.digyr - val(realprop.ccy) < 10 and realprop.sale_val 
			CuAcc = CuAcc + round((sb346val+sb346add)*.4,0)
			
			cons_value(realkey,realprop.parcel_no,0,0,0,0,'V','A',;
								 round((sb346val + sb346add)*.4,0),alias(),0,realprop.taxdistric)
			
		EndIf


	  If DigClass = 'W'  and defaults.digyr - val(realprop.ccy) < 10 and !realprop.sale_val  
			SwAcc = SwAcc + iif(Ovr_Val=0,round(Imp_Val*.4,0),round(Ovr_Val*.4,0))
		EndIf
		
	  If DigClass = 'W'  and defaults.digyr - val(realprop.ccy) < 10 and realprop.sale_val  
			SwAcc = SwAcc + round((sb346val + sb346add)*.4,0)
		EndIf


		skip	
	EndDo
	
	sele F
  use conmai shared
  copy struc to svcount
  
  sele acessory && C
  set order to realkey
  
  sele 33
  use svcount
  
  sele f

  go top
  clear
  @ 8, 0 say padc('Summing CU Totals',80)
  Do While !eof()

		sele realprop
		seek conmai.realkey

		If !found()
			sele conmai
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf
		
		lfr = .f.
		
	  If found()
	  	lft = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele conmai
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	

		If lfr
			If val(realprop.ccy) > 0
				If defaults.digyr - val(ccy) >= 10
					sele conmai
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
			Else
				sele conmai
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf	
		EndIf			

		sele conmai
		n     = 9
		nvacc = 0
		nvlnd = 0
		
		Do While n > -1
			m = str(n,1,0)
			If dat&m = defaults.digyr
			
				If val&m > 0
				
					If realprop.digclass <> 'W'
				  	CuTot = CuTot + round(Val&m*.4,0)
		  			CuCnt = CuCnt + 1

						sele realprop
						seek conmai.realkey

						If !sale_val
							nvlnd = iif(ovrideval > 0, round(ovrideval * .4,0), round((a_value + p_value) * .4,0))
						Else
							nvlnd = round((saleland1 + saleland2) * .4,0)						
						EndIf
											
						sele acessory
						seek conmai.realkey
						
						Do While realkey = conmai.realkey
						
							If digclass = 'V'
								
								If !realprop.sale_val
									nvacc = nvacc + iif(ovr_val > 0, round(ovr_val * .4,0), round(imp_val * .4,0))
								Else
									nvacc = nvacc + round((sb346val + sb346add) * .4,0)								
								EndIf	
								
							EndIf
							
							skip
								
						EndDo
						
						sele conmai
						cons_value(realkey,realprop.parcel_no,0,0,0,0,'S','V',;
											(nvlnd+nvacc) - round(val&m * .4,0),alias(),0,realprop.taxdistric)

		  			sele svcount
		  			appen blank
		  			
		  			replace realkey with conmai.realkey,;
		  							conmaikey with conmai.conmaikey,;
		  							origconval with round(conmai.val&m * .4,0),;
		  							val0 with nvlnd,;
		  							val1 with nvacc
		  			
		  			sele conmai
		  			
		  		Else
		  			SwTot = SwTot + round(val&m*.4,0)
		  			SwCnt = SwCnt + 1
		  		EndIf
		  				
	  		EndIf
	  			
  			exit
  		EndIf	
  		n = n - 1
  	EndDo	
  	skip
  EndDo


**summing flpa exemption
	If file('flpamain.dbf')
		sele 14
		use flpamain shar
		set order to realkey	

		sele A
		go top
		clear
		@ 8, 0 say padc('Summing FLPA Land',80)
		Do While !eof()

			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
		
			sele realprop
				
		  If !ltd 
		  	skip
		  	If !eof()
		  		loop
		  	Else
		  		exit
		  	EndIf
		  EndIf
		  
			If val(realprop.flcy) > 0
			
				If defaults.digyr - val(flcy) >= 15
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
				
			EndIf	

			sele flpamain
			seek realprop.realkey
			
			sele realprop
			
			If flpamain.currcovval < iif(ovrideval > 0, ovrideval, a_value) and !sale_val
			
				If OvrideVal = 0 .and. digclass='J' and defaults.digyr - val(realprop.flcy) < 15 
				
					SjFmv1 = SjFmv1 + (round((A_Value + P_Value)*.4,0))
					
				EndIf	
				
				If OvrideVal > 0 .and. digclass='J' and defaults.digyr - val(realprop.flcy) < 15
				 	
					SjFmv2 = SjFmv2 + round((ovrideval)*.4,0)
								
				EndIf
				
			EndIf	
			
			If flpamain.currcovval < saleland1 and sale_val
			
				If saleland1 > 0 .and. digclass='J' and defaults.digyr - val(realprop.flcy) < 15 
				
					SjFmv1 = SjFmv1 + (round(saleland1*.4,0))
					
				EndIf	
				
			EndIf	


			skip	
			
		EndDo
		
	**here

		sele 14
	  use flpamain shared
	  copy struc to sjcount
	  
	  sele 33
	  use sjcount
	  
	  sele 14

	  go top
	  clear
	  @ 8, 0 say padc('Summing FLPA Totals',80)
	  Do While !eof()

			sele realprop
			seek flpamain.realkey

			If !found()
				sele flpamain
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
			EndIf
			
			lfr = .f.
			
		  If found()
		  	lft = .t.
				ltd = .f.
				
				sele tdtemp
				
				loca for taxdistric = realprop.taxdistric
				  
				If found()
					ltd = .t.  
				EndIf
				
	  
		  	sele flpamain
		  	
		  	If !ltd
			  	skip
			  	If !eof()
		  			loop
		  		Else
		  			exit
			  	EndIf		
			  EndIf	
		  EndIf	

			If lfr
				If val(realprop.flcy) > 0
					If defaults.digyr - val(flcy) >= 15
						sele flpamain
						skip
						If !eof()
							loop
						Else
							exit
						EndIf
					
					EndIf
				Else
					sele flpamain
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
					
				EndIf	
			EndIf			

			sele flpamain
			n = 15
			
			Do While n > 0
			
				m = alltrim(str(n,2,0))
				
				If dat&m = defaults.digyr
				
					If val&m > 0
					
						If realprop.digclass = 'J' and !realprop.sale_val
						
							If val&m < iif(realprop.ovrideval > 0, realprop.ovrideval, realprop.a_value)
							
						  	SjTot = SjTot + round(Val&m*.4,0)
						  	
						  EndIf
						  	
			  			SjCnt = SjCnt + 1
			  			
			  			sele sjcount
			  			appen blank
			  			
			  			replace realkey with flpamain.realkey
			  			
				      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','J',;
				      					0,alias(),0,realprop.taxdistric)
			  			
			  			
			  			sele flpamain
			  			
			  		EndIf	

						If realprop.digclass = 'J' and realprop.sale_val
						
							If val&m < realprop.saleland1
							
						  	SjTot = SjTot + round(Val&m*.4,0)
						  	
						  EndIf
						  	
			  			SjCnt = SjCnt + 1
			  			
			  			sele sjcount
			  			appen blank
			  			
			  			replace realkey with flpamain.realkey
			  			
				      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','J',;
				      					0,alias(),0,realprop.taxdistric)
			  			
			  			
			  			sele flpamain
			  			
			  		EndIf	


		  		EndIf
		  			
	  			exit
	  		EndIf	
	  		n = n - 1
	  	EndDo	
	  	skip
	  EndDo
	
	EndIf
	  
	close databases
	
***begin personal property


	sele g
	use defaults
	
	sele h
	use tdtemp
	
	sele b
	use cons_value
	
	sele c
	use taxdist
	
	sele d
	use invn
	index on perskey to xd

	sele a
	use personal	
	index on ownkey to ok	
	
  go top
  All = 1 
  clear


	clear
	
	yn = lower(c75)
	
*!*		@10,20 say 'Include Accounts less than FMV 7501? (Y/N)' get yn ;
*!*		valid(lower(yn) = 'y' or lower(yn) = 'n')
*!*		
*!*		read
	  
  Messx = 'Personal Property'
  HMany = 0
  Do While .not. Eof()

    If All = 1
    	
    	ok = ownkey
    	cv = 0

    	
    	Do While ownkey = ok and !eof()
    		cv = cv + curr_val
    		skip
    	EndDo

			If lower(yn) = 'n'
	    	If cv > 7500
		    	seek ok
		    Else
		    	If !eof()
		    		loop
		    	Else
		    		exit
		    	EndIf
		    EndIf
		  Else
		  	seek ok  				
		  EndIf  

    	
*    	seek ok
   	
			Do While ownkey = ok and !eof()

			
				ltd   = .f.
				lfp   = .f.
				nfpct = 0
				
				sele tdtemp
				
				loca for taxdistric = personal.taxdistric
				  
				If found()
					ltd = .t.
					
					sele taxdist
					locate for taxdistric = tdtemp.taxdistric
					
					If found() 
					
						If co_fp_rm + co_fp_fg + co_fp_os > 0
						
							lfp = .t.
							
							Do Case
								
								Case co_fp_rm > 0
									nfpct = co_fp_rm
								Case co_fp_fg > 0
									nfpct = co_fp_fg
								Case co_fp_os > 0
									nfpct = co_fp_os
											
							EndCase
							
						EndIf
							
					EndIf
					  
				EndIf
				
				sele personal
					
			  If !ltd 
			  	skip
			  	If !eof()
			  		loop
			  	Else
			  		exit
			  	EndIf
			  EndIf
			
	    	Do Case	
		      Case propclass = 'R'
		        RBTOT=RBTOT+round(BOAT_VAL*.4,0)
		        IF BOAT_VAL>0
		          RBNUM=RBNUM+1
		        ENDIF
		        RATOT=RATOT+round(PLANE_VAL*.4,0)
		        IF PLANE_VAL>0
		          RANUM=RANUM+1
		        ENDIF
		        IF lfp 

		          RITOT=RITOT+;
		          round((INVN_VAL-((ROUND(FRPORT_VAL/nfpct,0))-FRPORT_VAL))*.4,0)
		          
		          IF INVN_VAL-((FRPORT_VAL/nfpct)-FRPORT_VAL)>0
		            
		            RINUM=RINUM+1
		            
		            
		          ENDIF
		          
	          
		        ELSE
		        
		          RITOT=RITOT+round(INVN_VAL*.4,0)
		          
		          
		          IF INVN_VAL>0
		            RINUM=RINUM+1
		            
		            
		          ENDIF
		          
		        ENDIF
		        
		        IF lfp
		          RPTOT=RPTOT+round(ROUND(FRPORT_VAL/nfpct,0)*.4,0)
		          IF FRPORT_VAL>0
		            RPNUM=RPNUM+1
		          ENDIF  
		        ENDIF
		        RZTOT=RZTOT+round(OTHER_VAL*.4,0)
		        IF OTHER_VAL>0
		          RZNUM=RZNUM+1
		        ENDIF  
		        RFTOT=RFTOT+round(MEFF_VAL*.4,0)
		        IF MEFF_VAL>0
		          RFNUM=RFNUM+1
		        ENDIF
		        RCURR=RCURR+round(curr_val*.4,0)
		        RCurrNum=RCurrNum+1
		      Case propclass = 'A'
		        ABTOT=ABTOT+round(BOAT_VAL*.4,0)
		        IF BOAT_VAL>0
		          ABNUM=ABNUM+1
		        ENDIF
		        AATOT=AATOT+round(PLANE_VAL*.4,0)
		        IF PLANE_VAL>0
		          AANUM=AANUM+1
		        ENDIF
		        IF lfp
		          AITOT=AITOT+;
		          round((INVN_VAL-((ROUND(FRPORT_VAL/nfpct,0))-FRPORT_VAL))*.4,0)
		          IF INVN_VAL-((FRPORT_VAL/nfpct)-FRPORT_VAL)>0
		            AINUM=AINUM+1
		          ENDIF
		        ELSE
		          AITOT=AITOT+round(INVN_VAL*.4,0)
		          IF INVN_VAL>0
		            AINUM=AINUM+1
		          ENDIF
		        ENDIF
		        IF lfp
		          APTOT=APTOT+round(ROUND(FRPORT_VAL/nfpct,0)*.4,0)
		          IF FRPORT_VAL>0
		            APNUM=APNUM+1
		          ENDIF  
		        ENDIF
		        AZTOT=AZTOT+round(OTHER_VAL*.4,0)
		        IF OTHER_VAL>0
		          AZNUM=AZNUM+1
		        ENDIF  
		        AFTOT=AFTOT+round(MEFF_VAL*.4,0)
		        IF MEFF_VAL>0
		          AFNUM=AFNUM+1
		        ENDIF
		        ACURR=ACURR+round(curr_val*.4,0)
		        ACurrNum=ACurrNum+1
		        
		      Case propclass = 'C'
		      
		        CBTOT=CBTOT+round(BOAT_VAL*.4,0)
		        IF BOAT_VAL>0
		          CBNUM=CBNUM+1
		        ENDIF
		        CATOT=CATOT+round(PLANE_VAL*.4,0)
		        IF PLANE_VAL>0
		          CANUM=CANUM+1
		        ENDIF
		        
		        IF lfp
		        
		        	sele invn
		        	seek personal.perskey
		        	
		          CITOT=CITOT+ round((invn.total_invn - invn.total_grs) * .4,0)
		          
							If invn.total_invn - invn.total_grs > 0

			          sele cons_value
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round((invn.total_invn - invn.total_grs) * .4,0),; 
			          				digclass with personal.propclass,;
			          				digstrat with 'I'

			          sele personal  &&round((personal.mavinvn-((ROUND(personal.mavfrport/nfpct,0))-personal.mavfrport))*.4,0)
		          
		            CINUM=CINUM+1
							
							EndIf
							
		        ELSE
		        
		          IF invn_val > 0
		          
		          	citot = citot + round(personal.invn_val * .4,0)
		          	
			          sele cons_value 
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round(personal.invn_val*.4,0),;
			          				digclass with personal.propclass,;
			          				digstrat with 'I'
			          				
			          sele personal

		          
		            CINUM=CINUM+1
		          ENDIF
		          
		        ENDIF
		        
		        IF lfp
		        
		        	sele invn
		        	seek personal.perskey
		        	
		        	sele personal
		        	
		          CPTOT=CPTOT+ round(invn.total_grs * .4,0) &&round(ROUND(mavfrport/nfpct,0)*.4,0)
		          
		          IF invn.total_grs>0
		          
			          sele cons_value
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round(invn.total_grs*.4,0),;  
			          				digclass with personal.propclass,;
			          				digstrat with 'P'

			          				
			          sele personal
		          
		            CPNUM=CPNUM+1
		          EndIf
		            
		        ENDIF
		        
		        CZTOT=CZTOT+round(OTHER_VAL*.4,0)
		        IF OTHER_VAL>0
		          CZNUM=CZNUM+1
		        ENDIF  
		        CFTOT=CFTOT+round(MEFF_VAL*.4,0)
	        
		        IF MEFF_VAL>0
		          CFNUM=CFNUM+1
		        ENDIF
		        CCURR=CCURR+round(curr_val*.4,0)
		        CCurrNum=CCurrNum+1
		        
		      Case propclass = 'I'
		      
		        IBTOT=IBTOT+round(BOAT_VAL*.4,0)
		        IF BOAT_VAL>0
		          IBNUM=IBNUM+1
		        ENDIF
		        IATOT=IATOT+round(PLANE_VAL*.4,0)
		        IF PLANE_VAL>0
		          IANUM=IANUM+1
		        ENDIF
		        
		        IF lfp

		        	sele invn
		        	seek personal.perskey
		        	
		        	sele personal
		        	
		          IITOT=IITOT+round((invn.total_invn - invn.total_grs) * .4,0) &&round((mavinvn-((ROUND(personal.mavfrport/nfpct,0))-personal.mavfrport))*.4,0)
		          
		          
		          IF invn.total_invn - invn.total_grs > 0
		          
			          sele cons_value
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round((invn.total_invn - invn.total_grs) * .4,0),; 
			          				digclass with personal.propclass,;
			          				digstrat with 'I'

			          sele personal  &&round((personal.mavinvn-((ROUND(personal.mavfrport/nfpct,0))-personal.mavfrport))*.4,0)
		          
		            IINUM=IINUM+1
		          ENDIF
		          
		        ELSE
		          IITOT=IITOT+round(INVN_VAL*.4,0)
		          
*!*								cons_value(0,'Value-no FP',perskey,0,0,0,propclass,'I',;
*!*													round(INVN_VAL*.4,0),;
*!*													alias(),0,taxdistric)
														          
		          IF INVN_VAL>0
		            IINUM=IINUM+1
								cons_value(0,' ',perskey,0,0,0,propclass,'I',;
													0,alias(),0,taxdistric)		            
		          ENDIF
		          
		        ENDIF
		        
		        IF lfp
		        	sele invn
		        	seek personal.perskey
		        	
		        	sele personal
		        	
		          IPTOT=IPTOT+round(invn.total_grs*.4,0) &&round(ROUND(mavfrport/nfpct,0)*.4,0)
		          
		          IF invn.total_grs>0

			          sele cons_value
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round(invn.total_grs*.4,0),;  
			          				digclass with personal.propclass,;
			          				digstrat with 'P'
	          				
			          sele personal  &&round(ROUND(personal.mavfrport/nfpct,0)*.4,0)
		          
		            IPNUM=IPNUM+1
		          ENDIF
		            
		        ENDIF
		        
		        
		        IZTOT=IZTOT+round(OTHER_VAL*.4,0)
		        IF OTHER_VAL>0
		          IZNUM=IZNUM+1
		        ENDIF  
		        IFTOT=IFTOT+round(MEFF_VAL*.4,0)
		        IF MEFF_VAL>0
		          IFNUM=IFNUM+1
		        ENDIF
		        ICURR=ICURR+round(curr_val*.4,0)
		        ICurrNum=ICurrNum+1
		      Case propclass = 'U'
		        UBTOT=UBTOT+round(BOAT_VAL*.4,0)
		        IF BOAT_VAL>0
		          UBNUM=UBNUM+1
		        ENDIF
		        UATOT=UATOT+round(PLANE_VAL*.4,0)
		        IF PLANE_VAL>0
		          UANUM=UANUM+1
		        ENDIF
		        IF lfp
		          UITOT=UITOT+;
		          round((INVN_VAL-((ROUND(FRPORT_VAL/nfpct,0))-FRPORT_VAL))*.4,0)
		          IF INVN_VAL-((FRPORT_VAL/nfpct)-FRPORT_VAL)>0
		            UINUM=UINUM+1
		          ENDIF
		        ELSE
		          UITOT=UITOT+round(INVN_VAL*.4,0)
		          IF INVN_VAL>0
		            UINUM=UINUM+1
		          ENDIF
		        ENDIF
		        IF lfp
		          UPTOT=UPTOT+round(ROUND(FRPORT_VAL/nfpct,0)*.4,0)
		          IF FRPORT_VAL>0
		            UPNUM=UPNUM+1
		          ENDIF  
		        ENDIF
		        UZTOT=UZTOT+round(OTHER_VAL*.4,0)
		        IF OTHER_VAL>0
		          UZNUM=UZNUM+1
		        ENDIF  
		        mu2=mu2+round(MEFF_VAL*.4,0)
		        IF MEFF_VAL>0
		          mU2c=mU2c+1
		        ENDIF
		        UCURR=UCURR+round(curr_val*.4,0)
		        UCurrNum=UCurrNum+1
*!*			      Case propclass = 'E' .and. strata = '0'
*!*		  	      If Curr_Val > 0
*!*		    	      E0TOT = E0TOT + round(Curr_Val*.4,0)
*!*		      	    E0NUM = E0NUM + 1
*!*		        	EndIf
	      EndCase

				If propclass <> 'E'

		      FREETOT=FREETOT+round(FRPORT_VAL*.4,0)
		      
		      IF FRPORT_VAL>0
		        FREENUM=FREENUM+1
	        
						cons_value(0,'FrPrt Exmpt',perskey,0,0,0,'S','F',;
											0,alias(),0,taxdistric)
						        
	     		 ENDIF

				EndIf
					      
	      If propclass <> 'E'
	        CURRTOT=CURRTOT+round(curr_val*.4,0)

	        CURRNUM=CURRNUM+1
	      EndIf

	      IF cv < 7501 .and. propclass <> 'E' and curr_val > 0
		      SPNUM=SPNUM+1
	  	    SPTOT=SPTOT+round(CURR_VAL*.4,0)

  	    
					cons_value(0,'SP Exmpt',perskey,0,0,0,'S','P',;
										0,alias(),0,taxdistric)
	  	    
	    	ENDIF

	      IF PropClass + Strata = 'E1'
	        E1TOT = E1TOT + round(Curr_Val*.4,0)
	        E1NUM = E1NUM + 1
	      ENDIF


	      IF PropClass + Strata = 'E2'
	        E2TOT = E2TOT + round(Curr_Val*.4,0)
	        E2NUM = E2NUM + 1
	      ENDIF

	      IF PropClass + Strata = 'E3'
	        E3TOT = E3TOT + round(Curr_Val*.4,0)
	        E3NUM = E3NUM + 1
	      ENDIF

	      IF PropClass + Strata = 'E4'
	        E4TOT = E4TOT + round(Curr_Val*.4,0)
	        E4NUM = E4NUM + 1
	      ENDIF
	 
	      IF PropClass + Strata = 'E5'
	        E5TOT = E5TOT + round(Curr_Val*.4,0)
	        E5NUM = E5NUM + 1
	      ENDIF
	  
	      IF PropClass + Strata = 'E6'
	        E6TOT = E6TOT + round(Curr_Val*.4,0)
	        E6NUM = E6NUM + 1  
	      ENDIF

	      IF PropClass + Strata = 'E7'
	        E7TOT = E7TOT + round(Curr_Val*.4,0)
	        E7NUM = E7NUM + 1  
	      ENDIF

	      IF PropClass + Strata = 'E8' 
	        E8TOT = E8TOT + round(Curr_Val*.4,0)
	        E8NUM = E8NUM + 1
	      ENDIF

	      IF PropClass + Strata = 'E9' 
	        E9TOT = E9TOT + round(Curr_Val*.4,0)
	        E9NUM = E9NUM + 1  
	      ENDIF

	      IF PropClass + Strata = 'E0' 
	        E0TOT = E0TOT + round(Curr_Val*.4,0)
	        E0NUM = E0NUM + 1  
	      ENDIF
	      
	      If hde_exempt > 0
	      
	      	sy      = sy + round(hde_exempt * .4,0)
	      	sycount = sycount + 1 
	      	
	      EndIf	        


	      sele personal        

				If meff_val > 0 and propclass <> 'E'

          sele cons_value
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.meff_val*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'F'

          sele personal
	          
				EndIf
				
				If boat_val > 0 and propclass <> 'E'

          sele cons_value
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.boat_val*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'B'

          sele personal
	          
				EndIf
					          
				If plane_val > 0 and propclass <> 'E'

          sele cons_value
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.plane_val*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'A'

          sele personal
	          
				EndIf

				If other_val > 0 and propclass <> 'E'

          sele cons_value
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.other_val*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'Z'

          sele personal
	          
				EndIf
				
				If propclass = 'E'

          sele cons_value
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.curr_val*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with personal.strata

          sele personal
				
		
				EndIf
     
	      skip
      
      EndDo

    Else

    EndIf
  
    If eof()
    	exit
    EndIf	
    HMany = HMany + 1
    
    

  EndDo

	close databases
	clear
	

	sele a
	use tdtemp
	
	sele b
	use taxdist
	
	sele tdtemp
	
	Do while !eof()
	
		sele taxdist
		locate for taxdistric = left(tdtemp.taxdistric,2)
		
		If found()

			mv  = mv + motorveh
			mvc = mvc + mvcount  &&tdcons.mvcount
			mh  = mh + mobilehome
			mhc = mhc + mhcount  &&tdcons.mhcount
			ti  = ti + timber100
			tic = tic + ticount  &&tdcons.timcount
			hd  = hd + heavyequip
			hdc = hdc + hecount  &&tdcons.hecount
			tdd = descrip
		
		EndIf
		
		sele tdtemp
		skip
		
	EndDo
	
	close databases
	
	Summit()
	
	use defaults
	
	If mavexmpt
		Exemptions()
	EndIf	
*****start printing here
	PrntCr()
*-----------------------------------------------------------------------------
FUNCTION PrntCr

	local dt,ad
	
	covcnt = .f.

	sele a
	use calcexemptions alias ce
	copy struc to sv
	copy struc to sj
	copy struc to sa
	copy struc to sw
	
	set order to realkey
	
	go top
	
	sele b
	use sv
	
	sele c
	use sj
	
	sele d
	use sa
	
	sele e
	use sw
	
	sele ce
	
	Do While !eof()
	
		If realkey = 0
		
			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf
			
		EndIf
		
		If (excode <> 'SV' and excode <> 'SJ' and excode <> 'SA') or act_exempt = 0
		
			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf
			
		EndIf
		
		If excode = 'SV'

			nreal = realkey
					
			sele sv
			append blank
			
			replace realkey with ce.realkey
			
			sele ce
			
			Do while !eof() and realkey = nreal
			
				skip
				
			EndDo	
			
		EndIf
		
		If excode = 'SJ'
		
			nreal = realkey

			sele sj
			append blank
			
			replace realkey with ce.realkey

			sele ce
	
			Do while .t.

				skip

				If eof() or realkey <> nreal
					exit
				EndIf				
			EndDo	
			
		EndIf
		
		If excode = 'SA'
		
			nreal = realkey
			
			sele sa
			append blank
			
			replace realkey with ce.realkey

			sele ce
			
			Do while !eof() and realkey = nreal
			
				skip
				
			EndDo	
			
		EndIf
		
		If excode = 'SW'
		
			nreal = realkey

			sele sw
			append blank
			
			replace realkey with ce.realkey

			sele ce
	
			Do while .t.

				skip

				If eof() or realkey <> nreal
					exit
				EndIf				
			EndDo	
			
		EndIf
		
		
		If eof()
			exit
		EndIf		
						
	EndDo

	
	sele sv
	nsv = reccount()
	
	sele sj
	nsj = reccount()
	
	sele sa
	nsa = reccount()
	
	sele sw
	nsw = reccount()
	
	sele ce

	clear
	ln = 4
	
	close datab

	
	If munk > 0
	
		use cons_value
		copy to invalid_codes xls for right(alltrim(parcel_no),3) = '-IC'
			
		@ln,10 say 'Invalid Digest Codes were Found'
		ln = ln + 1
		@ln,10 say 'Invalid_Codes.xls in this folder contains Parcels.'
		
		ln = ln + 2
		
	EndIf
	
	close datab
		
	If nsv <> mv3c + mv4c + mv5c
	
		nneg = 0
		
		sele a
		use conmai
		
		sele b
		use sv
		
		sele conmai
		
		Do while !eof()
		
			If curr_ex < 0
			
				nneg = nneg + 1
				
				sele sv
				append blank
				
				replace realkey with conmai.realkey,;
								act_exempt with conmai.curr_ex
								
				sele conmai
				
			EndIf
			
			skip					
				
		EndDo
		
		close datab
	
	
		@ln,10 say 'WARNING!!!'  
		ln = ln + 1
		@ln,10 say 'V digest class count does not equal SV count'
		ln = ln + 1
		@ln,10 say 'V Count = ' + alltrim(str(mv3c + mv4c + mv5c,4,0)) + '  SV Count = ' + alltrim(str(nsv,4,0))
		
		If nneg > 0
			ln = ln + 1
			@ln,10 say alltrim(str(nneg,6,0)) + ' negative SV exemptions were found & are in sv_issues.xls' 
		EndIf
		
		covcnt = .t.

		If nsv < mv3c + mv4c + mv5c
		
		
			sele a
			use sv
			index on realkey to sv
			
			sele b
			use realprop
			set rela to realkey into a
			index on parcel_no to xb
			
			copy fields parcel_no,realkey,ccy,a.act_exempt to sv_issues xls for (realkey <> a.realkey and digclass = 'V') or;
									(realkey = a.realkey and a.act_exempt < 0)

			ln = ln + 1
			@ln,10 say 'sv_issues.xls located in this folder contains a list of these parcels.'
			
		EndIf
		
		If nsv > mv3c + mv4c + mv5c
		
			sele a
			use realprop
			index on realkey to sj
			
			sele b
			use sv
			set rela to realkey into a
			index on a.parcel_no to xb
			
			copy fields a.parcel_no,realkey,a.ccy to sv_issues xls for realkey <> a.realkey 
			
			ln = ln + 1
			@ln,10 say 'sv_issues.xls located in this folder contains a list of these parcels.'
			ln = ln + 1
			@ln,10 say 'More SV exemptions than parcels with V digest class.'
			
		EndIf
		
		
		ln = ln + 2
		
	EndIf	
	
	close datab
		
	If nsa <> mp3c + mp4c + mp5c
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'P digest class count does not equal SA count'
		ln = ln + 1
		@ln,10 say 'P Count = ' + alltrim(str(mp3c + mp4c + mp5c,4,0)) + ;
								'  SA Count = ' + alltrim(str(nsa,4,0)) 
		

		covcnt = .t.

		If nsa < mp3c + mp4c + mp5c
		
			sele a
			use sa
			index on realkey to sa
			
			sele b
			use realprop
			set rela to realkey into a
			index on parcel_no to xb
			
			copy fields parcel_no,pcy to sa_issues xls for realkey <> a.realkey and digclass = 'P'
			
			ln = ln + 1
			@ln,10 say 'sa_issues.xls located in this folder contains a list of these parcels.'
			
		EndIf

		If nsa > mp3c + mp4c + mp5c
		
			sele a
			use realprop
			index on realkey to sj
			
			sele b
			use sa
			set rela to realkey into a
			index on a.parcel_no to xb
			
			copy fields a.parcel_no,realkey,a.pcy to sa_issues xls for realkey <> a.realkey 
			
			ln = ln + 1
			@ln,10 say 'sa_issues.xls located in this folder contains a list of these parcels.'
			ln = ln + 1
			@ln,10 say 'More SA exemptions than parcels with P digest class.'
			
		EndIf
		
		ln = ln + 2
				
	EndIf	
	
	close datab
	
	If swcnt <> mw3c + mw4c + mw5c
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'W digest class count does not equal SW count'
		ln = ln + 1
		@ln,10 say 'W Count = ' + alltrim(str(mw3c + mw4c + mw5c,4,0)) + '  SW Count = ' + alltrim(str(swcnt,4,0)) 

		covcnt = .t.
		
		If nsw < mw3c + mw4c + mw5c
		
			sele a
			use sw
			index on realkey to sa
			
			sele b
			use realprop
			set rela to realkey into a
			index on parcel_no to xb
			
			copy fields parcel_no,pcy,realkey to sw_issues xls for realkey <> a.realkey and digclass = 'W'
			
			ln = ln + 1
			@ln,10 say 'sw_issues.xls located in this folder contains a list of these parcels.'
			
		EndIf
		
		If nsw > mw3c + mw4c + mw5c
		
			sele a
			use realprop
			index on realkey to sj
			
			sele b
			use sw
			set rela to realkey into a
			index on a.parcel_no to xb
			
			copy fields a.parcel_no,realkey,a.flcy to sw_issues xls for realkey <> a.realkey 
			
			ln = ln + 1
			@ln,10 say 'sw_issues.xls located in this folder contains a list of these parcels.'
			ln = ln + 1
			@ln,10 say 'More SW exemptions than parcels with W digest class.'
			
		EndIf
		
		ln = ln + 2
					
	EndIf	
	
	close datab
	
	If nsj <> mj3c + mj4c + mj5c + mj9c
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'J digest class count does not equal SJ count'
		ln = ln + 1
		@ln,10 say 'J Count = ' + alltrim(str(mj3c + mj4c + mj5c,4,0)) + '  SJ Count = ' + alltrim(str(nsj,4,0)) 

		covcnt = .t.
		
 
		
		If nsj < mj3c + mj4c + mj5c + mj9c
		
			sele a
			use sj
			index on realkey to sj
			
			sele b
			use realprop
			set rela to realkey into a
			index on parcel_no to xb
			
			copy fields parcel_no,flcy to sj_issues xls for realkey <> a.realkey and digclass = 'J'
			
			ln = ln + 1
			@ln,10 say 'sj_issues.xls located in this folder contains a list of these parcels.'
			
		EndIf
		
		close datab
		
		If nsj > mj3c + mj4c + mj5c + mj9c
		
			sele a
			use realprop
			index on realkey to sj
			
			sele b
			use sj
			set rela to realkey into a
			index on a.parcel_no to xb
			
			copy fields a.parcel_no,realkey,a.flcy to sj_issues xls for realkey <> a.realkey 
			
			ln = ln + 1
			@ln,10 say 'sj_issues.xls located in this folder contains a list of these parcels.'
			ln = ln + 1
			@ln,10 say 'More SJ exemptions than parcels with J digest class.'
			
		EndIf

		ln = ln + 2
					
	EndIf	

	close datab
	
	If j3ac + j4ac + j5ac + j9ac <> f3ac + f4ac + f5ac + f9ac
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'J digest class acres does not equal F digest class acres'
		ln = ln + 1
		@ln,10 say 'J Acres = ' + alltrim(str(j3ac + j4ac + j5ac + j9ac,4,0)) +;
							 '  F Acres = ' + alltrim(str(f3ac + f4ac + f5ac + f9ac,4,0))

		covcnt = .t.
		
		ln = ln + 2
					
	EndIf
	
	close databases	

	If covcnt
	
		@ln,10 say 'Press any key to continue'
		InKey(0)
		
	EndIf		
	
	
	use tdtemp
	copy to tdtempcons
	
	go top
	
	ad = ' '
	
	Do While !eof()
	
		If ad > '  '
			ad = trim(ad)+ '/' + alltrim(taxdistric)
		Else
			ad = alltrim(taxdistric)
		EndIf
		
		skip	 	
		
	EndDo
	
	If file('cons_value.txt')
		erase cons_value.txt
	EndIf
		
	use cons_value
	copy to cons_value2 delim with tab
	
	rename cons_value2.txt to cons_value.txt
	
	copy to cons_value_output sdf
	
	use defaults
	conx = conum
	
	use conames
	locate for num = conx
	
	Do Case
	
		Case name = 'BEN HILL'
			cname = 'benhill'
			cnam1 = name
		Case name = 'JEFF DAVIS'
			cname = 'jeffdavis'
			cnam1 = name
		Otherwise
			cname = alltrim(lower(name))
			cnam1 = name
					
	EndCase
	
	use defaults
	
	set device to print
	
	set mark to '-'
	
	dt = 'FMV_' + cname + dtoc(date()) + '_' + ;
	     left(time(),2) + '-' + subs(time(),4,2) + '-' + right(time(),2) + '.txt'
	     
	set mark to     
	
	set print to cr&dt

	ln = 2
	cl = 18
	co = trim(upper(cnam1)) +' COUNTY - ' + str(defaults.digyr,4,0) + ' FAIR MARKET VALUE'
	ct = (80-len(co))/2
	
*	@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
	@ln, 5 say 'The purpose of the consolidation report is to comply with DOR regulation 560-11-2-.61'
	ln = ln + 1	
*	@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'
	
	ln = 5
	
	@ln, 5 say date()
	@ln,ct say co
	@ln,75 say "Pg 1"
	
	ln = ln + 1
	
	@ln, 5 say time()
	ln = ln + 1
	ln = ln + 1
	
	If at('/',ad) > 0
		@ln, 5 say 'TAX DISTRICTS:  ' + ad
	Else
		@ln, 5 say 'TAX DISTRICT:  ' + ad
	EndIf

	@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

	ln = ln + 1
	ln = ln + 1
	
	@ln,  5 say 'RESIDENTIAL'
	@ln, 47 say 'COMMERCIAL'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'	
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'	
	@ln, 72 say '40% VALUE'

	ln = ln + 1
	
	@ln,  5 say 'R1'
	@ln,  9 say mr1c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mr1 pict '9,999,999,999'
	@ln, 47 say 'C1'
	@ln, 51 say mc1c pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say mc1 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'R3'
	@ln,  9 say mr3c pict '999,999'
	@ln, 18 say r3ac pict '999,999.99'
	@ln, 29 say mr3 pict '9,999,999,999'
	@ln, 47 say 'C3'
	@ln, 51 say mc3c pict '999,999'
	@ln, 60 say c3ac pict '999,999.99'
	@ln, 71 say mc3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'R4'
	@ln,  9 say mr4c pict '999,999'
	@ln, 18 say r4ac pict '999,999.99'
	@ln, 29 say mr4 pict '9,999,999,999'
	@ln, 47 say 'C4'
	@ln, 51 say mc4c pict '999,999'
	@ln, 60 say c4ac pict '999,999.99'
	@ln, 71 say mc4 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'R5'
	@ln,  9 say mr5c pict '999,999'
	@ln, 18 say r5ac pict '999,999.99'
	@ln, 29 say mr5 pict '9,999,999,999'
	@ln, 47 say 'C5'
	@ln, 51 say mc5c pict '999,999'
	@ln, 60 say c5ac pict '999,999.99'
	@ln, 71 say mc5 pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'R6'
	@ln,  9 say mr6c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mr6 pict '9,999,999,999'
	@ln, 47 say 'C9'
	@ln, 51 say mc9c pict '999,999'
	@ln, 60 say c9ac pict '999,999.99'
	@ln, 71 say mc9 pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'R9'
	@ln,  9 say mr9c pict '999,999'
	@ln, 18 say r9ac pict '999,999.99'
	@ln, 29 say mr9 pict '9,999,999,999'
	@ln, 47 say 'CA'
	@ln, 51 say canum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say catot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RA'
	@ln,  9 say ranum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say ratot pict '9,999,999,999'
	@ln, 47 say 'CB'
	@ln, 51 say cbnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cbtot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RB'
	@ln,  9 say rbnum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say rbtot pict '9,999,999,999'
	@ln, 47 say 'CF'
	@ln, 51 say cfnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cftot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'RF'
	@ln,  9 say rfnum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say rftot pict '9,999,999,999'
	@ln, 47 say 'CI'
	@ln, 51 say cinum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say citot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RI'
	@ln,  9 say rinum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say ritot pict '9,999,999,999'
	@ln, 47 say 'CP'
	@ln, 51 say cpnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cptot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RZ'
	@ln,  9 say rznum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say rztot pict '9,999,999,999'
	@ln, 47 say 'CZ'
	@ln, 51 say cznum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cztot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'RESIDENTIAL TRANSITIONAL'
	@ln, 47 say 'INDUSTRIAL'
	
	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'
	@ln, 72 say '40% VALUE'
	
	ln = ln + 1
	
	@ln,  5 say 'T1'
	@ln,  9 say mt1c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mt1 pict '9,999,999,999'
	@ln, 47 say 'I1'
	@ln, 51 say mi1c pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say mi1 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'T3'
	@ln,  9 say mt3c pict '999,999'
	@ln, 18 say t3ac pict '999,999.99'
	@ln, 29 say mt3 pict '9,999,999,999'
	@ln, 47 say 'I3'
	@ln, 51 say mi3c pict '999,999'
	@ln, 60 say i3ac pict '999,999.99'
	@ln, 71 say mi3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'T4'
	@ln,  9 say mt4c pict '999,999'
	@ln, 18 say t4ac pict '999,999.99'
	@ln, 29 say mt4 pict '9,999,999,999'
	@ln, 47 say 'I4'
	@ln, 51 say mi4c pict '999,999'
	@ln, 60 say i4ac pict '999,999.99'
	@ln, 71 say mi4 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'HISTORICAL'
	@ln, 47 say 'I5'
	@ln, 51 say mi5c pict '999,999'
	@ln, 60 say i5ac pict '999,999.99'
	@ln, 71 say mi5 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'I9'
	@ln, 51 say mi9c pict '999,999'
	@ln, 60 say i9ac pict '999,999.99'
	@ln, 71 say mi9 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'H1'
	@ln,  9 say mh1c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mh1 pict '9,999,999,999'
	@ln, 47 say 'IA'
	@ln, 51 say ianum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say iatot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'H3'
	@ln,  9 say mh3c pict '999,999'
	@ln, 18 say h3ac pict '999,999.99'
	@ln, 29 say mh3 pict '9,999,999,999'
	@ln, 47 say 'IB'
	@ln, 51 say ibnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say ibtot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'AGRICULTURAL'
	@ln, 47 say 'IF'
	@ln, 51 say ifnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say iftot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'II'
	@ln, 51 say iinum pict '999,999'
	@ln, 71 say iitot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'A1'
	@ln,  9 say ma1c pict '999,999'
	@ln, 29 say ma1 pict '9,999,999,999'
	@ln, 47 say 'IP'
	@ln, 51 say ipnum pict '999,999'
	@ln, 71 say iptot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'A3'
	@ln,  9 say ma3c pict '999,999'
	@ln, 18 say a3ac pict '999,999.99'
	@ln, 29 say ma3 pict '9,999,999,999'
	@ln, 47 say 'IZ'
	@ln, 51 say iznum pict '999,999'
	@ln, 71 say iztot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'A4'
	@ln,  9 say ma4c pict '999,999'
	@ln, 18 say a4ac pict '999,999.99'
	@ln, 29 say ma4 pict '9,999,999,999'
	@ln, 47 say 'UTILITY'
	
	ln = ln + 1
	
	@ln,  5 say 'A5'
	@ln,  9 say ma5c pict '999,999'
	@ln, 18 say a5ac pict '999,999.99'
	@ln, 29 say ma5 pict '9,999,999,999'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'
	@ln, 72 say '40% VALUE'
	
	ln = ln + 1
	
	@ln,  5 say 'A6'
	@ln,  9 say ma6c pict '999,999'
	@ln, 29 say ma6 pict '9,999,999,999'
	@ln, 47 say 'U1'
	@ln, 51 say mu1c pict '999,999'
	@ln, 71 say mu1 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'A9'
	@ln,  9 say ma9c pict '999,999'
	@ln, 18 say a9ac pict '999,999.99'
	@ln, 29 say ma9 pict '9,999,999,999'
	@ln, 47 say 'U2' 
	@ln, 51 say mu2c pict '999,999'
	@ln, 60 say u2ac pict '999,999.99'
	@ln, 71 say mu2 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'AA'
	@ln,  9 say aanum pict '999,999'
	@ln, 29 say aatot pict '9,999,999,999'
	@ln, 47 say 'U3' 
	@ln, 51 say mu3c pict '999,999'
	@ln, 60 say u3ac pict '999,999.99'
	@ln, 71 say mu3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'AB'
	@ln,  9 say abnum pict '999,999'

	@ln, 29 say abtot pict '9,999,999,999'
	@ln, 47 say 'U4' 
	@ln, 51 say mu4c pict '999,999'
	@ln, 60 say u4ac pict '999,999.99'
	@ln, 71 say mu4 pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'AF'
	@ln,  9 say afnum pict '999,999'
	@ln, 29 say aftot pict '9,999,999,999'
	@ln, 47 say 'U5' 
	@ln, 51 say mu5c pict '999,999'
	@ln, 60 say u5ac pict '999,999.99'
	@ln, 71 say mu5 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'AI'
	@ln,  9 say ainum pict '999,999'
	@ln, 29 say aitot pict '9,999,999,999'
	@ln, 47 say 'U9' 
	@ln, 51 say mu9c pict '999,999'
	@ln, 60 say u9ac pict '999,999.99'
	@ln, 71 say mu9 pict '9,999,999,999'

	ln = ln + 1

*pg x

	@ln,  5 say 'AZ'
	@ln,  9 say aznum pict '999,999'
	@ln, 29 say aztot Pict '9,999,999,999'
	@ln, 47 say 'UA' 
	@ln, 51 say uanum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say uatot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'PREFERENTIAL'
	@ln, 47 say 'UB' 
	@ln, 51 say ubnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say ubtot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'UF' 
	@ln, 51 say ufnum pict '999,999'
	@ln, 71 say uftot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'P3'
	@ln,  9 say mp3c pict '999,999'
	@ln, 18 say p3ac pict '999,999.99'
	@ln, 29 say mp3 Pict '9,999,999,999'
	@ln, 47 say 'UZ' 
	@ln, 51 say uznum pict '999,999'
	@ln, 71 say uztot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'P4'
	@ln,  9 say mp4c pict '999,999'
	@ln, 18 say p4ac pict '999,999.99'
	@ln, 29 say mp4 Pict '9,999,999,999'
	@ln, 47 say 'EXEMPT PROPERTY' 
	
	ln = ln + 1
	
	@ln,  5 say 'P5'
	@ln,  9 say mp5c pict '999,999'
	@ln, 18 say p5ac pict '999,999.99'
	@ln, 29 say mp5 Pict '9,999,999,999'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 72 say '40% VALUE'

	ln = ln + 1
	
	@ln,  5 say 'P6'
	@ln,  9 say mp6c pict '999,999'
	@ln, 29 say mp6 Pict '9,999,999,999'
	@ln, 47 say 'E0' 
	@ln, 51 say me0c + e0num pict '999,999'
	@ln, 71 say me0 + e0tot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'P9'
	@ln,  9 say mp9c pict '999,999'
	@ln, 18 say p9ac pict '999,999.99'
	@ln, 29 say mp9 Pict '9,999,999,999'
	@ln, 47 say 'E1' 
	@ln, 51 say me1c+e1num pict '999,999'
	@ln, 71 say me1+e1tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CONSERVATION USE'
	@ln, 47 say 'E2' 
	@ln, 51 say me2c+e2num pict '999,999'
	@ln, 71 say me2+e2tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'E3' 
	@ln, 51 say me3c+e3num pict '999,999'
	@ln, 71 say me3+e3tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'V3'
	@ln,  9 say mv3c pict '999,999'
	@ln, 18 say v3ac pict '999,999.99'
	@ln, 29 say mv3 Pict '9,999,999,999'
	@ln, 47 say 'E4' 
	@ln, 51 say me4c+e4num pict '999,999'
	@ln, 71 say me4+e4tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'V4'
	@ln,  9 say mv4c pict '999,999'
	@ln, 18 say v4ac pict '999,999.99'
	@ln, 29 say mv4 Pict '9,999,999,999'
	@ln, 47 say 'E5' 
	@ln, 51 say me5c+e5num pict '999,999'
	@ln, 71 say me5+e5tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'V5'
	@ln,  9 say mv5c pict '999,999'
	@ln, 18 say v5ac pict '999,999.99'
	@ln, 29 say mv5 Pict '9,999,999,999'
	@ln, 47 say 'E6' 
	@ln, 51 say me6c+e6num pict '999,999'
	@ln, 71 say me6+e6tot pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'V6'
	@ln,  9 say mv6c pict '999,999'
	@ln, 29 say mv6 Pict '9,999,999,999'
	@ln, 47 say 'E7' 
	@ln, 51 say me7c+e7num pict '999,999'
	@ln, 71 say me7+e7tot pict '9,999,999,999'

	ln = ln + 1

	@ln, 47 say 'E8' 
	@ln, 51 say me8c+e8num pict '999,999'
	@ln, 71 say me8+e8tot pict '9,999,999,999'

	ln = ln + 1

	@ln, 47 say 'E9' 
	@ln, 51 say me9c+e9num pict '999,999'
	@ln, 71 say me9+e9tot pict '9,999,999,999'

	ln = ln + 1

	@ln, 47 say 'TOT:' 
	@ln, 51 say me0c+me1c+e1num+me2c+e2num+me3c+e3num+me4c+e4num+me5c+e5num+;
	me6c+e6num+me7c+e7num+me8c+e8num+me9c+e9num pict '999,999'
	@ln, 71 say me0+me1+me2+me3+me4+me5+me6+me7+me8+me9+e1tot+e2tot+e3tot+;
	e4tot+e5tot+e6tot+e7tot+e8tot+e9tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say chr(3)
	
*flpa

**flpa stuff

	ln = 2
	cl = 18
	co = trim(upper(cnam1)) +' COUNTY - ' + str(defaults.digyr,4,0) + ' FAIR MARKET VALUE'
	ct = (80-len(co))/2
	
*	@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
	@ln, 5 say 'The purpose of the consolidation report is to comply with DOR regulation 560-11-2-.61'
	ln = ln + 1	
*	@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'

	ln = 5
	
	@ln, 5 say date()
	@ln,ct say co
	@ln,75 say "Pg 2"
	
	ln = ln + 1
	
	@ln, 5 say time()
	ln = ln + 1
	ln = ln + 1
	
	If at('/',ad) > 0
		@ln, 5 say 'TAX DISTRICTS:  ' + ad
	Else
		@ln, 5 say 'TAX DISTRICT:  ' + ad
	EndIf

	@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

	ln = ln + 2
	
	@ln,  5 say 'ENVIRONMENTALLY SENSITIVE'
	@ln, 47 say 'BROWNFIELD'		
		
	ln = ln + 1
		
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'	
	@ln, 72 say '40% VALUE'
	
	ln = ln + 1

	@ln,  5 say 'W3'
	@ln,  9 say mW3c pict '999,999'
	@ln, 18 say W3ac pict '999,999.99'
	@ln, 29 say mW3 Pict '9,999,999,999'
	@ln, 47 say 'B1' 
	@ln, 51 say mb1c pict '999,999'
	@ln, 71 say mb1 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'W4'
	@ln,  9 say mw4c pict '999,999'
	@ln, 18 say w4ac pict '999,999.99'
	@ln, 29 say mw4 Pict '9,999,999,999'
	@ln, 47 say 'B3' 
	@ln, 51 say mb3c pict '999,999'
	@ln, 60 say b3ac pict '999,999.99'
	@ln, 71 say mb3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'W5'
	@ln,  9 say mw5c pict '999,999'
	@ln, 18 say w5ac pict '999,999.99'
	@ln, 29 say mw5 Pict '9,999,999,999'
	@ln, 47 say 'B4' 
	@ln, 51 say mb4c pict '999,999'
	@ln, 60 say b4ac pict '999,999.99'
	@ln, 71 say mb4 pict '9,999,999,999'

	ln = ln + 1		
	
	@ln,  5 say 'FLPA'
	@ln, 47 say 'B5' 
	@ln, 51 say mb5c pict '999,999'
	@ln, 60 say b5ac pict '999,999.99'
	@ln, 71 say mb5 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'	
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'B6' 
	@ln, 51 say mb6c pict '999,999'
	@ln, 71 say mb6 pict '9,999,999,999'


	ln = ln + 1

	@ln,  5 say 'J3'
	@ln,  9 say mj3c pict '999,999'
	@ln, 18 say j3ac pict '999,999.99'
	@ln, 29 say mj3 pict '9,999,999,999'
	@ln, 47 say 'FLPA FMV'	
	
	ln = ln + 1

	@ln,  5 say 'J4'
	@ln,  9 say mj4c pict '999,999'
	@ln, 18 say j4ac pict '999,999.99'
	@ln, 29 say mj4 pict '9,999,999,999'
	
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'	
	@ln, 72 say '40% VALUE'
	
	
	ln = ln + 1

	@ln,  5 say 'J5'
	@ln,  9 say mj5c pict '999,999'
	@ln, 18 say j5ac pict '999,999.99'
	@ln, 29 say mj5 pict '9,999,999,999'

	@ln, 47 say 'F3'
	@ln, 51 say mf3c pict '999,999'
	@ln, 60 say f3ac pict '999,999.99'
	@ln, 71 say mf3 pict '9,999,999,999'
	
	
	ln = ln + 1
	
	@ln,  5 say 'J9'
	@ln,  9 say mj9c pict '999,999'
	@ln, 18 say j9ac pict '999,999.99'
	@ln, 29 say mj9 pict '9,999,999,999'

	@ln, 47 say 'F4'
	@ln, 51 say mf4c pict '999,999'
	@ln, 60 say f4ac pict '999,999.99'
	@ln, 71 say mf4 pict '9,999,999,999'
	
	
	ln = ln + 1

	@ln, 47 say 'F5'
	@ln, 51 say mf5c pict '999,999'
	@ln, 60 say f5ac pict '999,999.99'
	@ln, 71 say mf5 pict '9,999,999,999'

	ln = ln + 1
		
	@ln, 47 say 'F9'
	@ln, 51 say mf9c pict '999,999'
	@ln, 60 say f9ac pict '999,999.99'
	@ln, 71 say mf9 pict '9,999,999,999'

	ln = ln + 5
		
	@ln,26 say 'SUMMARY'	
	
	ln = ln + 2
	
	@ln,15 say 'GROUP'
	@ln,28 say 'COUNT'
	@ln,37 say 'ACRES'
	@ln,52 say '40% VALUE' 	
	
	ln = ln + 1
	
	@ln, 5 say 'Residential'
	@ln,27 say mr1c+mr3c+mr4c+mr5c+mr6c+mr9c+ranum+rbnum+rfnum+rinum+;
	rznum pict '999,999'
	@ln,35 say r3ac+r4ac+r5ac+r9ac pict '999,999.99'
	@ln,50 say mr1+mr3+mr4+mr5+mr6+mr9+ratot+rbtot+rftot+ritot+rztot ;
	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Residen Transitional'
	@ln,27 say mt1c+mt3c+mt4c pict '999,999'
	@ln,35 say t3ac+t4ac pict '999,999.99'
	@ln,50 say mt1+mt3+mt4	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Historic'
	@ln,27 say mh1c+mh3c pict '999,999'
	@ln,35 say h3ac pict '999,999.99'
	@ln,50 say mh1+mh3	pict '99,999,999,999'

	ln = ln + 1
	
	@ln, 5 say 'Industrial'
	@ln,27 say mi1c+mi3c+mi4c+mi5c+mi9c+ianum+ibnum+ifnum+iinum+ipnum+;
	iznum pict '999,999'
	@ln,35 say i3ac+i4ac+i5ac+i9ac pict '999,999.99'
	@ln,50 say mi1+mi3+mi4+mi5+mi9+iatot+ibtot+iftot+iitot+iztot+iptot ;
	pict '99,999,999,999'

	ln = ln + 1		
	
	@ln, 5 say 'Agricultural'
	@ln,27 say ma1c+ma3c+ma4c+ma5c+ma6c+ma9c+aanum+abnum+afnum+ainum+;
	aznum pict '999,999'
	@ln,35 say a3ac+a4ac+a5ac+a9ac pict '999,999.99'
	@ln,50 say ma1+ma3+ma4+ma5+ma6+ma9+aatot+abtot+aftot+aitot+aztot ;
	pict '99,999,999,999'

	ln = ln + 1
	
	@ln, 5 say 'Preferential'
	@ln,27 say mp3c+mp4c+mp5c+mp6c+mp9c pict '999,999'
	@ln,35 say p3ac+p4ac+p5ac+p9ac pict '999,999.99'
	@ln,50 say mp3+mp4+mp5+mp6+mp9	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Conservation Use'
	@ln,27 say mv3c+mv4c+mv5c+mv6c pict '999,999'
	@ln,35 say v3ac+v4ac+v5ac pict '999,999.99'
	@ln,50 say mv3+mv4+mv5+mv6	pict '99,999,999,999'
	
	ln = ln + 1

	@ln, 5 say 'Enviromentally Sen'
	@ln,27 say mw3c+mw4c+mw5c pict '999,999'
	@ln,35 say w3ac+w4ac+w5ac pict '999,999.99'
	@ln,50 say mw3+mw4+mw5+mw6	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Commercial'
	@ln,27 say mc1c+mc3c+mc4c+mc5c+mc9c+canum+cbnum+cfnum+cinum+cpnum+;
	cznum pict '999,999'
	@ln,35 say c3ac+c4ac+c5ac+c9ac pict '999,999.99'
	@ln,50 say mc1+mc3+mc4+mc5+mc9+catot+cbtot+cftot+citot+cztot+cptot ;
	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Utility'
	@ln,27 say mu1c+mu2c+mu3c+mu4c+mu5c+mu6c+mu9c+uanum+ubnum+ufnum+uinum+;
	uznum pict '999,999'
	@ln,35 say u2ac+u3ac+u4ac+u5ac+u9ac pict '999,999.99'
	@ln,50 say mu1+mu2+mu3+mu4+mu5+mu6+mu9+uatot+ubtot+uftot+uitot+uztot ;
	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Brownfield'
	@ln,27 say mb1c+mb3c+mb4c+mb5c+mb6c pict '999,999'
	@ln,35 say b3ac+b4ac+b5ac pict '999,999.99'
	@ln,50 say mb1+mb3+mb4+mb5+mb6 pict '99,999,999,999'
	
	ln = ln + 1

	@ln, 5 say 'FLPA (J)'
	@ln,27 say mj3c+mj4c+mj5c+mj9c pict '999,999'
	@ln,35 say j3ac+j4ac+j5ac+j9ac pict '999,999.99'
	@ln,50 say mj3+mj4+mj5+mj9 pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'FLPA FMV (F)'
	@ln,27 say mf3c+mf4c+mf5c+mf9c pict '999,999'
	@ln,35 say f3ac+f4ac+f5ac+f9ac pict '999,999.99'
	@ln,50 say mf3+mf4+mf5+mf9 pict '99,999,999,999'
	
	ln = ln + 1
	

	@ln, 5 say 'Motor Vehicle'
	@ln,27 say mvc pict '999,999'
	@ln,50 say mv pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Mobile Home'
	@ln,27 say mhc pict '999,999'
	@ln,50 say mh pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Timber'
	@ln,27 say tic pict '999,999'
	@ln,50 say ti pict '99,999,999,999'	
	
	ln = ln + 1
	
	@ln, 5 say 'Heavy Truck Equipment'
	@ln,27 say hdc pict '999,999'
	@ln,50 say hd pict '99,999,999,999'
	
	ln = ln + 2
	
	@ln, 5 say 'Gross Digest Total'
	@ln,27 say GrCnt pict '999,999'	
	@ln,35 say GrAc pict '999,999.99'	
	@ln,50 say GrVal pict '99,999,999,999'
	
	
*!*		eject page
	ln = 62

	@ln,  5 say chr(3)
	
	
***2nd page	

	pg = 2
	
	sele a
	
	sele d
	use tdtempcons
	index on taxdistric to xa
	
	sele c
	use millrate
	set order to taxdistric
	
	sele b
	use cons_exempt
	go top
	
	Do While !eof()
		
		pg = pg + 1
		ln = 2
		cl = 18
		co = trim(upper(cnam1)) +' COUNTY - ' + str(defaults.digyr,4,0) + ' FMV EXEMPTIONS'
		ct = (80-len(co))/2
		
*!*			@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
*!*			ln = ln + 1	
*!*			@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'

		@ln, 5 say 'The purpose of the consolidation report is to comply with DOR regulation 560-11-2-.61'
		ln = ln + 1	

		ln = 5
		
		@ln, 5 say date()
		@ln,ct say co
		@ln,75 say "Pg " + alltrim(str(pg,2,0))
		
		ln = ln + 1
		
		@ln, 5 say time()
		ln = ln + 1
		ln = ln + 1
		
		If at('/',ad) > 0
			@ln, 5 say 'TAX DISTRICTS:  ' + ad
		Else
			@ln, 5 say 'TAX DISTRICT:  ' + ad
		EndIf

		@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

		ln = ln + 2
		
		@ln,  5 say 'TAX TYPE ' + str(taxtype,3,0) + ' - ' + ttdescrip
		
		ln = ln + 2
		
		tt = taxtype
		ec = 0
		ea = 0
		
		Do while !eof() and tt = taxtype
		
			@ln, 5 say excode + space(2) + descrip 
			@ln,43 say excount pict '999,999'
			@ln,53 say examount pict '9,999,999,999'
			
			ln = ln + 1
			ea = ea + examount
			ec = ec + excount
			
			skip
			
		EndDo
		
		sele tdtempcons
		go top
		
		ltt = .t.
		
		Do while !eof()
		
			ctt = taxdistric + str(tt,3,0)
			
			sele millrate
			seek ctt

	
			If !found()
			
				ltt = .f.
				exit
				
			EndIf
			
			sele tdtempcons
			skip
				
		EndDo	
		
		ln = ln + 1
		@ln, 5 say 'Totals'
		@ln,43 say ec pict '999,999'
		@ln,53 say ea pict '9,999,999,999'

		ln = ln + 2
		@ln, 5 say 'Net Digest'
		
		If ltt
			@ln,53 say GrVal - ea pict '9,999,999,999'
		Else
			@ln,20 say 'Net Value is not valid for this taxtype within Tax Dist scope.'
			ln = ln + 1
			@ln,20 say 'Cons Rep should be run for Tax Dist(s) where Tax Type is present.'
			ln = ln + 1
			@ln,20 say 'The Mill Rate tax calculation table contains Tax Dist/Tax Type info.'
		EndIf		

		ln = 62

		@ln,  5 say chr(3)
		
		sele cons_exempt
		
		If eof()
			exit
		EndIf
			
*		skip
			
	EndDo
	
*!*		ln = 2
*!*		cl = 18
*!*		co = trim(upper(cnam1)) +' COUNTY - ' + str(defaults.digyr,4,0) + ' FAIR MARKET VALUE'
*!*		ct = (80-len(co))/2
*!*		
*!*	*	@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
*!*		@ln, 5 say 'The purpose of the consolidation report is to comply with DOR regulation 560-11-2-.61'
*!*		ln = ln + 1	
*!*	*	@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'

*!*		ln = 5
*!*		
*!*		@ln, 5 say date()
*!*		@ln,ct say co
*!*		@ln,75 say "Pg 3"
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say time()
*!*		ln = ln + 1
*!*		ln = ln + 1
*!*		
*!*		If at('/',ad) > 0
*!*			@ln, 5 say 'TAX DISTRICTS:  ' + ad
*!*		Else
*!*			@ln, 5 say 'TAX DISTRICT:  ' + ad
*!*		EndIf

*!*		@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

*!*		ln = ln + 2
*!*			
*!*		@ln,26 say 'SUMMARY'	
*!*		
*!*		ln = ln + 2
*!*		
*!*		@ln,15 say 'GROUP'
*!*		@ln,28 say 'COUNT'
*!*		@ln,37 say 'ACRES'
*!*		@ln,52 say '40% VALUE' 	
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Residential'
*!*		@ln,27 say mr1c+mr3c+mr4c+mr5c+mr6c+mr9c+ranum+rbnum+rfnum+rinum+;
*!*		rznum pict '999,999'
*!*		@ln,35 say r3ac+r4ac+r5ac+r9ac pict '999,999.99'
*!*		@ln,50 say mr1+mr3+mr4+mr5+mr6+mr9+ratot+rbtot+rftot+ritot+rztot ;
*!*		pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Residen Transitional'
*!*		@ln,27 say mt1c+mt3c+mt4c pict '999,999'
*!*		@ln,35 say t3ac+t4ac pict '999,999.99'
*!*		@ln,50 say mt1+mt3+mt4	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Historic'
*!*		@ln,27 say mh1c+mh3c pict '999,999'
*!*		@ln,35 say h3ac pict '999,999.99'
*!*		@ln,50 say mh1+mh3	pict '99,999,999,999'

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Industrial'
*!*		@ln,27 say mi1c+mi3c+mi4c+mi5c+mi9c+ianum+ibnum+ifnum+iinum+ipnum+;
*!*		iznum pict '999,999'
*!*		@ln,35 say i3ac+i4ac+i5ac+i9ac pict '999,999.99'
*!*		@ln,50 say mi1+mi3+mi4+mi5+mi9+iatot+ibtot+iftot+iitot+iztot+iptot ;
*!*		pict '99,999,999,999'

*!*		ln = ln + 1		
*!*		
*!*		@ln, 5 say 'Agricultural'
*!*		@ln,27 say ma1c+ma3c+ma4c+ma5c+ma6c+ma9c+aanum+abnum+afnum+ainum+;
*!*		aznum pict '999,999'
*!*		@ln,35 say a3ac+a4ac+a5ac+a9ac pict '999,999.99'
*!*		@ln,50 say ma1+ma3+ma4+ma5+ma6+ma9+aatot+abtot+aftot+aitot+aztot ;
*!*		pict '99,999,999,999'

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Preferential'
*!*		@ln,27 say mp3c+mp4c+mp5c+mp6c+mp9c pict '999,999'
*!*		@ln,35 say p3ac+p4ac+p5ac+p9ac pict '999,999.99'
*!*		@ln,50 say mp3+mp4+mp5+mp6+mp9	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Conservation Use'
*!*		@ln,27 say mv3c+mv4c+mv5c+mv6c pict '999,999'
*!*		@ln,35 say v3ac+v4ac+v5ac pict '999,999.99'
*!*		@ln,50 say mv3+mv4+mv5+mv6	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'Enviromentally Sen'
*!*		@ln,27 say mw3c+mw4c+mw5c pict '999,999'
*!*		@ln,35 say w3ac+w4ac+w5ac pict '999,999.99'
*!*		@ln,50 say mw3+mw4+mw5+mw6	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Commercial'
*!*		@ln,27 say mc1c+mc3c+mc4c+mc5c+mc9c+canum+cbnum+cfnum+cinum+cpnum+;
*!*		cznum pict '999,999'
*!*		@ln,35 say c3ac+c4ac+c5ac+c9ac pict '999,999.99'
*!*		@ln,50 say mc1+mc3+mc4+mc5+mc9+catot+cbtot+cftot+citot+cztot+cptot ;
*!*		pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Utility'
*!*		@ln,27 say mu1c+mu2c+mu3c+mu4c+mu5c+mu6c+mu9c+uanum+ubnum+ufnum+uinum+;
*!*		uznum pict '999,999'
*!*		@ln,35 say u2ac+u3ac+u4ac+u5ac+u9ac pict '999,999.99'
*!*		@ln,50 say mu1+mu2+mu3+mu4+mu5+mu6+mu9+uatot+ubtot+uftot+uitot+uztot ;
*!*		pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Brownfield'
*!*		@ln,27 say mb1c+mb3c+mb4c+mb5c+mb6c pict '999,999'
*!*		@ln,35 say b3ac+b4ac+b5ac pict '999,999.99'
*!*		@ln,50 say mb1+mb3+mb4+mb5+mb6 pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'FLPA (J)'
*!*		@ln,27 say mj3c+mj4c+mj5c+mj9c pict '999,999'
*!*		@ln,35 say j3ac+j4ac+j5ac+j9ac pict '999,999.99'
*!*		@ln,50 say mj3+mj4+mj5+mj9 pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'FLPA FMV (F)'
*!*		@ln,27 say mf3c+mf4c+mf5c+mf9c pict '999,999'
*!*		@ln,35 say f3ac+f4ac+f5ac+f9ac pict '999,999.99'
*!*		@ln,50 say mf3+mf4+mf5+mf9 pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		

*!*		@ln, 5 say 'Motor Vehicle'
*!*		@ln,27 say mvc pict '999,999'
*!*		@ln,50 say mv pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Mobile Home'
*!*		@ln,27 say mhc pict '999,999'
*!*		@ln,50 say mh pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Timber'
*!*		@ln,27 say tic pict '999,999'
*!*		@ln,50 say ti pict '99,999,999,999'	
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Heavy Truck Equipment'
*!*		@ln,27 say hdc pict '999,999'
*!*		@ln,50 say hd pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Gross Digest Total'
*!*		@ln,27 say GrCnt pict '999,999'	
*!*		@ln,35 say GrAc pict '999,999.99'	
*!*		@ln,50 say GrVal pict '99,999,999,999'
	
*!*		ln = ln + 2

*!*		@ln, 5 say 'Exemptions-Bond'
*!*		@ln,27 say BnExCnt	pict '999,999'
*!*		@ln,50 say BnExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Net Bond Digest'
*!*		@ln,27 say GrCnt - BnExCnt pict '999,999'

*!*		@ln,50 say GrVal - BnExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Gross Digest'
*!*		@ln,27 say GrCnt pict '999,999'	
*!*		@ln,35 say GrAc pict '999,999.99'	
*!*		@ln,50 say GrVal pict '99,999,999,999'

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Exemptions M&O'	
*!*		@ln,27 say MoExCnt pict '999,999'
*!*		@ln,50 say MoExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Net M&O Digest'
*!*		@ln,27 say GrCnt - MoExCnt pict '999,999'	
*!*		@ln,50 say GrVal - MoExVal  pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln,27 say 'TAX LEVIED'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'TYPE'
*!*		@ln,11  say 'ASSESSED VALUE'
*!*		@ln,31 say 'MILLAGE'	
*!*		@ln,48 say 'TAX'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'M&O'
*!*		@ln,12 say GrVal - MoExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'Bond'
*!*		@ln,12 say GrVal - BnExVal pict '99,999,999,999'
	
	ln = ln + 5
	
	@ln, 5 say 'I certify that this Consolidation and Evaluation of Digest (PT10A)'
	ln = ln + 1
	@ln, 5 say 'report reflects the ' + str(defaults.digyr,4,0) + ' values of taxable property computed'
	ln = ln + 1
	@ln, 5 say 'without regard to any limitations imposed by O.C.G.A. 48-5B-1'
	ln = ln + 1
	@ln, 5 say 'and is hereby submitted pursuant to Department of Revenue regulation'
	ln = ln + 1
	@ln, 5 say '560-11-2-.61.  I further understand that during the period of time'
	ln = ln + 1
	@ln, 5 say 'in which 48-5B-1 is in effect, the commissioner shall continue to'
	ln = ln + 1
	@ln, 5 say 'examine and review the ' + alltrim(cnam1) + ' county tax digest as required'
	ln = ln + 1
	@ln, 5 say 'by law and that in the event a deficiency in the tax digest exists this'
	ln = ln + 1
	@ln, 5 say "Consolidation and Evaluation of Digest (PT10A) report and it's"
	ln = ln + 1
	@ln, 5 say 'corresponding detailed appraisal files may be used as evidence that the'
	ln = ln + 1
	@ln, 5 say 'existing deficiency is directly attributable to the limitations'
	ln = ln + 1
	@ln, 5 say 'required by O.C.G.A. 48-5B-1.'
	ln = ln + 5
	@ln, 5 say '______________________________________________'
	ln = ln + 1
	@ln, 5 say ' Chairman of the Board of Tax Assessors'
		
*pg y
		

	
	
	set print to
	set device to screen

	close all
	
	clear
	
	@ 4,20 say '*** The FMV Consolidation Report is for use in the TAO only.  It should not be'
	@ 5,20 say "*** considered as the OFFICIAL report which should come from the TC's office."
	@ 6,20 say '*** The primary functions of this report should be for confirmation/ comparative'
	@ 7,20 say '*** purposes.'
	  
	@ 9,20 say 'Notepad will now run and open the tdcons+[date]+[time].txt allowing you to make'
	@10,20 say 'the necessary setup modifications so the Consolidation Sheet can be printed.'  
	@12,20 say 'If the data is not in a readable format, Highlight all of the text by going to'
	@13,20 say 'Edit>>Select All.  Go, to Format>>Font.  Reduce the Point size to the level that'
	@14,20 say 'provides a readable document and one that can be printed on 8.5 x 11 paper with'
	@15,20 say 'Portrait orientation.'
	@17,20 say 'To print the text, go to File>>Print.  You can close Notepad and return to'
	@18,20 say 'Fox by clicking the "X" in the upper right-hand corner of the Notepad window.'
	@22,20 say 'When you are ready to run Notepad and view the data, press any key...'

	InKey(0)
	
	run /N3 notepad cr&dt
	
	
	return

*-----------------------------------------------------------------------------
FUNCTION MDigA

	Do Case
    Case DigStrat = '1'
    
	      ma1 = ma1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
	      ma1c = ma1c + iif(a_value>0, 1, 0)
	      mp1 = mp1 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
	      If OvRideVal = 0 .and. P_Value > 0
	        mp1c = mp1c + 1
	      EndIf 
	      
				If a_value > 0 or ovrideval > 0 &&or ovrideval + a_value + p_value = 0
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
		      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
		      					realprop.taxdistric)
		    EndIf  					
	            
				If p_value > 0
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
		      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
		    EndIf  					

			
    Case Digstrat = '2'

	      ma2 = ma2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
	      ma2c = ma2c + 1
	      mp2 = mp2 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
	      If OvRideVal = 0 .and. P_Value > 0
	        mp2c = mp2c + 1
	      EndIf
	      
				If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
		      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
		      					realprop.taxdistric)
		    EndIf  					
	            
				If p_value > 0
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
		      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
		    EndIf  					

    Case Digstrat = '3'
      ma3 = ma3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      ma3c = ma3c + 1
      mp3 = mp3 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp3c = mp3c + 1
      EndIf
      a3ac = a3ac + TotalAcres

			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      ma4 = ma4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      ma4c = ma4c + 1
      mp4 = mp4 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp4c = mp4c + 1
      EndIf
      a4ac = a4ac + TotalAcres
      
			If a_value > 0 or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      ma5 = ma5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      ma5c = ma5c + 1
      mp5 = mp5 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp5c = mp5c + 1
      EndIf
      a5ac = a5ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      ma6 = ma6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      ma6c = ma6c + 1
      mp6 = mp6 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp6c = mp6c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      ma9 = ma9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      ma9c = ma9c + 1
      mp9 = mp9 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp9c = mp9c + 1
      EndIf
      a9ac = a9ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric))
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric))
	    EndIf  					
            
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric))
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric))
	    EndIf  					
          
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigR

	Do Case
    Case DigStrat = '1'
      mr1 = mr1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mr1c = mr1c + iif(a_value>0, 1, 0)
      mp1 = mp1 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp1c = mp1c + 1
      EndIf 

			If a_value > 0  or ovrideval > 0 &&or ovrideval + a_value + p_value = 0 
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mr2 = mr2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mr2c = mr2c + 1
      mp2 = mp2 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp2c = mp2c + 1
      EndIf

			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					

    Case Digstrat = '3'
      mr3 = mr3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mr3c = mr3c + 1
      mp3 = mp3 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp3c = mp3c + 1
      EndIf
      r3ac = r3ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					

    Case Digstrat = '4'
      mr4 = mr4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mr4c = mr4c + 1
      mp4 = mp4 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp4c = mp4c + 1
      EndIf
      r4ac = r4ac + TotalAcres 
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    Case Digstrat = '5'
      mr5 = mr5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mr5c = mr5c + 1
      mp5 = mp5 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp5c = mp5c + 1
      EndIf
      r5ac = r5ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mr6 = mr6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mr6c = mr6c + 1
      mp6 = mp6 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp6c = mp6c + 1
      EndIf
    Case Digstrat = '9'
      mr9 = mr9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mr9c = mr9c + 1
      mp9 = mp9 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp9c = mp9c + 1
      EndIf
      r9ac = r9ac + TotalAcres 
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigC

	Do Case
    Case DigStrat = '1'
      mc1 = mc1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mc1c = mc1c + iif(a_value > 0, 1, 0)
      
*!*	      sele commcnt
*!*	      append blank
*!*	      replace realkey with realprop.realkey
*!*	      sele realprop
      
      mp1 = mp1 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp1c = mp1c + 1
      EndIf

			If a_value > 0 or ovrideval > 0 &&or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
       
    Case Digstrat = '2'
      mc2 = mc2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mc2c = mc2c + 1
      mp2 = mp2 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp2c = mp2c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mc3 = mc3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mc3c = mc3c + 1
      mp3 = mp3 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp3c = mp3c + 1
      EndIf
      c3ac = c3ac + TotalAcres 
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    Case Digstrat = '4'
      mc4 = mc4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mc4c = mc4c + 1
      mp4 = mp4 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp4c = mp4c + 1
      EndIf
      c4ac = c4ac + TotalAcres

			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mc5 = mc5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mc5c = mc5c + 1
      mp5 = mp5 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp5c = mp5c + 1
      EndIf
      c5ac = c5ac + TotalAcres

			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mc6 = mc6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mc6c = mc6c + 1
      mp6 = mp6 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp6c = mp6c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mc9 = mc9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mc9c = mc9c + 1
      mp9 = mp9 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp9c = mp9c + 1
      EndIf
      c9ac = c9ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
                  
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigI

	Do Case
    Case DigStrat = '1'
      mi1 = mi1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mi1c = mi1c + iif(a_value>0, 1,0)
      mp1 = mp1 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp1c = mp1c + 1
      EndIf 
      
			If a_value > 0  or ovrideval > 0 &&or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mi2 = mi2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mi2c = mi2c + 1
      mp2 = mp2 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp2c = mp2c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mi3 = mi3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mi3c = mi3c + 1
      mp3 = mp3 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp3c = mp3c + 1
      EndIf
      i3ac = i3ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      mi4 = mi4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mi4c = mi4c + 1
      mp4 = mp4 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp4c = mp4c + 1
      EndIf
      i4ac = i4ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mi5 = mi5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mi5c = mi5c + 1
      mp5 = mp5 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp5c = mp5c + 1
      EndIf
      i5ac = i5ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mi6 = mi6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mi6c = mi6c + 1
      mp6 = mp6 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp6c = mp6c + 1
      EndIf
      
 			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					

    Case Digstrat = '9'
      mi9 = mi9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mi9c = mi9c + 1
      mp9 = mp9 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp9c = mp9c + 1
      EndIf
      i9ac = i9ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
                  
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigV

	Do Case
    Case DigStrat = '1'
      mv1 = mv1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mv1c = mv1c + iif(p_value>0, 1,0)
      ma1 = ma1 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. a_Value > 0
        ma1c = ma1c + 1
      EndIf 
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      
      	If !pref and sub_type <> 'CUV'
      	
      		a2ac = a2ac + acres
      		aac  = aac + acres
      		
      	Else
      	
      		If sub_type <> 'CUV'
      	
	      		pac = pac + acres
	      		
	      	EndIf	

      			
      	EndIf
      	
      	skip
      	
      EndDo
      
      sele realprop
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					round(A_Value*.4,0),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mv2 = mv2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mv2c = mv2c + 1
      ma2 = ma2 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mv2c = mv2c + 1
      EndIf

      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      
      	If !pref and sub_type <> 'CUV'
      	
      		a2ac = a2ac + acres
      		aac  = aac + acres
      		
      	Else
      	
      		If sub_type <> 'CUV'
      	
	      		pac = pac + acres
	      		
	      	EndIf	

      			
      	EndIf
      	
      	skip
      	
      EndDo
      
      sele realprop
      
			If a_value > 0  or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					round(a_value*.4,0),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mv3 = mv3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mv3c = mv3c + 1
      ma3 = ma3 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma3c = ma3c + 1
      EndIf

      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      
      	If !pref and sub_type <> 'CUV'
      	
      		a3ac = a3ac + acres
      		aac  = aac + acres
      		
      	Else
      	
      		If sub_type <> 'CUV'
      	
	      		pac = pac + acres
	      		
	      	EndIf	
      			
      	EndIf
      	
      	skip
      	
      EndDo
      
      sele realprop
      
			If a_value > 0  or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					round(A_Value*.4,0),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
      v3ac = v3ac + pac
            
    Case Digstrat = '4'
      mv4 = mv4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mv4c = mv4c + 1
      ma4 = ma4 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma4c = ma4c + 1
      EndIf

      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      
      	If !pref and sub_type <> 'CUV'
      	
      		a4ac = a4ac + acres
      		aac  = aac + acres
      		
      	Else
      	
      		If sub_type <> 'CUV'
      	
	      		pac = pac + acres
	      		
	      	EndIf	
      			
      	EndIf
      	
      	skip
      	
      EndDo
      
      sele realprop
      
			If a_value > 0  or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					round(A_Value*.4,0),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
      v4ac = v4ac + pac
            
    Case Digstrat = '5'
      mv5 = mv5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mv5c = mv5c + 1
      ma5 = ma5 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma5c = ma5c + 1
      EndIf
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      
      	If !pref and sub_type <> 'CUV'
      	
      		a5ac = a5ac + acres
      		aac  = aac + acres
      		
      	Else
      	
      		If sub_type <> 'CUV'
      	
	      		pac = pac + acres
	      		
	      	EndIf	
      			
      	EndIf
      	
      	skip
      	
      EndDo
      
      sele realprop
      
      v5ac = v5ac + pac
      
			If a_value > 0  or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					round(A_Value*.4,0),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '6'
      mv6 = mv6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mv6c = mv6c + 1
      ma6 = ma6 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma6c = ma6c + 1
      EndIf
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      
      	If !pref and sub_type <> 'CUV'
      	
      		a6ac = a6ac + acres
      		aac  = aac + acres
      		
      	Else
      	
      		If sub_type <> 'CUV'
      	
	      		pac = pac + acres
	      		
	      	EndIf	
      			
      	EndIf
      	
      	skip
      	
      EndDo
      
      sele realprop
      
      
			If a_value > 0  or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					round(A_Value*.4,0),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mv9 = mv9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mv9c = mv9c + 1
      ma9 = ma9 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        ma9c = ma9c + 1
      EndIf
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      
      	If !pref and sub_type <> 'CUV'
      	
      		a9ac = a9ac + acres
      		aac  = aac + acres
      		
      	Else
      	
      		If sub_type <> 'CUV'
      	
	      		pac = pac + acres
	      		
	      	EndIf	
      			
      	EndIf
      	
      	skip
      	
      EndDo
      
      sele realprop
      
      v9ac = v9ac + pac
      
			If a_value > 0  or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					round(A_Value*.4,0),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
            
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigW

	Do Case
    Case DigStrat = '1'
      mw1 = mw1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mw1c = mw1c + iif(a_value>0, 1, 0)
      mp1 = mp1 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp1c = mp1c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 &&or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
       
    Case Digstrat = '2'
      mw2 = mw2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mw2c = mw2c + 1
      mp2 = mp2 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp2c = mp2c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mw3 = mw3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mw3c = mw3c + 1
      mp3 = mp3 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp3c = mp3c + 1
      EndIf
      w3ac = w3ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      mw4 = mw4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mw4c = mw4c + 1
      mp4 = mp4 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp4c = mp4c + 1
      EndIf
      w4ac = w4ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mw5 = mw5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mw5c = mw5c + 1
      mp5 = mp5 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp5c = mp5c + 1
      EndIf
      w5ac = w5ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mw6 = mw6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mw6c = mw6c + 1
      mp6 = mp6 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp6c = mp6c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mw9 = mw9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mw9c = mw9c + 1
      mp9 = mp9 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp9c = mp9c + 1
      EndIf
      w9ac = w9ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigT

	Do Case
    Case DigStrat = '1'
      mt1 = mt1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mt1c = mt1c + iif(a_value+p_value>0, 1, 0)
      
			If a_value > 0  &&or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mt2 = mt2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mt2c = mt2c + 1

			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mt3 = mt3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mt3c = mt3c + 1
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
      t3ac = t3ac + TotalAcres      
    Case Digstrat = '4'
      mt4 = mt4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mt4c = mt4c + 1
      t4ac = t4ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mt5 = mt5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mt5c = mt5c + 1
      t5ac = t5ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mt6 = mt6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mt6c = mt6c + 1
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mt9 = mt9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mt9c = mt9c + 1
      t9ac = t9ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      munkc = munkc + 1
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigP

	Do Case
    Case DigStrat = '1'
      mp1 = mp1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mp1c = mp1c + iif(p_value>0, 1,0)
      ma1 = ma1 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma1c = ma1c + 1
      EndIf
      
			If a_value > 0 &&or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
       
    Case Digstrat = '2'
      mp2 = mp2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mp2c = mp2c + 1
      ma2 = ma2 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma2c = ma2c + 1
      EndIf
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mp3 = mp3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mp3c = mp3c + 1
      ma3 = ma3 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma3c = ma3c + 1
      EndIf
      p3ac = p3ac + TotalAcres
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      	
      		p3ac = p3ac - acres
      		a3ac = a3ac + acres
      		aac = aac + acres
      		
      	EndIf
      	
      	If pref      	
      		pac = pac + acres
      	EndIf
      	
      	skip		
      EndDo
      
      sele realprop

			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),aac,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,;
	      					realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      mp4 = mp4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mp4c = mp4c + 1
      ma4 = ma4 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma4c = ma4c + 1
      EndIf
      p4ac = p4ac + TotalAcres  

      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      		p4ac = p4ac - acres
      		a4ac = a4ac + acres
      		aac  = aac + acres
      	EndIf
      	
      	If pref
      		pac = pac + acres	
      	EndIf
      	
      	skip		
      EndDo
      
      sele realprop

			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),aac,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,;
	      					realprop.taxdistric)
	    EndIf  					
          
    Case Digstrat = '5'
      mp5 = mp5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mp5c = mp5c + 1
      ma5 = ma5 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma5c = ma5c + 1
      EndIf
      p5ac = p5ac + TotalAcres      
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      		p5ac = p5ac - acres
      		a5ac = a5ac + acres
      		aac  = aac + acres
      	EndIf
      	
      	If pref
      		pac = pac + acres
      	EndIf
      		
      	skip		
      EndDo
      
      sele realprop
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),aac,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,;
	      					realprop.taxdistric)
	    EndIf  					
      
      
    Case Digstrat = '6'
      mp6 = mp6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mp6c = mp6c + 1
      ma6 = ma6 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma6c = ma6c + 1
      EndIf
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),;
	      					realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mp9 = mp9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(P_Value*.4,0))
      mp9c = mp9c + 1
      ma9 = ma9 + IIF(OvRideVal = 0,round(A_Value*.4,0),0)
      If OvRideVal = 0 .and. A_Value > 0
        ma9c = ma9c + 1
      EndIf
      p9ac = p9ac + TotalAcres  
      
      sele landsubs
      seek realprop.realkey
      
      pac = 0
      aac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      		p9ac = p9ac - acres
      		a9ac = a9ac + acres
      		aac  = aac + acres
      	EndIf
      	
      	If pref
      		pac = pac + acres
      	EndIf
      		
      	skip		
      EndDo
      
      sele realprop
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),aac,;
	      					realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),pac,;
	      					realprop.taxdistric)
	    EndIf  					
      
          
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0 or ovrideval > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigH

	Do Case
    Case DigStrat = '1'
      mh1 = mh1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mh1c = mh1c + iif(a_value+p_value > 0, 1, 0)
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	      					
    Case Digstrat = '2'
      mh2 = mh2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mh2c = mh2c + 1
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	      					
    Case Digstrat = '3'
      mh3 = mh3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mh3c = mh3c + 1
      h3ac = h3ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '4'
      mh4 = mh4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mh4c = mh4c + 1
      h4ac = h4ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '5'
      mh5 = mh5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mh5c = mh5c + 1
      h5ac = h5ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '6'
      mh6 = mh6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mh6c = mh6c + 1
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
      
    Case Digstrat = '9'
      mh9 = mh9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mh9c = mh9c + 1
      h9ac = h9ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return

*-----------------------------------------------------------------------------
FUNCTION MDigB

	Do Case
    Case DigStrat = '1'
      mb1 = mb1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mb1c = mb1c + iif(a_value + p_value > 0,1,0)
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
      
    Case Digstrat = '3'
      mb3 = mb3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mb3c = mb3c + 1
      b3ac = b3ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '4'
      mb4 = mb4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mb4c = mb4c + 1
      b4ac = b4ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '5'
      mb5 = mb5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mb5c = mb5c + 1
      b5ac = b5ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '6'
      mb6 = mb6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      mb6c = mb6c + 1
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
      
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
  
*-----------------------------------------------------------------------------
FUNCTION MDigE

	Do Case
    Case DigStrat = '0'
      me0 = me0 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me0c = me0c + 1
      e0ac = e0ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case DigStrat = '1'
      me1 = me1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me1c = me1c + 1
      e1ac = e1ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '2'
      me2 = me2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me2c = me2c + 1
      e2ac = e2ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '3'
      me3 = me3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me3c = me3c + 1
      e3ac = e3ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '4'
      me4 = me4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me4c = me4c + 1
      e4ac = e4ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '5'
      me5 = me5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me5c = me5c + 1
      e5ac = e5ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '6'
      me6 = me6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me6c = me6c + 1
      e6ac = e6ac + TotalAcres

			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '7'
      me7 = me7 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me7c = me7c + 1
      e7ac = e7ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '8'
      me8 = me8 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me8c = me8c + 1
      e8ac = e8ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '9'
      me9 = me9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0))
      me9c = me9c + 1
      e9ac = e9ac + TotalAcres
      
			cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round((A_Value+P_Value)*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MDigU

	Do Case
    Case DigStrat = '1'
      mu1 = mu1 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mu1c = mu1c + iif(a_value>0, 1, 0)
      mp1 = mp1 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp1c = mp1c + 1
      EndIf 
      
			If a_value > 0  or ovrideval > 0 &&or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mu2 = mu2 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mu2c = mu2c + 1
      mp2 = mp2 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp2c = mp2c + 1
      EndIf
			u2ac = u2ac + TotalAcres 
			
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
			     
    Case Digstrat = '3'
      mu3 = mu3 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mu3c = mu3c + 1
      mp3 = mp3 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp3c = mp3c + 1
      EndIf
      u3ac = u3ac + TotalAcres 
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    Case Digstrat = '4'
      mu4 = mu4 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mu4c = mu4c + 1
      mp4 = mp4 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp4c = mp4c + 1
      EndIf
      u4ac = u4ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mu5 = mu5 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mu5c = mu5c + 1
      mp5 = mp5 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp5c = mp5c + 1
      EndIf
      u5ac = u5ac + TotalAcres
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mu6 = mu6 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mu6c = mu6c + 1
      mp6 = mp6 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp6c = mp6c + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mu9 = mu9 + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      mu9c = mu9c + 1
      mp9 = mp9 + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        mp9c = mp9c + 1
      EndIf
      u9ac = u9ac + TotalAcres 
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    OtherWise
      munk = munk + IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0))
      munkc = munkc + 1
      munk = munk + IIF(OvRideVal = 0,round(P_Value*.4,0),0)
      If OvRideVal = 0 .and. P_Value > 0
        munkc = munkc + 1
      EndIf
      
			If a_value > 0  or ovrideval > 0 or ovrideval + a_value + p_value = 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(A_Value*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If p_value > 0
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
  
*-----------------------------------------------------------------------------
FUNCTION MDigJ

	dsx = digstrat
	dcx = digstrat + 'c'
	dax = digstrat + 'ac'
	
*!*		mj&dsx = mj&dsx + round(iif(sale_val, saleland2, P_Value)*.4,0)
*!*		mj&dcx = mj&dcx + 1
*!*		j&dax  = j&dax + TotalAcres
	
	sele f
	use flpamain
	set order to realkey
	
	seek realprop.realkey
	
	If found()
	
		mf&dsx = mf&dsx + round(currflpa * .4,0)
		
		sele realprop
		
		f&dax  = f&dax + flpamain.covacres
		mf&dcx = mf&dcx + 1

		If flpamain.currflpa > 0 
	    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'F',realprop.digstrat,;
	    					round(flpamain.currflpa * .4,0),alias(),flpamain.covacres,realprop.taxdistric)
	  EndIf  					


	EndIf
	
	sele realprop

	mj&dsx = mj&dsx + round(P_Value*.4,0)
	mj&dcx = mj&dcx + 1
	j&dax  = j&dax + flpamain.covacres
	

	Do Case
	
*!*	  	Case sale_val 

*!*		    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
*!*		    					round(saleland1*.4,0),alias(),realprop.totalacres - flpamain.covacres,realprop.taxdistric)
	
		Case (a_value > 0 and ovrideval = 0)  or ovrideval + a_value + p_value = 0
		
		
	    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	    					round(A_Value*.4,0),alias(),realprop.totalacres - flpamain.covacres,;
	    					realprop.taxdistric)
	    					
	    Do Case
	    
	    	Case digstrat = '3'
	    		
	    		ma3  = ma3 + round(A_Value*.4,0)
	    		a3ac = a3ac + realprop.totalacres - flpamain.covacres
	    		ma3c = ma3c + 1
	    		
	    	Case digstrat = '4'
	    		
	    		ma4  = ma4 + round(A_Value*.4,0)
	    		a4ac = a4ac + realprop.totalacres - flpamain.covacres
	    		ma4c = ma4c + 1
	    		
	    	Case digstrat = '5'
	    		
	    		ma5  = ma5 + round(A_Value*.4,0)
	    		a5ac = a5ac + realprop.totalacres - flpamain.covacres
	    		ma5c = ma5c + 1

	    	Case digstrat = '2'
	    		
	    		ma2  = ma2 + round(A_Value*.4,0)
	    		a2ac = a2ac + realprop.totalacres - flpamain.covacres
	    		ma2c = ma2c + 1

	    EndCase	
	    				
  EndCase
  
  Do Case  					
  
*!*	  	Case sale_val and saleland2 > 0

*!*		    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'J',realprop.digstrat,;
*!*		    					round(saleland2*.4,0),alias(),flpamain.covacres,realprop.taxdistric)
  	      
		Case p_value > 0 or ovrideval > 0

	    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'J',realprop.digstrat,;
    					IIF(OvRideVal > 0,round(OvRideVal*.4,0),round(p_Value*.4,0)),alias(),flpamain.covacres,realprop.taxdistric)
  EndCase 					
	
		
	return	
	
  
*-----------------------------------------------------------------------------
FUNCTION AddComm()

	local Pn 
	
	Pn = space(14)

	sele A
	sele D
	Use CommImp


	Do While .not. Eof() .and. Key <> 27
	
		@10, 0 clear to 10,40
		
		@10,20 say 'Consolidating Comm Imps'
		@12,20 say recno()
		
	  Key  = InKey()
	  linc = .f.
	  
	  sele realprop
	  seek commimp.realkey
	  
	  If income and !sale_val
	  	linc = .t.
	  EndIf	

		lfr = .f.
		
	  If found()
	  	lfr = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf

			
  
	  	sele commimp

	  	If linc
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	

	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	
	  
	  If !lfr
	  	sele commimp
	  	skip
	  	If eof()
	  		exit
	  	Else
	  		loop
	  	EndIf
	  Else
	  	sele commimp
	  EndIf	

	  If digclass < 'A' or digclass > 'W'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,digstrat,;
      					iif(realprop.sale_val,round((sb346val+sb346add)*.4,0),round(iif(comimpovr>0,comimpovr,bldg_val)*.4,0)),;
      					alias(),0,;
      					realprop.taxdistric)
      					
      munk = munk + 1
      					
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf

	  	
	  EndIf


	  If digstrat < '0' or digstrat > '9'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,digstrat,;
      					iif(realprop.sale_val,round((sb346val+sb346add)*.4,0),round(iif(comimpovr>0,comimpovr,bldg_val)*.4,0)),;
      					alias(),0,;
      					realprop.taxdistric)
      					
      munk = munk + 1
      					
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf

		  
		  
	  EndIf

	  
	  If realprop.sale_val and realkey = realprop.realkey and realkey > 0 
			
			nval1 = ' '
			ncnt1 = ' '
			nacr1 = ' '
  		
			nval1 = 'm' + digclass + digstrat
			ncnt1 = 'm' + digclass + digstrat + 'c'
			
			&nval1 = &nval1 + round((sb346val + sb346add)*.4,0)
			&ncnt1 = &ncnt1 + 1
	  
      cons_value(realprop.realkey,realprop.parcel_no,0,commkey,0,0,commimp.digclass,commimp.digstrat,;
      					round((sb346val + sb346add)*.4,0),alias(),0,realprop.taxdistric)

			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf		
	  
	  EndIf			
	  			

	  Do Case
*!*		  	Case a->Spdist
*!*		  		skip
*!*		  		If eof()
*!*		  			skip
*!*		  		EndIf	
		  Case DigClass = 'A' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      ma1 = ma1 + ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      ma1c = ma1c + 1
			    Case Digstrat = '2'
			      ma2 = ma2 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      ma2c = ma2c + 1
			    Case Digstrat = '3'
			      ma3 = ma3 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      ma3c = ma3c + 1
			    Case Digstrat = '4'
			      ma4 = ma4 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      ma4c = ma4c + 1
			    Case Digstrat = '5'
			      ma5 = ma5 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      ma5c = ma5c + 1
			    Case Digstrat = '6'
			      ma6 = ma6 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      ma6c = ma6c + 1
			    Case Digstrat = '9'
			      ma9 = ma9 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      ma9c = ma9c + 1
			    OtherWise
			      munk = munk +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
	  	Case DigClass = 'R' .and. RealKey = a->RealKey
	  		Do Case
			    Case DigStrat = '1'
			      mr1 = mr1 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mr1c = mr1c + 1
			    Case Digstrat = '2'
			      mr2 = mr2 +  ;
			      iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mr2c = mr2c + 1
			    Case Digstrat = '3'
			      mr3 = mr3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mr3c = mr3c + 1
			    Case Digstrat = '4'
			      mr4 = mr4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mr4c = mr4c + 1
			    Case Digstrat = '5'
			      mr5 = mr5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mr5c = mr5c + 1
			    Case Digstrat = '6'
			      mr6 = mr6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mr6c = mr6c + 1
			    Case Digstrat = '9'
			      mr9 = mr9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mr9c = mr9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'C' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mc1 = mc1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mc1c = mc1c + 1
			      
*!*				      sele commcnt
*!*				      append blank
*!*				      replace realkey with commimp.realkey,;
*!*				      				commkey with commimp.commkey
*!*				      sele commimp
			      				
			    Case Digstrat = '2'
			      mc2 = mc2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mc2c = mc2c + 1
			    Case Digstrat = '3'
			      mc3 = mc3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mc3c = mc3c + 1
			    Case Digstrat = '4'
			      mc4 = mc4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mc4c = mc4c + 1
			    Case Digstrat = '5'
			      mc5 = mc5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mc5c = mc5c + 1
			    Case Digstrat = '6'
			      mc6 = mc6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mc6c = mc6c + 1
			    Case Digstrat = '9'
			      mc9 = mc9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mc9c = mc9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'I' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mi1 = mi1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mi1c = mi1c + 1
			    Case Digstrat = '2'
			      mi2 = mi2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mi2c = mi2c + 1
			    Case Digstrat = '3'
			      mi3 = mi3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mi3c = mi3c + 1
			    Case Digstrat = '4'
			      mi4 = mi4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mi4c = mi4c + 1
			    Case Digstrat = '5'
			      mi5 = mi5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mi5c = mi5c + 1
			    Case Digstrat = '6'
			      mi6 = mi6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mi6c = mi6c + 1
			    Case Digstrat = '9'
			      mi9 = mi9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mi9c = mi9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'V' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mv1 = mv1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mv1c = mv1c + 1
			    Case Digstrat = '2'
			      mv2 = mv2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mv2c = mv2c + 1
			    Case Digstrat = '3'
			      mv3 = mv3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mv3c = mv3c + 1
			    Case Digstrat = '4'
			      mv4 = mv4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mv4c = mv4c + 1
			    Case Digstrat = '5'
			      mv5 = mv5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mv5c = mv5c + 1
			    Case Digstrat = '6'
			      mv6 = mv6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mv6c = mv6c + 1
			    Case Digstrat = '9'
			      mv9 = mv9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mv9c = mv9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'W' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mw1 = mw1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mw1c = mw1c + 1
			    Case Digstrat = '2'
			      mw2 = mw2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mw2c = mw2c + 1
			    Case Digstrat = '3'
			      mw3 = mw3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mw3c = mw3c + 1
			    Case Digstrat = '4'
			      mw4 = mw4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mw4c = mw4c + 1
			    Case Digstrat = '5'
			      mw5 = mw5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mw5c = mw5c + 1
			    Case Digstrat = '6'
			      mw6 = mw6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mw6c = mw6c + 1
			    Case Digstrat = '9'
			      mw9 = mw9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mw9c = mw9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'T' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mt1 = mt1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mt1c = mt1c + 1
			    Case Digstrat = '2'
			      mt2 = mt2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mt2c = mt2c + 1
			    Case Digstrat = '3'
			      mt3 = mt3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mt3c = mt3c + 1
			    Case Digstrat = '4'
			      mt4 = mt4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mt4c = mt4c + 1
			    Case Digstrat = '5'
			      mt5 = mt5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mt5c = mt5c + 1
			    Case Digstrat = '6'
			      mt6 = mt6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mt6c = mt6c + 1
			    Case Digstrat = '9'
			      mt9 = mt9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mt9c = mt9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'P' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mp1 = mp1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mp1c = mp1c + 1
			    Case Digstrat = '2'
			      mp2 = mp2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mp2c = mp2c + 1
			    Case Digstrat = '3'
			      mp3 = mp3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mp3c = mp3c + 1
			    Case Digstrat = '4'
			      mp4 = mp4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mp4c = mp4c + 1
			    Case Digstrat = '5'
			      mp5 = mp5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mp5c = mp5c + 1
			    Case Digstrat = '6'
			      mp6 = mp6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mp6c = mp6c + 1
			    Case Digstrat = '9'
			      mp9 = mp9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mp9c = mp9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
	  	Case DigClass = 'H' .and. RealKey = a->RealKey
	  		Do Case
			    Case DigStrat = '1'
			      mh1 = mh1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mh1c = mh1c + 1
			    Case Digstrat = '2'
			      mh2 = mh2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mh2c = mh2c + 1
			    Case Digstrat = '3'
			      mh3 = mh3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mh3c = mh3c + 1
			    Case Digstrat = '4'
			      mh4 = mh4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mh4c = mh4c + 1
			    Case Digstrat = '5'
			      mh5 = mh5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mh5c = mh5c + 1
			    Case Digstrat = '6'
			      mh6 = mh6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mh6c = mh6c + 1
			    Case Digstrat = '9'
			      mh9 = mh9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mh9c = mh9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
	    Case DigClass = 'E' .and. RealKey = a->RealKey
	    	Do Case
			    Case DigStrat = '0'
			      me0 = me0 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me0c = me0c + 1
			    Case DigStrat = '1'
			      me1 = me1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me1c = me1c + 1
			    Case Digstrat = '2'
			      me2 = me2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me2c = me2c + 1
			    Case Digstrat = '3'
			      me3 = me3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me3c = me3c + 1
			    Case Digstrat = '4'
			      me4 = me4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me4c = me4c + 1
			    Case Digstrat = '5'
			      me5 = me5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me5c = me5c + 1
			    Case Digstrat = '6'
			      me6 = me6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me6c = me6c + 1
			    Case Digstrat = '7'
			      me7 = me7 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me7c = me7c + 1
			    Case Digstrat = '8'
			      me8 = me8 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me8c = me8c + 1
			    Case Digstrat = '9'
			      me9 = me9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      me9c = me9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'U' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mu1 = mu1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mu1c = mu1c + 1
			    Case Digstrat = '2'
			      mu2 = mu2 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mu2c = mu2c + 1
			    Case Digstrat = '3'
			      mu3 = mu3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mu3c = mu3c + 1
			    Case Digstrat = '4'
			      mu4 = mu4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mu4c = mu4c + 1
			    Case Digstrat = '5'
			      mu5 = mu5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mu5c = mu5c + 1
			    Case Digstrat = '6'
			      mu6 = mu6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mu6c = mu6c + 1
			    Case Digstrat = '9'
			      mu9 = mu9 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mu9c = mu9c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase
**B
		  Case DigClass = 'B' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mb1 = mb1 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mb1c = mb1c + 1
			    Case Digstrat = '3'
			      mb3 = mb3 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mb3c = mb3c + 1
			    Case Digstrat = '4'
			      mb4 = mb4 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mb4c = mb4c + 1
			    Case Digstrat = '5'
			      mb5 = mb5 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mb5c = mb5c + 1
			    Case Digstrat = '6'
			      mb6 = mb6 + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      mb6c = mb6c + 1
			    OtherWise
			      munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
			      munkc = munkc + 1
				EndCase


	  	OtherWise
		    munk = munk + iif(Comimpovr=0,round(Bldg_Val*.4,0),round(Comimpovr*.4,0))
		    munkc = munkc + 1
	  EndCase
	  
    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,commkey,digclass,digstrat,;
    					iif(comimpovr > 0,round(comimpovr*.4,0),round(bldg_val*.4,0)),alias(),0,realprop.taxdistric)
	  
	  skip
*!*		  TBar()
	EndDo
	return
	

*-----------------------------------------------------------------------------
FUNCTION ConsRep

	Do While .not. Eof() .and. Key <> 27
	
		@10,0 clear to 10,40
		@10,20 say 'Consolidating Res Imp Values'
		@12,20 say recno()
		
	  Key = InKey()
	  
	  sele realprop
	  seek reprop.realkey
	  
	  lfr = .f.

	  If found()
	  	lfr  = .t.
			ltd  = .f.
			linc = .f.
			
			If income and !sale_val
				linc = .t.
			EndIf	
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele reprop

	  	If linc 
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf
		  
		Else
		
			sele reprop
			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf	
		  
	  EndIf	


	  	
  	If !ltd
	  	skip
	  	If !eof()
  			loop
  		Else
  			exit
	  	EndIf		
	  EndIf	
	 
	  
	  If !lfr
	  	sele reprop
	  	skip
	  	If eof()
	  		exit
	  	Else
	  		loop
	  	EndIf
	  Else
	  	sele reprop
	  EndIf	


	  If digclass < 'A' or digclass > 'W'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,digstrat,;
      					iif(realprop.sale_val,round((sb346val+sb346add)*.4,0),round(iif(ovr_val>0,ovr_val,timp_val)*.4,0)),;
      					alias(),0,;
      					realprop.taxdistric)
      					
      munk = munk + 1
      					
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf

	  	
	  EndIf


	  If digstrat < '0' or digstrat > '9'

      cons_value(realprop.realkey,alltrim(realprop.parcel_no) + '-IC',0,0,0,0,digclass,digstrat,;
      					iif(realprop.sale_val,round((sb346val+sb346add)*.4,0),round(iif(ovr_val>0,ovr_val,timp_val)*.4,0)),;
      					alias(),0,;
      					realprop.taxdistric)
      					
      munk = munk + 1
      					
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf

		  
		  
	  EndIf

	  If a.sale_val and realkey = a.realkey
			
			nval1 = ' '
			ncnt1 = ' '
			nacr1 = ' '
  		
			nval1 = 'm' + digclass + digstrat
			ncnt1 = 'm' + digclass + digstrat + 'c'
			
			&nval1 = &nval1 + round((sb346val + sb346add)*.4,0)
			&ncnt1 = &ncnt1 + 1
	  
	    cons_value(realprop.realkey,realprop.parcel_no,0,0,repropkey,0,digclass,digstrat,;
	    					round((sb346val + sb346add)*.4,0),alias(),0,realprop.taxdistric)

			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf		
	  
	  EndIf			
	  
	  Do Case
*!*		  	Case a->Spdist
*!*		  		skip
*!*		  		loop
*!*		  		If eof()
*!*		  			exit
*!*		  		EndIf	
	  	Case DigClass = 'A' .and. RealKey = a->RealKey
	  		Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      ma1 = ma1 + round(Timp_Val*.4,0)
				    Else
				      ma1 = ma1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      ma1c = ma1c + 1
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      ma2 = ma2 + round(Timp_Val*.4,0)
				    Else
				      ma2 = ma2 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      ma2c = ma2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      ma3 = ma3 + round(Timp_Val*.4,0)
				    Else
				      ma3 = ma3 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      ma3c = ma3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      ma4 = ma4 + round(Timp_Val*.4,0)
				    Else
				      ma4 = ma4 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      ma4c = ma4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      ma5 = ma5 + round(Timp_Val*.4,0)
				    Else
				      ma5 = ma5 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      ma5c = ma5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      ma6 = ma6 + round(Timp_Val*.4,0)
				    Else
				      ma6 = ma6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      ma6c = ma6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      ma9 = ma9 + round(Timp_Val*.4,0)
				    Else
				      ma9 = ma9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      ma9c = ma9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'R' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mr1 = mr1 + round(Timp_Val*.4,0)
				    Else
				      mr1 = mr1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mr1c = mr1c + 1
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      mr2 = mr2 + round(Timp_Val*.4,0)
				    Else
				      mr2 = mr2 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mr2c = mr2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      mr3 = mr3 + round(Timp_Val*.4,0)
				    Else
				      mr3 = mr3 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mr3c = mr3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      mr4 = mr4 + round(Timp_Val*.4,0)
				    Else
				      mr4 = mr4 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mr4c = mr4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      mr5 = mr5 + round(Timp_Val*.4,0)
				    Else
				      mr5 = mr5 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mr5c = mr5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mr6 = mr6 + round(Timp_Val*.4,0)
				    Else
				      mr6 = mr6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mr6c = mr6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mr9 = mr9 + round(Timp_Val*.4,0)
				    Else
				      mr9 = mr9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mr9c = mr9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
	 	  Case DigClass = 'C' .and. RealKey = a->RealKey
	 	  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mc1 = mc1 + round(Timp_Val*.4,0)
				    Else
				      mc1 = mc1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mc1c = mc1c + 1
			      
*!*				      sele commcnt
*!*				      append blank
*!*				      replace realkey with reprop.realkey,;
*!*				      				repropkey with reprop.repropkey
*!*				      sele reprop
			      				
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      mc2 = mc2 + round(Timp_Val*.4,0)
				    Else
				      mc2 = mc2 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mc2c = mc2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      mc3 = mc3 + round(Timp_Val*.4,0)
				    Else
				      mc3 = mc3 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mc3c = mc3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      mc4 = mc4 + round(Timp_Val*.4,0)
				    Else
				      mc4 = mc4 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mc4c = mc4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      mc5 = mc5 + round(Timp_Val*.4,0)
				    Else
				      mc5 = mc5 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mc5c = mc5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mc6 = mc6 + round(Timp_Val*.4,0)
				    Else
				      mc6 = mc6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mc6c = mc6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mc9 = mc9 + round(Timp_Val*.4,0)
				    Else
				      mc9 = mc9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mc9c = mc9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'H' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mh1 = mh1 + round(Timp_Val*.4,0)
				    Else
				      mh1 = mh1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mh1c = mh1c + 1
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      mh2 = mh2 + round(Timp_Val*.4,0)
				    Else
				      mh2 = mh2 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mh2c = mh2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      mh3 = mh3 + round(Timp_Val*.4,0)
				    Else
				      mh3 = mh3 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mh3c = mh3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      mh4 = mh4 + round(Timp_Val*.4,0)
				    Else
				      mh4 = mh4 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mh4c = mh4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      mh5 = mh5 + round(Timp_Val*.4,0)
				    Else
				      mh5 = mh5 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mh5c = mh5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mh6 = mh6 + round(Timp_Val*.4,0)
				    Else
				      mh6 = mh6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mh6c = mh6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mh9 = mh9 + round(Timp_Val*.4,0)
				    Else
				      mh9 = mh9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mh9c = mh9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'I' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mi1 = mi1 + round(Timp_Val*.4,0)
				    Else
				      mi1 = mi1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mi1c = mi1c + 1
*!*				    Case Digstrat = '2'
*!*				      mi2 = mi2 + round(Timp_Val*.4,0)
*!*				      mi2c = mi2c + 1
*!*				    Case Digstrat = '3'
*!*				      mi3 = mi3 + round(Timp_Val*.4,0)
*!*				      mi3c = mi3c + 1
*!*				    Case Digstrat = '4'
*!*				      mi4 = mi4 + round(Timp_Val*.4,0)
*!*				      mi4c = mi4c + 1
*!*				    Case Digstrat = '5'
*!*				      mi5 = mi5 + round(Timp_Val*.4,0)
*!*				      mi5c = mi5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mi6 = mi6 + round(Timp_Val*.4,0)
				    Else
				      mi6 = mi6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mi6c = mi6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mi9 = mi9 + round(Timp_Val*.4,0)
				    Else
				      mi9 = mi9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mi9c = mi9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'V' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mv1 = mv1 + round(Timp_Val*.4,0)
				    Else
				      mv1 = mv1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mv1c = mv1c + 1
*!*				    Case Digstrat = '2'
*!*				      mv2 = mv2 + round(Timp_Val*.4,0)
*!*				      mv2c = mv2c + 1
*!*				    Case Digstrat = '3'
*!*				      mv3 = mv3 + round(Timp_Val*.4,0)
*!*				      mv3c = mv3c + 1
*!*				    Case Digstrat = '4'
*!*				      mv4 = mv4 + round(Timp_Val*.4,0)
*!*				      mv4c = mv4c + 1
*!*				    Case Digstrat = '5'
*!*				      mv5 = mv5 + round(Timp_Val*.4,0)
*!*				      mv5c = mv5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mv6 = mv6 + round(Timp_Val*.4,0)
				    Else
				      mv6 = mv6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mv6c = mv6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mv9 = mv9 + round(Timp_Val*.4,0)
				    Else
				      mv9 = mv9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mv9c = mv9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'W' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mw1 = mw1 + round(Timp_Val*.4,0)
				    Else
				      mw1 = mw1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mw1c = mw1c + 1
*!*				    Case Digstrat = '2'
*!*				      mw2 = mw2 + round(Timp_Val*.4,0)
*!*				      mw2c = mw2c + 1
*!*				    Case Digstrat = '3'
*!*				      mw3 = mw3 + round(Timp_Val*.4,0)
*!*				      mw3c = mw3c + 1
*!*				    Case Digstrat = '4'
*!*				      mw4 = mw4 + round(Timp_Val*.4,0)
*!*				      mw4c = mw4c + 1
*!*				    Case Digstrat = '5'
*!*				      mw5 = mw5 + round(Timp_Val*.4,0)
*!*				      mw5c = mw5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mw6 = mw6 + round(Timp_Val*.4,0)
				    Else
				      mw6 = mw6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mw6c = mw6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mw9 = mw9 + round(Timp_Val*.4,0)
				    Else
				      mw9 = mw9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mw9c = mw9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'T' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mt1 = mt1 + round(Timp_Val*.4,0)
				    Else
				      mt1 = mt1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mt1c = mt1c + 1
*!*				    Case Digstrat = '2'
*!*				      mt2 = mt2 + round(Timp_Val*.4,0)
*!*				      mt2c = mt2c + 1
*!*				    Case Digstrat = '3'
*!*				      mt3 = mt3 + round(Timp_Val*.4,0)
*!*				      mt3c = mt3c + 1
*!*				    Case Digstrat = '4'
*!*				      mt4 = mt4 + round(Timp_Val*.4,0)
*!*				      mt4c = mt4c + 1
*!*				    Case Digstrat = '5'
*!*				      mt5 = mt5 + round(Timp_Val*.4,0)
*!*				      mt5c = mt5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mt6 = mt6 + round(Timp_Val*.4,0)
				    Else
				      mt6 = mt6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mt6c = mt6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mt9 = mt9 + round(Timp_Val*.4,0)
				    Else
				      mt9 = mt9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mt9c = mt9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'P' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mp1 = mp1 + round(Timp_Val*.4,0)
				    Else
				      mp1 = mp1 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mp1c = mp1c + 1
*!*				    Case Digstrat = '2'
*!*				      mp2 = mp2 + round(Timp_Val*.4,0)
*!*				      mp2c = mp2c + 1
*!*				    Case Digstrat = '3'
*!*				      mp3 = mp3 + round(Timp_Val*.4,0)
*!*				      mp3c = mp3c + 1
*!*				    Case Digstrat = '4'
*!*				      mp4 = mp4 + round(Timp_Val*.4,0)
*!*				      mp4c = mp4c + 1
*!*				    Case Digstrat = '5'
*!*				      mp5 = mp5 + round(Timp_Val*.4,0)
*!*				      mp5c = mp5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mp6 = mp6 + round(Timp_Val*.4,0)
				    Else
				      mp6 = mp6 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mp6c = mp6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mp9 = mp9 + round(Timp_Val*.4,0)
				    Else
				      mp9 = mp9 + round(Ovr_Val*.4,0)
				    EndIf  				      
			      mp9c = mp9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'E' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '0'
			      me0 = me0 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me0c = me0c + 1
			    Case DigStrat = '1'
			      me1 = me1 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me1c = me1c + 1
			    Case Digstrat = '2'
			      me2 = me2 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me2c = me2c + 1
			    Case Digstrat = '3'
			      me3 = me3 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me3c = me3c + 1
			    Case Digstrat = '4'
			      me4 = me4 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me4c = me4c + 1
			    Case Digstrat = '5'
			      me5 = me5 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me5c = me5c + 1
			    Case Digstrat = '6'
			      me6 = me6 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me6c = me6c + 1
			    Case Digstrat = '7'
			      me7 = me7 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me7c = me7c + 1
			    Case Digstrat = '8'
			      me8 = me8 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me8c = me8c + 1
			    Case Digstrat = '9'
			      me9 = me9 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      me9c = me9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'U' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mu1 = mu1 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mu1c = mu1c + 1
		    	Case Digstrat = '2'
		      	mu2 = mu2 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mu2c = mu2c + 1
			    Case Digstrat = '3'
			      mu3 = mu3 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mu3c = mu3c + 1
			    Case Digstrat = '4'
			      mu4 = mu4 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mu4c = mu4c + 1
			    Case Digstrat = '5'
			      mu5 = mu5 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mu5c = mu5c + 1
			    Case Digstrat = '6'
			      mu6 = mu6 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mu6c = mu6c + 1
			    Case Digstrat = '9'
			      mu9 = mu9 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mu9c = mu9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase
**b
		  Case DigClass = 'B' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mb1 = mb1 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mb1c = mb1c + 1
			    Case Digstrat = '3'
			      mb3 = mb3 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mb3c = mb3c + 1
			    Case Digstrat = '4'
			      mb4 = mb4 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mb4c = mb4c + 1
			    Case Digstrat = '5'
			      mb5 = mb5 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mb5c = mb5c + 1
			    Case Digstrat = '6'
			      mb6 = mb6 + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      mb6c = mb6c + 1
			    OtherWise
			      munk  = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
			      munkc = munkc + 1
				EndCase


	    OtherWise
		    munk = munk + iif(Ovr_val=0,round(Timp_Val*.4,0),round(Ovr_Val*.4,0))
	  	  munkc = munkc + 1
	  EndCase
	  
    cons_value(realprop.realkey,realprop.parcel_no,0,0,repropkey,0,digclass,digstrat,;
    					iif(Ovr_Val > 0,round(Ovr_Val*.4,0),round(Timp_Val*.4,0)),alias(),0,realprop.taxdistric)
	  
	  skip
*!*		  TBar()
	EndDo
*-----------------------------------------------------------------------------
FUNCTION Summit

	use defaults
	
	GrCnt = mr1c+mr3c+mr4c+mr5c+mr6c+mr9c+ranum+rbnum+rfnum+rinum+rznum+;
	mt1c+mt3c+mt4c+;
	mh1c+mh3c+;
	ma1c+ma3c+ma4c+ma5c+ma6c+ma9c+aanum+abnum+afnum+ainum+aznum+;
	mp3c+mp4c+mp5c+mp6c+mp9c+;
	mv3c+mv4c+mv5c+mv6c+;
	mw3c+mw4c+mw5c+;
	mc1c+mc3c+mc4c+mc5c+mc9c+canum+cbnum+cfnum+cinum+cznum+cpnum+;
	mi1c+mi3c+mi4c+mi5c+mi9c+ianum+ibnum+ifnum+iinum+iznum+ipnum+;
	mu1c+mu2c+mu3c+mu4c+mu5c+mu6c+mu9c+uanum+ubnum+ufnum+uinum+uznum+;
	mvc+mhc+tic+hdc+mb1c+mb3c+mb4c+mb5c+mb6c+;
	mj1c+mj3c+mj4c+mj5c+mj9c

	GrAc = r3ac+r4ac+r5ac+r9ac+;
	t3ac+t4ac+;
	h3ac+;
	a3ac+a4ac+a5ac+a9ac+;
	p3ac+p4ac+p5ac+;
	v3ac+v4ac+v5ac+;
	w3ac+w4ac+w5ac+;
	c3ac+c4ac+c5ac+c9ac+;
	i3ac+i4ac+i5ac+i9ac+;
	u3ac+u4ac+u5ac+u9ac+u2ac+b3ac+b4ac+b5ac+;
	j3ac+j4ac+j5ac+j9ac


	***bond exemptions
	BnExCnt = s5count+FreeNum+Pref1ct+Pref2ct+SpNum+histcnt+TranCnt+CuCnt+sscount+sycount

	BnExVal =s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
	histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+ss+((SwFMV1+SwFMV2+SwACC)-SwTOT) + ;
	((SjFMV1+SjFMV2)-SjTOT)+sy

*no EZ (sx) on bonds

	***m&0 exemptions

	MoExCnt = s5count+FreeNum+Pref1ct+Pref2ct+SpNum+histcnt+TranCnt+CuCnt+;
	s1count+s3count+s4count+l4count+s6count+s8count+s9count;
	+sbcount+sccount+sdcount+secount+sgcount+swcnt+sscount+sjcnt+sycount+sxcount  &&removed l3count
	

	If at('lowndes',lower(defaults.coname)) > 0
		MoExCnt = MoExCnt + L1Count
	EndIf	

	StExVal = s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
	histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+s1+s3+s465+l3c+l4c+ss+;
	s6+s8+s9+sb+sg+se65+sd65 +((SwFMV1+SwFMV2+SwACC)-SwTOT)+sc65+;
	((SjFMV1+SjFMV2)-SjTOT)+sy+sx
	
	
	MoExVal = s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
	histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+s1+s3+s4+l3c+l4c+ss+;
	s6+s8+s9+sb+sg+se+sd +((SwFMV1+SwFMV2+SwACC)-SwTOT)+scc+((SjFMV1+SjFMV2)-SjTOT)+sy &&+sx no EZ exemption unless it is a joing city-county resolution
*!*		s5a

	If at('lowndes',lower(defaults.coname)) > 0
		MoExVal = MoExVal + L1s
	EndIf	

	If at('mcintosh',lower(defaults.coname)) > 0
		MoExVal = MoExVal + f4c + f5c + f1c + f3c
	EndIf	
	


	ShExVal = s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
	histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+s1+s3s+s4s+l3s+l4s+ss + s6s +;
	s8s + s9s + sb + ((SwFMV1+SwFMV2+SwACC)-SwTOT) + scc + sd + sg + se + ((SjFMV1+SjFMV2)-SjTOT)+sy

	If at('lowndes',lower(defaults.coname)) > 0
		ShExVal = ShExVal + L1s
	EndIf		

	If at('mcintosh',lower(defaults.coname)) > 0
		ShExVal = ShExVal + f4s + f5s + f3s + f1s
	EndIf		


	GrVal = mr1+mr3+mr4+mr5+mr6+mr9+ratot+rbtot+rftot+ritot+rztot+;
	mt1+mt3+mt4+;
	mh1+mh3+;
	ma1+ma3+ma4+ma5+ma6+ma9+aatot+abtot+aftot+aitot+aztot+;
	mp3+mp4+mp5+mp6+mp9+;
	mv3+mv4+mv5+mv6+;
	mw3+mw4+mw5+;
	mc1+mc3+mc4+mc5+mc9+catot+cbtot+cftot+citot+cztot+cptot+;
	mi1+mi3+mi4+mi5+mi9+iatot+ibtot+iftot+iitot+iztot+iptot+;
	mu1+mu2+mu3+mu4+mu5+mu6+mu9+uatot+ubtot+uftot+uitot+uztot+;
	mv+mh+ti+hd+mb1+mb3+mb4+mb5+mb6+;
	mj1+mj3+mj4+mj5+mj9

	close databases
	
	return

*-------------------------------------------------------------------------
FUNCTION cons_value(rk,pn,pk,ak,res,ck,dc,ds,v4,fn,ac,td)

	sele cons_value
	append blank
	
	replace realkey with rk,;
					parcel_no with pn,;
					perskey with pk,;
					acckey with ak,;
					repropkey with res,;
					commkey with ck,;
					digclass with dc,;
					digstrat with ds,;
					value40 with v4,;
					acres with ac,;
					taxdistric with td
					
*!*						exmptstate with est,;
*!*						exmptco with eco,;
*!*						exmptsch with esc
						
	sele &fn
	return

*-------------------------------------------------------
FUNCTION mavcons

	close all

	If file('cons_value_mav.dbf')
		erase cons_value_mav.dbf
	EndIf	

	If !file('cons_value_mav.dbf')

		create table cons_temps(realkey n(10),;
														parcel_no c(20),;
														perskey n(10),;
														acckey n(10),;
														repropkey n(10),;
														commkey n(10),;
														digclass c(1),;
														digstrat c(1),;
														value40 n(10),;
														acres n(8,2),;
														taxdistric c(2))

		use cons_temps
		copy to cons_value_mav fox2x
		
	Else

		use cons_value_mav excl
		zap
		
	EndIf

	close all													
														
												 
	MavTdWide()
	
	return
*-----------------------------------------------------------------------------
FUNCTION MavTdWide

  munk = 0
  munkc = 0
  ip = 0
  key = 0
  howmany = 0
  np = 0
  percom = 0
  numdone = 0
  mr1 = 0
  mr2 = 0
  mr3 = 0
  mr4 = 0
  mr5 = 0
  mr6 = 0
  mr9 = 0
  mr1c = 0
  mr2c = 0
  mr3c = 0
  mr4c = 0
  mr5c = 0
  mr6c = 0
  mr9c = 0
  ma1 = 0
  ma2 = 0
  ma3 = 0
  ma4 = 0
  ma5 = 0
  ma6 = 0
  ma9 = 0
  ma1c = 0
  ma2c = 0
  ma3c = 0
  ma4c = 0
  ma5c = 0
  ma6c = 0
  ma9c = 0
  mc1 = 0
  mc2 = 0
  mc3 = 0
  mc4 = 0
  mc5 = 0
  mc6 = 0
  mc9 = 0
  mc1c = 0
  mc2c = 0
  mc3c = 0
  mc4c = 0
  mc5c = 0
  mc6c = 0
  mc9c = 0
  mi1 = 0
  mi2 = 0
  mi3 = 0
  mi4 = 0
  mi5 = 0
  mi6 = 0
  mi9 = 0
  mi1c = 0
  mi2c = 0
  mi3c = 0
  mi4c = 0
  mi5c = 0
  mi6c = 0
  mi9c = 0
  mv1 = 0
  mv2 = 0
  mv3 = 0
  mv4 = 0
  mv5 = 0
  mv6 = 0
  mv9 = 0
  mv1c = 0
  mv2c = 0
  mv3c = 0
  mv4c = 0
  mv5c = 0
  mv6c = 0
  mv9c = 0
  mp1 = 0
  mp2 = 0
  mp3 = 0
  mp4 = 0
  mp5 = 0
  mp6 = 0
  mp9 = 0
  mp1c = 0
  mp2c = 0
  mp3c = 0
  mp4c = 0
  mp5c = 0
  mp6c = 0
  mp9c = 0
  mh1 = 0
  mh2 = 0
  mh3 = 0
  mh4 = 0
  mh5 = 0
  mh6 = 0
  mh9 = 0
  mh1c = 0
  mh2c = 0
  mh3c = 0
  mh4c = 0
  mh5c = 0
  mh6c = 0
  mh9c = 0
  mw1 = 0
  mw2 = 0
  mw3 = 0
  mw4 = 0
  mw5 = 0
  mw6 = 0
  mw9 = 0
  mw1c = 0
  mw2c = 0
  mw3c = 0
  mw4c = 0
  mw5c = 0
  mw6c = 0
  mw9c = 0
  me0 = 0
  me1 = 0
  me2 = 0
  me3 = 0
  me4 = 0
  me5 = 0
  me6 = 0
  me7 = 0
  me8 = 0
  me9 = 0
  me0c = 0
  me1c = 0
  me2c = 0
  me3c = 0
  me4c = 0
  me5c = 0
  me6c = 0
  me7c = 0
  me8c = 0
  me9c = 0
  mu1 = 0
  mu2 = 0
  mu3 = 0
  mu4 = 0
  mu5 = 0
  mu6 = 0
  mu9 = 0
  mu1c = 0
  mu2c = 0
  mu3c = 0
  mu4c = 0
  mu5c = 0
  mu6c = 0
  mu9c = 0
  mt1 = 0
  mt2 = 0
  mt3 = 0
  mt4 = 0
  mt5 = 0
  mt6 = 0
  mt9 = 0
  mt1c = 0
  mt2c = 0
  mt3c = 0
  mt4c = 0
  mt5c = 0
  mt6c = 0
  mt9c = 0
  pcnt = 0
  mb1  = 0
  mb3  = 0
  mb4  = 0
  mb5  = 0
  mb6  = 0
  mb1c = 0
  mb3c = 0
  mb4c = 0
  mb5c = 0
  mb6c = 0
**
  mj1  = 0
  mj3  = 0
  mj4  = 0
  mj5  = 0
  mj6  = 0
  mj9  = 0
  mj1c = 0
  mj3c = 0
  mj4c = 0
  mj5c = 0
  mj6c = 0
  mj9c = 0
**
  mf1  = 0
  mf3  = 0
  mf4  = 0
  mf5  = 0
  mf6  = 0
  mf9  = 0
  mf1c = 0
  mf3c = 0
  mf4c = 0
  mf5c = 0
  mf6c = 0
  mf9c = 0
  
  r3ac = 0
  r4ac = 0
  r5ac = 0
  r9ac = 0
  i3ac = 0
  i4ac = 0
  i5ac = 0
  i9ac = 0
  c3ac = 0
  c4ac = 0
  c5ac = 0
  c9ac = 0  
  a3ac = 0
  a4ac = 0
  a5ac = 0
  a9ac = 0  
  v3ac = 0
  v4ac = 0
  v5ac = 0
  v9ac = 0    
  w3ac = 0
  w4ac = 0
  w5ac = 0
  w9ac = 0  
  t3ac = 0
  t4ac = 0
  t5ac = 0
  t9ac = 0  
  p3ac = 0
  p4ac = 0
  p5ac = 0
  p9ac = 0 
  h3ac = 0
  h4ac = 0
  h5ac = 0
  h9ac = 0
  u2ac = 0    
  u3ac = 0
  u4ac = 0
  u5ac = 0
  u9ac = 0    
  e0ac = 0
  e1ac = 0
  e2ac = 0
  e3ac = 0  
  e4ac = 0
  e5ac = 0
  e6ac = 0
  e7ac = 0
  e8ac = 0
  e9ac = 0
  b3ac = 0
  b4ac = 0
  b5ac = 0
  j3ac = 0
  j4ac = 0
  j5ac = 0
  j9ac = 0
  f3ac = 0
  f4ac = 0
  f5ac = 0
  f9ac = 0  

  sx = 0
  sxcount = 0
    
	HOMECNT = 0
	S1 = 0
	S1COUNT = 0
	S2S = 0
	S2  = 0
	S2C = 0
	S2COUNT = 0
	
	sccount = 0
	SC65 = 0
	SC  = 0
	SCC = 0
	
	sdcount = 0
	sd65 = 0
	sd = 0
	sdc = 0
	
	secount = 0
	se65 = 0
	se = 0
		
	sgcount = 0
	sg = 0
	
	S2COUNT = 0
	S3 = 0
	S3COUNT = 0
	S3C = 0
	S3S  = 0
	S4S = 0
	S4 = 0
	S4C = 0
	s465 = 0
	S4COUNT = 0
	
	S5 = 0
	S5COUNT = 0
	SS = 0
	SSCOUNT = 0
	
	
	S6 = 0
	S6count = 0
	ss = 0
	sscount = 0
	sss = 0
	ssc = 0
	S8 = 0
	S8count = 0
	S9 = 0
	S9count = 0
	s6s = 0
	s7s = 0
	s8s = 0
	s9s = 0
	sb  = 0
	sbcount = 0
	sy = 0
	sycount = 0
	
	PREF1 = 0
	PREF2 = 0
	PREF1CT = 0
	PREF2CT = 0
	ACPREF  = 0
	CUFMV1 = 0
	CUFMV2 = 0
	CUACC = 0
	CUTOT = 0
	CUCNT = 0
	SwTot = 0
	SwCnt = 0
	SwFmv1 = 0
	SwFmv2 = 0
	SwAcc  = 0
	SjTot = 0
	SjCnt = 0
	SjFmv1 = 0
	SjFmv2 = 0
	
	td  = space(2)
	tdx = '  '
	L1s = 0 && variable for Lowndes school & county
	L1 = 0  && variable for Lowndes state
	L1Count = 0
	L2S = 0
	L2 = 0
	L2C = 0
	L2COUNT = 0
	L3S = 0
	L3 = 0
	L3C = 0
	L3COUNT =	0
	L4S = 0
	L4 = 0
	L4C = 0
	L4COUNT = 0
	L5S = 0
	L5 = 0
	L5C = 0
	L5COUNT =	0
	L6S = 0
	L6 = 0
	L6C = 0
	L6COUNT =	0
	L7S = 0
	L7 = 0
	L7C = 0
	L7COUNT =	0
	L8S = 0
	L8 = 0
	L8C = 0
	L8COUNT =	0
	L9S = 0
	L9 = 0
	L9C = 0
	L9COUNT =	0	
	L2AC = 0
	L2AS = 0
	L2A = 0
	L2ACount = 0
	S5ACount = 0
	S5A = 0
	L10 = 0
	L10COUNT = 0
	HistCnt = 0
	HistEx = 0
	TranCnt = 0
	TranEx = 0
	F1  = 0
	F1C = 0
	F1S = 0
	f1cnt = 0
	F3  = 0
	F3C = 0
	F3S = 0
	f3cnt = 0
	F4  = 0
	F4C = 0
	F4S = 0
	F4cnt = 0
	F5  = 0
	F5C = 0
	F5S = 0
	F5cnt = 0
	Fs  = 0
	FsC = 0
	FsS = 0
	Fscnt = 0
	F15 = 0
	F15C = 0
	F15S = 0
	F15cnt = 0
	F16  = 0
	F16C = 0
	F16S = 0
	F16cnt = 0
	fs16 = 0
	fs16c = 0
	fs16s = 0
	fs16cnt = 0
	L15  = 0
	L15C = 0
	L15S = 0
	L15cnt = 0
	L16  = 0
	L16C = 0
	L16S = 0
	L16cnt = 0
	LS16  = 0
	LS16C = 0
	LS16S = 0
	LS16cnt = 0
	
	
  RbTot = 0
  RbNum = 0
  RaTot = 0
  RaNum = 0
  RiTot = 0
  RiNum = 0
  RzTot = 0
  RzNum = 0
  RfTot = 0
  RfNum = 0
  RpTot = 0
  RpNum = 0
  RCurr = 0
  RCurrNum = 0
  AbTot = 0
  AbNum = 0
  AaTot = 0
  AaNum = 0
  AiTot = 0
  AiNum = 0
  AzTot = 0
  AzNum = 0
  AfTot = 0
  AfNum = 0
  ApTot = 0
  ApNum = 0
  ACurr = 0
  ACurrNum = 0
  CbTot = 0
  CbNum = 0
  CaTot = 0
  CaNum = 0
  CiTot = 0
  CiNum = 0
  CzTot = 0
  CzNum = 0
  CfTot = 0
  CfNum = 0
  CpTot = 0
  CPNum = 0
  CCurr = 0
  CCurrNum = 0
  IbTot = 0
  IbNum = 0
  IaTot = 0
  IaNum = 0
  IiTot = 0
  IiNum = 0
  IzTot = 0
  IzNum = 0
  IfTot = 0
  IfNum = 0
  IpTot = 0
  IpNum = 0
  ICurr = 0
  ICurrNum = 0
  UbTot = 0
  UbNum = 0
  UaTot = 0
  UaNum = 0
  UiTot = 0
  UiNum = 0
  UzTot = 0
  UzNum = 0
  UfTot = 0
  UfNum = 0
  UpTot = 0
  UpNum = 0
  UCurr = 0
  UCurrNum = 0
  CurrNum = 0
  CurrTot = 0
  FreeNum = 0
  FreeTot = 0
  SpNum = 0
  SpTot = 0
  MessX = 'Creating Consolidation Report'
  HMany = 0
  E1Tot = 0
  E1Num = 0
  E2Tot = 0
  E2Num = 0
  E3Tot = 0
  E3Num = 0
  E4Tot = 0
  E4Num = 0
  E5Tot = 0
  E5Num = 0
  E6Tot = 0
  E6Num = 0
  E7Tot = 0
  E7Num = 0
  E8Tot = 0
  E8Num = 0
  E9Tot = 0
  E9Num = 0
  E0Tot = 0
  E0Num = 0
  
	mv    = 0
	mvc   = 0
	mh    = 0
	mhc   = 0 
	ti    = 0
	tic   = 0
	hd    = 0
	hdc   = 0
	linc  = .f.
  
  StExVal = 0
  BnExCnt = 0
  BnExVal = 0
  MoExCnt = 0
  MoExVal = 0
  ShExVal = 0
  GrVal = 0
  GrAc = 0
  GrCnt = 0
  

	close all
	
	sele G
	use Defaults shared
	
	sele H
	use tdtemp
	
	sele 15
	use landsubs
	set order to realkey
	
	sele 16
	use inc_detail
	set order to realkey
	
	sele 17
	use cons_value_mav
	
	
	sele A
	Use Realprop shared
	set order to RealKey
	
	clear
	
*!*		@ 8,20 say 'Consolidation Report: Version 2013.05.29'
	
	go top
	
	Do While .not. Eof() .and. Key <> 27
	
		@10,20 say recno()
		
	  Key = InKey()
	
		ltd = .f.
		
		If realprop.income
		
			linc = .t.
			
		Else
		
			linc = .f.
			
		EndIf		
		
		sele tdtemp
		
		go top
		
		Do While !eof()
		
			If taxdistric = realprop.taxdistric
			
				ltd = .t.
				exit
				
			EndIf
			
			skip
			
		EndDo
		
		
		sele realprop
			
	  If !ltd 
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  EndIf

		If !linc &&and digstrat < '2' and mavag + mavpref = 0

			Do Case
			  Case DigClass = 'A' .and. P_Value = 0 
					MavMDigA()
			  Case DigClass = 'R' 
			    MavMDigR()
			  Case DigClass = 'C' 
			    MavMDigC()
			  Case DigClass = 'I' 
			    MavMDigI()
		  	Case DigClass = 'V' 
			    MavMDigV()
			  Case DigClass = 'W' 
			    MavMDigW()
			  Case DigClass = 'T' 
			    MavMDigT()
			  Case DigClass = 'P' &&.or. P_Value > 0 
			    MavMDigP()
			  Case DigClass = 'E' 
			    MavMDigE()
			  Case DigClass = 'U' 
			    MavMDigU()
			  Case DigClass = 'H' 
			    MavMDigH()
			  Case Digclass = 'B'
			  	MavMDigB()
			  Case Digclass = 'J'
			  	MavmDigJ()	  
	  	  Otherwise
			    munk = munk + mavag + mavpref
			    munkc = munkc + 1
		    	If  mavpref > 0
		      	munkc = munkc + 1
			    EndIf    
			EndCase
			
		Else
		
			lsb3  = .f.
			nland = 0
			
			If sale_val
				lsb3 = .t.
			EndIf
				
			sele inc_detail
			seek realprop.realkey
			
			If found()
			
				Do Case
				
					Case inc_land > 0
						nland = inc_land
					Case mavland > 0
						nland = mavland
					Otherwise
						nland = realprop.mavag + realprop.mavpref
							
				EndCase
				
				Do Case
				
					Case realprop.digclass = 'E'

				  	Do Case
				  	
					    Case realprop.Digstrat = '0'
					    
								If inc_imp > 0
									me0  = me0 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me0c = me0c + 1
								EndIf	
					    
					      me0 = me0 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me0c = me0c + 1
					      e0ac = e0ac +realprop.totalacres      
				  	
					    Case realprop.Digstrat = '1'
					    
								If inc_imp > 0
									me1  = me1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me1c = me1c + 1
								EndIf	
					    
					      me1 = me1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me1c = me1c + 1
					      e1ac = e1ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '2'

								If inc_imp > 0
									me2  = me2 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me2c = me2c + 1
								EndIf	

					      me2 = me2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me2c = me2c + 1
					      e2ac = e2ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '3'

								If inc_imp > 0
									me3  = me3 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me3c = me3c + 1
								EndIf	

					      me3 = me3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me3c = me3c + 1
					      e3ac = e3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'

								If inc_imp > 0
									me4  = me4 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me4c = me4c + 1
								EndIf	
					    					    
					      me4 = me4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me4c = me4c + 1
					      e4ac = e4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'

								If inc_imp > 0
									me5  = me5 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me5c = me5c + 1
								EndIf	
					    
					      me5 = me5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me5c = me5c + 1
					      e5ac = e5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					    
								If inc_imp > 0
									me6  = me6 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me6c = me6c + 1
								EndIf	
					    
					      me6 = me6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me6c = me6c + 1
					      e6ac = e6ac +realprop.totalacres      					      
					      
					    Case realprop.Digstrat = '7'
					    
								If inc_imp > 0
									me7  = me7 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me7c = me7c + 1
								EndIf	
					    
					      me7 = me7 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me7c = me7c + 1
					      e7ac = e7ac +realprop.totalacres      
					      
					    Case realprop.Digstrat = '8'
					    
								If inc_imp > 0
									me8  = me8 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me8c = me8c + 1
								EndIf	
					    
					      me8 = me8 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me8c = me8c + 1
					      e8ac = e8ac +realprop.totalacres      


					    Case realprop.Digstrat = '9'
					    
								If inc_imp > 0
									me9  = me9 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me9c = me9c + 1
								EndIf	
					    
					      me9 = me9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me9c = me9c + 1
					      e9ac = e9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase
						
				  Case inc_cs = 'A' 
				  
						If inc_imp > 0
					  	ma1  = ma1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
					  	ma1c = ma1c + 1
					  EndIf	

				  	Do Case
					    Case realprop.DigStrat = '1'
					      ma1 = ma1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      ma1c = ma1c + 1
					    Case realprop.Digstrat = '2'
					      ma2 = ma2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      ma2c = ma2c + 1
					    Case realprop.Digstrat = '3'
					      ma3 = ma3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      ma3c = ma3c + 1
					      a3ac = a3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      ma4 = ma4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      ma4c = ma4c + 1
					      a4ac = a4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      ma5 = ma5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      ma5c = ma5c + 1
					      a5ac = a5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      ma6 = ma6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      ma6c = ma6c + 1
					    Case realprop.Digstrat = '9'
					      ma9 = ma9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      ma9c = ma9c + 1
					      a9ac = a9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'R' 

						If inc_imp > 0
							mr1  = mr1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mr1c = mr1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mr1 = mr1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mr1c = mr1c + 1
					    Case realprop.Digstrat = '2'
					      mr2 = mr2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mr2c = mr2c + 1
					    Case realprop.Digstrat = '3'
					      mr3 = mr3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mr3c = mr3c + 1
					      r3ac = r3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mr4 = mr4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mr4c = mr4c + 1
					      r4ac = r4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mr5 = mr5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mr5c = mr5c + 1
					      r5ac = r5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mr6 = mr6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mr6c = mr6c + 1
					    Case realprop.Digstrat = '9'
					      mr9 = mr9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mr9c = mr9c + 1
					      r9ac = r9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'C' 


						If inc_imp > 0
						
							mc1  = mc1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mc1c = mc1c + 1

						EndIf	
						
				  	Do Case
				  		
				  		Case realprop.digclass = 'E'
				  			
				  			Do Case
				  				
				  				Case realprop.totalacres < 5
				  					mc3 = mc3 + round(nland *.4,0)
				  					mc3c = mc3c + 1
				  				Case realprop.totalacres >= 5 and realprop.totalacres <= 25
				  					mc4 = mc4 + round(nland *.4,0)
				  					mc4c = mc4c + 1
				  				Case realprop.totalacres > 25
				  					mc5 = mc5 + round(nland *.4,0)
				  					mc5c = mc5c + 1

				  			EndCase
				  			
					    Case realprop.Digstrat = '1'
					      mc1 = mc1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mc1c = mc1c + 1
					      
					    Case realprop.Digstrat = '2'
					      mc2 = mc2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mc2c = mc2c + 1
					    Case realprop.Digstrat = '3'
					      mc3 = mc3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mc3c = mc3c + 1
					      c3ac = c3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mc4 = mc4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mc4c = mc4c + 1
					      c4ac = c4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mc5 = mc5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mc5c = mc5c + 1
					      c5ac = c5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mc6 = mc6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mc6c = mc6c + 1
					    Case realprop.Digstrat = '9'
					      mc9 = mc9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mc9c = mc9c + 1
					      c9ac = c9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'I' 

						If inc_imp > 0
							mi1  = mi1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mi1c = mi1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mi1 = mi1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mi1c = mi1c + 1
					    Case realprop.Digstrat = '2'
					      mi2 = mi2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mi2c = mi2c + 1
					    Case realprop.Digstrat = '3'
					      mi3 = mi3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mi3c = mi3c + 1
					      i3ac = i3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mi4 = mi4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mi4c = mi4c + 1
					      i4ac = i4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mi5 = mi5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mi5c = mi5c + 1
					      i5ac = i5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mi6 = mi6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mi6c = mi6c + 1
					    Case realprop.Digstrat = '9'
					      mi9 = mi9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mi9c = mi9c + 1
					      i9ac = i9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

			  	Case inc_cs = 'V' 

						If inc_imp > 0
							mv1  = mv1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mv1c = mv1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mv1 = mv1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mv1c = mv1c + 1
					    Case realprop.Digstrat = '2'
					      mv2 = mv2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mv2c = mv2c + 1
					    Case realprop.Digstrat = '3'
					      mv3 = mv3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mv3c = mv3c + 1
					      v3ac = v3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mv4 = mv4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mv4c = mv4c + 1
					      v4ac = v4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mv5 = mv5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mv5c = mv5c + 1
					      v5ac = v5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mv6 = mv6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mv6c = mv6c + 1
					    Case realprop.Digstrat = '9'
					      mv9 = mv9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mv9c = mv9c + 1
					      v9ac = v9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'W' 

						If inc_imp > 0
							mw1  = mw1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mw1c = mw1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mw1 = mw1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mw1c = mw1c + 1
					    Case realprop.Digstrat = '2'
					      mw2 = mw2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mw2c = mw2c + 1
					    Case realprop.Digstrat = '3'
					      mw3 = mw3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mw3c = mw3c + 1
					      w3ac = w3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mw4 = mw4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mw4c = mw4c + 1
					      w4ac = w4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mw5 = mw5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mw5c = mw5c + 1
					      w5ac = w5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mw6 = mw6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mw6c = mw6c + 1
					    Case realprop.Digstrat = '9'
					      mw9 = mw9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mw9c = mw9c + 1
					      w9ac = w9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase


				  Case inc_cs = 'T' 

						If inc_imp > 0
							mt1  = mt1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mt1c = mt1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mt1 = mt1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mt1c = mt1c + 1
					    Case realprop.Digstrat = '2'
					      mt2 = mt2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mt2c = mt2c + 1
					    Case realprop.Digstrat = '3'
					      mt3 = mt3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mt3c = mt3c + 1
					      t3ac = t3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mt4 = mt4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mt4c = mt4c + 1
					      t4ac = t4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mt5 = mt5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mt5c = mt5c + 1
					      t5ac = t5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mt6 = mt6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mt6c = mt6c + 1
					    Case realprop.Digstrat = '9'
					      mt9 = mt9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mt9c = mt9c + 1
					      t9ac = t9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'P'

						If inc_imp > 0
							mp1  = mp1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mp1c = mp1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.Digstrat = '1'
					      mp1 = mp1 + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      mp1c = mp1c + 1
					    Case realprop.Digstrat = '2'
					      mp2 = mp2 + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      mp2c = mp2c + 1
					    Case realprop.Digstrat = '3'
					      mp3 = mp3 + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      mp3c = mp3c + 1
					      p3ac = p3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mp4 = mp4 + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      mp4c = mp4c + 1
					      p4ac = p4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mp5 = mp5 + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      mp5c = mp5c + 1
					      p5ac = p5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mp6 = mp6 + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      mp6c = mp6c + 1
					    Case realprop.Digstrat = '9'
					      mp9 = mp9 + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      mp9c = mp9c + 1
					      p9ac = p9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland2*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'E' 

				  	Do Case
				  	
					    Case realprop.Digstrat = '0'
					    
								If inc_imp > 0
									me0  = me0 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me0c = me0c + 1
								EndIf	
					    
					      me0 = me0 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me0c = me0c + 1
					      e0ac = e0ac +realprop.totalacres      
				  	
					    Case realprop.Digstrat = '1'
					    
								If inc_imp > 0
									me1  = me1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me1c = me1c + 1
								EndIf	
					    
					      me1 = me1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me1c = me1c + 1
					      e1ac = e1ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '2'

								If inc_imp > 0
									me2  = me2 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me2c = me2c + 1
								EndIf	

					      me2 = me2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me2c = me2c + 1
					      e2ac = e2ac +realprop.totalacres      					      					      
					    Case realprop.Digstrat = '3'

								If inc_imp > 0
									me3  = me3 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me3c = me3c + 1
								EndIf	

					      me3 = me3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me3c = me3c + 1
					      e3ac = e3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'

								If inc_imp > 0
									me4  = me4 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me4c = me4c + 1
								EndIf	
					    					    
					      me4 = me4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me4c = me4c + 1
					      e4ac = e4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'

								If inc_imp > 0
									me5  = me5 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me5c = me5c + 1
								EndIf	
					    
					      me5 = me5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me5c = me5c + 1
					      e5ac = e5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					    
								If inc_imp > 0
									me6  = me6 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me6c = me6c + 1
								EndIf	
					    
					      me6 = me6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me6c = me6c + 1
					      e6ac = e6ac +realprop.totalacres      					      
					      
					    Case realprop.Digstrat = '7'
					    
								If inc_imp > 0
									me7  = me7 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me7c = me7c + 1
								EndIf	
					    
					      me7 = me7 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me7c = me7c + 1
					      e7ac = e7ac +realprop.totalacres      
					      
					    Case realprop.Digstrat = '8'
					    
								If inc_imp > 0
									me8  = me8 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me8c = me8c + 1
								EndIf	
					    
					      me8 = me8 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me8c = me8c + 1
					      e8ac = e8ac +realprop.totalacres      


					    Case realprop.Digstrat = '9'
					    
								If inc_imp > 0
									me9  = me9 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
									me9c = me9c + 1
								EndIf	
					    
					      me9 = me9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      me9c = me9c + 1
					      e9ac = e9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase


				  Case inc_cs = 'U' 

						If inc_imp > 0
							mu1  = mu1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mu1c = mu1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mu1 = mu1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mu1c = mu1c + 1
					    Case realprop.Digstrat = '2'
					      mu2 = mu2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mu2c = mu2c + 1
					    Case realprop.Digstrat = '3'
					      mu3 = mu3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mu3c = mu3c + 1
					      u3ac = u3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mu4 = mu4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mu4c = mu4c + 1
					      u4ac = u4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mu5 = mu5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mu5c = mu5c + 1
					      u5ac = u5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mu6 = mu6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mu6c = mu6c + 1
					    Case realprop.Digstrat = '9'
					      mu9 = mu9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mu9c = mu9c + 1
					      u9ac = u9ac +realprop.totalacres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

				  Case inc_cs = 'H' 

						If inc_imp > 0
							mh1  = mh1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mh1c = mh1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mh1 = mh1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mh1c = mh1c + 1
					    Case realprop.Digstrat = '2'
					      mh2 = mh2 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mh2c = mh2c + 1
					    Case realprop.Digstrat = '3'
					      mh3 = mh3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mh3c = mh3c + 1
					      h3ac = h3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mh4 = mh4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mh4c = mh4c + 1
					      h4ac = h4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mh5 = mh5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mh5c = mh5c + 1
					      h5ac = h5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mh6 = mh6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mh6c = mh6c + 1
					    Case realprop.Digstrat = '9'
					      mh9 = mh9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mh9c = mh9c + 1
					      h9ac = h9ac + realprop.totalAcres      
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase
***B
				  Case inc_cs = 'B' 

						If inc_imp > 0
							mb1  = mb1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							mb1c = mb1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mb1 = mb1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mb1c = mb1c + 1
					    Case realprop.Digstrat = '3'
					      mb3 = mb3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mb3c = mb3c + 1
					      b3ac = b3ac + realprop.TotalAcres
					    Case realprop.Digstrat = '4'
					      mb4 = mb4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mb4c = mb4c + 1
					      b4ac = b4ac +realprop.totalacres      
					    Case realprop.Digstrat = '5'
					      mb5 = mb5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mb5c = mb5c + 1
					      b5ac = b5ac +realprop.totalacres      
					    Case realprop.Digstrat = '6'
					      mb6 = mb6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mb6c = mb6c + 1
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

**J

				  Case inc_cs = 'J' 

						If inc_imp > 0
							ma1  = ma1 + iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0))
							ma1c = ma1c + 1
						EndIf	
						
				  	Do Case
					    Case realprop.DigStrat = '1'
					      mj1 = mj1 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mj1c = mj1c + 1
					      mf1 = round(realprop.flbaseval * .4,0)
					      f1ac = realprop.totalacres
					      mf1c = mf1c + 1
					    Case realprop.Digstrat = '3'
					      mj3 = mj3 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mj3c = mj3c + 1
					      j3ac = j3ac + realprop.TotalAcres
					      mf3 = round(realprop.flbaseval * .4,0)
					      f3ac = realprop.totalacres
					      mf3c = mf3c + 1
					    Case realprop.Digstrat = '4'
					      mj4 = mj4 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mj4c = mj4c + 1
					      j4ac = j4ac +realprop.totalacres
					      mf4 = round(realprop.flbaseval * .4,0)
					      f4ac = realprop.totalacres
					      mf4c = mf4c + 1
					    Case realprop.Digstrat = '5'
					      mj5 = mj5 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mj5c = mj5c + 1
					      j5ac = j5ac +realprop.totalacres
					      mf5 = round(realprop.flbaseval * .4,0)
					      f5ac = realprop.totalacres
					      mf5c = mf5c + 1
					    Case realprop.Digstrat = '6'
					      mj6 = mj6 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mj6c = mj6c + 1
					      mf6 = round(realprop.flbaseval * .4,0)
					      f6ac = realprop.totalacres
					      mf6c = mf6c + 1
					    Case realprop.Digstrat = '9'
					      mj9 = mj9 + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      mj9c = mj9c + 1
					      mf9 = round(realprop.flbaseval * .4,0)
					      f9ac = realprop.totalacres
					      mf9c = mf9c + 1
					    OtherWise
					      munk = munk + iif(lsb3, round(realprop.saleland1*.4,0),round(nland * .4,0))
					      munkc = munkc + 1
				    EndCase

		  	  Otherwise
		  	  
		  	  	sele realprop
		  	  	
				    munk = munk + mavag
				    munkc = munkc + 1
			  	  munk = munk + mavpref
			    	If mavpref > 0
			      	munkc = munkc + 1
				    EndIf  
				    
				    sele inc_detail
				      
				EndCase
				
				
				If inc_imp > 0 and !lsb3

					cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,left(inc_cs,1),'1',;
										iif(lsb3, round((realprop.saleimp1+realprop.saleimp2)*.4,0),round(inc_imp * .4,0)),alias(),0,realprop.taxdistric)
										
				EndIf
				
				If lsb3 and realprop.saleimp1 + realprop.saleimp2 > 0

					cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,left(inc_cs,1),'1',;
										round((realprop.saleimp1+realprop.saleimp2)*.4,0),alias(),0,realprop.taxdistric)
				
				EndIf
				
				If lsb3
				
					cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,;
						iif(realprop.digclass = 'E','E',left(inc_cs,1)),realprop.digstrat,;
						round((realprop.saleland1 + realprop.saleland2) * .4,0),alias(),realprop.totalacres,;
						realprop.taxdistric)
				
				Else

					cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,;
										iif(realprop.digclass = 'E','E',left(inc_cs,1)),realprop.digstrat,;
										round(nland * .4,0),alias(),realprop.totalacres,realprop.taxdistric)
				
				EndIf
				
*!*					If inc_Land > 0 &&and !lsb3
*!*					
*!*						If realprop.digclass = 'E' and inc_cs <> 'E'
*!*						
*!*							Do Case
*!*							
*!*								Case realprop.totalacres < 5
*!*								
*!*									cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,inc_cs,'3',;
*!*														iif(lsb3, round(realprop.saleland1*.4,0),round(inc_land * .4,0)),alias(),realprop.totalacres,realprop.taxdistric)
*!*														
*!*								Case realprop.totalacres >= 5 and realprop.totalacres <= 25
*!*								
*!*									cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,inc_cs,'4',;
*!*														iif(lsb3, round(realprop.saleland1*.4,0),round(inc_land * .4,0)),alias(),realprop.totalacres,realprop.taxdistric)

*!*								Case realprop.totalacres > 25
*!*								
*!*									cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,inc_cs,'5',;
*!*														iif(lsb3, round(realprop.saleland1*.4,0),round(inc_land * .4,0)),alias(),realprop.totalacres,realprop.taxdistric)
*!*								
*!*							EndCase

*!*						Else
*!*						
*!*							If !lsb3

*!*								cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,inc_cs,realprop.digstrat,;
*!*													round(inc_land * .4,0),alias(),realprop.totalacres,realprop.taxdistric)
*!*													
*!*							Else

*!*								cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,inc_cs,realprop.digstrat,;
*!*									round((realprop.saleland1 + realprop.saleland2) * .4,0),alias(),realprop.totalacres,realprop.taxdistric)
*!*							
*!*							EndIf						

*!*						EndIf &&realprop.digcalss = 'E'
*!*						
*!*					Else
*!*					
*!*						If lsb3
*!*						
*!*							cons_value_mav(realkey,realprop.parcel_no,0,0,0,0,inc_cs,realprop.digstrat,;
*!*								round((realprop.saleland1 + realprop.saleland2) * .4,0),alias(),realprop.totalacres,realprop.taxdistric)
*!*						
*!*						EndIf	
*!*						
*!*					EndIf	 &&inc_Land > 0 and !lsb3
				
			EndIf
			
		EndIf	
		
		sele realprop
		
	  pcnt = pcnt + 1
	  skip

	EndDo
	
	sele B
	Use Reprop shared
	set relation to RealKey into A
	MavConsRep()

	sele H
	use tdtemp
	
	sele C
	Use Acessory shared

	Do While .not. Eof() .and. Key <> 27
	  Key = InKey()

		linc = .f.
	 
 	  sele realprop
	  seek acessory.realkey
	  
	  lsb3 = .f.
	  
	  If sale_val
	  	lsb3 = .t.
	  EndIf	
	  
	  If income 
	  	linc = .t.
	  EndIf
	  	
	  lfr = .f.
	  
	  If found()
	  	lfr = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele acessory

	  	If linc
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
		  
		  If mav = 0

		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  
		  EndIf
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	
	  
	  If !lfr
	  	sele acessory
	  	skip
	  	If eof()
	  		exit
	  	Else
	  		loop
	  	EndIf
	  Else
	  	sele acessory
	  EndIf				

		xval = 0
		
		If lsb3
			xval = sb346val + sb346add
		Else
			xval = mav
		EndIf
					  
	  Do Case
	  	Case RealKey = 0
	  		skip
	  		If eof()
	  			exit
	  		EndIf	
		  Case DigClass = 'A' .and. RealKey = a->RealKey and acc_type = 'A'
		  	Do Case
			    Case DigStrat = '1'
			      ma1 = ma1 + round(xval*.4,0)
			      ma1c = ma1c + 1

			    Case Digstrat = '2'
			      ma2 = ma2 + round(xval*.4,0)
			      ma2c = ma2c + 1
			      
			    Case Digstrat = '3'
			      ma3 = ma3 + round(xval*.4,0)
			      ma3c = ma3c + 1
			      
			    Case Digstrat = '4'
			      ma4 = ma4 + round(xval*.4,0)
			      ma4c = ma4c + 1
			      
			    Case Digstrat = '5'
			      ma5 = ma5 + round(xval*.4,0)
			      ma5c = ma5c + 1
			      
			    Case Digstrat = '6'
			      ma6 = ma6 + round(xval*.4,0)
			      ma6c = ma6c + 1
			      
			    Case Digstrat = '9'
			      ma9 = ma9 + round(xval*.4,0)
			      ma9c = ma9c + 1
			      
			    Otherwise
			      munk = munk + round(xval*.4,0)
			      munkc = munkc + 1
			      
			  EndCase  
	  Case DigClass = 'R' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mr1 = mr1 + round(xval*.4,0)
		      mr1c = mr1c + 1
		      
		    Case Digstrat = '2'
		      mr2 = mr2 + round(xval*.4,0)
		      mr2c = mr2c + 1
		      
		    Case Digstrat = '3'
		      mr3 = mr3 + round(xval*.4,0)
		      mr3c = mr3c + 1
		      
		    Case Digstrat = '4'
		      mr4 = mr4 + round(xval*.4,0)
		      mr4c = mr4c + 1
		      
		    Case Digstrat = '5'
		      mr5 = mr5 + round(xval*.4,0)
		      mr5c = mr5c + 1
		      
		    Case Digstrat = '6'
		      mr6 = mr6 + round(xval*.4,0)
		      mr6c = mr6c + 1
		      
		    Case Digstrat = '9'
		      mr9 = mr9 + round(xval*.4,0)
		      mr9c = mr9c + 1

		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		      
		  EndCase  
	  Case DigClass = 'C' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mc1 = mc1 + round(xval*.4,0)
		      mc1c = mc1c + 1
	      
*!*			      sele commcnt
*!*			      append blank
*!*			      replace realkey with acessory.realkey,;
*!*			      				acckey with acessory.acckey
*!*			      sele acessory				
		      				

		    Case Digstrat = '2'
		      mc2 = mc2 + round(xval*.4,0)
		      mc2c = mc2c + 1
		      
		    Case Digstrat = '3'
		      mc3 = mc3 + round(xval*.4,0)
		      mc3c = mc3c + 1
		      
		    Case Digstrat = '4'
		      mc4 = mc4 + round(xval*.4,0)
		      mc4c = mc4c + 1
		      
		    Case Digstrat = '5'
		      mc5 = mc5 + round(xval*.4,0)
		      mc5c = mc5c + 1
		      
		    Case Digstrat = '6'
		      mc6 = mc6 + round(xval*.4,0)
		      mc6c = mc6c + 1
		      
		    Case Digstrat = '9'
		      mc9 = mc9 + round(xval*.4,0)
		      mc9c = mc9c + 1
		      
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		      
		  EndCase  
	  Case DigClass = 'I' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mi1 = mi1 + round(xval*.4,0)
		      mi1c = mi1c + 1
		      
		    Case Digstrat = '2'
		      mi2 = mi2 + round(xval*.4,0)
		      mi2c = mi2c + 1
		      
		    Case Digstrat = '3'
		      mi3 = mi3 + round(xval*.4,0)
		      mi3c = mi3c + 1
		      
		    Case Digstrat = '4'
		      mi4 = mi4 + round(xval*.4,0)
		      mi4c = mi4c + 1
		      
		    Case Digstrat = '5'
		      mi5 = mi5 + round(xval*.4,0)
		      mi5c = mi5c + 1
		      
		    Case Digstrat = '6'
		      mi6 = mi6 + round(xval*.4,0)
		      mi6c = mi6c + 1
		      
		    Case Digstrat = '9'
		      mi9 = mi9 + round(xval*.4,0)
		      mi9c = mi9c + 1
		      
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		      
		  EndCase		      
	  Case DigClass = 'V' .and. RealKey = a->RealKey and acc_type = 'A'
	    Do Case
		    Case DigStrat = '1'
		      mv1 = mv1 + round(xval*.4,0)
		      mv1c = mv1c + 1
		    Case Digstrat = '2'
		      mv2 = mv2 + round(xval*.4,0)
		      mv2c = mv2c + 1
		    Case Digstrat = '3'
		      mv3 = mv3 + round(xval*.4,0)
		      mv3c = mv3c + 1
		    Case Digstrat = '4'
		      mv4 = mv4 + round(xval*.4,0)
		      mv4c = mv4c + 1
		    Case Digstrat = '5'
		      mv5 = mv5 + round(xval*.4,0)
		      mv5c = mv5c + 1
		    Case Digstrat = '6'
		      mv6 = mv6 + round(xval*.4,0)
		      mv6c = mv6c + 1
		    Case Digstrat = '9'
		      mv9 = mv9 + round(xval*.4,0)
		      mv9c = mv9c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		  EndCase		      
	  Case DigClass = 'W' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mw1 = mw1 + round(xval*.4,0)
		      mw1c = mw1c + 1
		    Case Digstrat = '2'
		      mw2 = mw2 + round(xval*.4,0)
		      mw2c = mw2c + 1
		    Case Digstrat = '3'
		      mw3 = mw3 + round(xval*.4,0)
		      mw3c = mw3c + 1
		    Case Digstrat = '4'
		      mw4 = mw4 + round(xval*.4,0)
		      mw4c = mw4c + 1
		    Case Digstrat = '5'
		      mw5 = mw5 + round(xval*.4,0)
		      mw5c = mw5c + 1
		    Case Digstrat = '6'
		      mw6 = mw6 + round(xval*.4,0)
		      mw6c = mw6c + 1
		    Case Digstrat = '9'
		      mw9 = mw9 + round(xval*.4,0)
		      mw9c = mw9c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		  EndCase		      
	  Case DigClass = 'T' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mt1 = mt1 + round(xval*.4,0)
		      mt1c = mt1c + 1
		    Case Digstrat = '2'
		      mt2 = mt2 + round(xval*.4,0)
		      mt2c = mt2c + 1
		    Case Digstrat = '3'
		      mt3 = mt3 + round(xval*.4,0)
		      mt3c = mt3c + 1
		    Case Digstrat = '4'
		      mt4 = mt4 + round(xval*.4,0)
		      mt4c = mt4c + 1
		    Case Digstrat = '5'
		      mt5 = mt5 + round(xval*.4,0)
		      mt5c = mt5c + 1
		    Case Digstrat = '6'
		      mt6 = mt6 + round(xval*.4,0)
		      mt6c = mt6c + 1
		    Case Digstrat = '9'
		      mt9 = mt9 + round(xval*.4,0)
		      mt9c = mt9c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		  EndCase		      
	  Case DigClass = 'P' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mp1 = mp1 + round(xval*.4,0)
		      mp1c = mp1c + 1
		    Case Digstrat = '2'
		      mp2 = mp2 + round(xval*.4,0)
		      mp2c = mp2c + 1
		    Case Digstrat = '3'
		      mp3 = mp3 + round(xval*.4,0)
		      mp3c = mp3c + 1
		    Case Digstrat = '4'
		      mp4 = mp4 + round(xval*.4,0)
		      mp4c = mp4c + 1
		    Case Digstrat = '5'
		      mp5 = mp5 + round(xval*.4,0)
		      mp5c = mp5c + 1
		    Case Digstrat = '6'
		      mp6 = mp6 + round(xval*.4,0)
		      mp6c = mp6c + 1
		    Case Digstrat = '9'
		      mp9 = mp9 + round(xval*.4,0)
		      mp9c = mp9c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		  EndCase    
	  Case DigClass = 'H' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mh1 = mh1 + round(xval*.4,0)
		      mh1c  = mh1c + 1
		    Case Digstrat = '2'
		      mh2 = mh2 + round(xval*.4,0)
		      mh2c  = mh2c + 1
		    Case Digstrat = '3'
		      mh3 = mh3 + round(xval*.4,0)
		      mh3c  = mh3c + 1
		    Case Digstrat = '4'
		      mh4 = mh4 + round(xval*.4,0)
		      mh4c  = mh4c + 1
		    Case Digstrat = '5'
		      mh5 = mh5 + round(xval*.4,0)
		      mh5c  = mh5c + 1
		    Case Digstrat = '6'
		      mh6 = mh6 + round(xval*.4,0)
		      mh6c  = mh6c + 1
		    Case Digstrat = '9'
		      mh9 = mh9 + round(xval*.4,0)
		      mh9c  = mh9c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc  = munkc + 1
		  EndCase
	  Case DigClass = 'E' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '0'
		      me0 = me0 + round(xval*.4,0)
		      me0c = me0c + 1
		    Case DigStrat = '1'
		      me1 = me1 + round(xval*.4,0)
		      me1c = me1c + 1
		    Case Digstrat = '2'
		      me2 = me2 + round(xval*.4,0)
		      me2c = me2c + 1
		    Case Digstrat = '3'
		      me3 = me3 + round(xval*.4,0)
		      me3c = me3c + 1
		    Case Digstrat = '4'
		      me4 = me4 + round(xval*.4,0)
		      me4c = me4c + 1
		    Case Digstrat = '5'
		      me5 = me5 + round(xval*.4,0)
		      me5c = me5c + 1
		    Case Digstrat = '6'
		      me6 = me6 + round(xval*.4,0)
		      me6c = me6c + 1
		    Case Digstrat = '7'
		      me7 = me7 + round(xval*.4,0)
		      me7c = me7c + 1
		    Case Digstrat = '8'
		      me8 = me8 + round(xval*.4,0)
		      me8c = me8c + 1
		    Case Digstrat = '9'
		      me9 = me9 + round(xval*.4,0)
		      me9c = me9c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		  EndCase
	  Case DigClass = 'U' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mu1 = mu1 + round(xval*.4,0)
		      mu1c = mu1c + 1
		    Case Digstrat = '2'
		      mu2 = mu2 + round(xval*.4,0)
		      mu2c = mu2c + 1
		    Case Digstrat = '3'
		      mu3 = mu3 + round(xval*.4,0)
		      mu3c = mu3c + 1
		    Case Digstrat = '4'
		      mu4 = mu4 + round(xval*.4,0)
		      mu4c = mu4c + 1
		    Case Digstrat = '5'
		      mu5 = mu5 + round(xval*.4,0)
		      mu5c = mu5c + 1
		    Case Digstrat = '6'
		      mu6 = mu6 + round(xval*.4,0)
		      mu6c = mu6c + 1
		    Case Digstrat = '9'
		      mu9 = mu9 + round(xval*.4,0)
		      mu9c = mu9c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		  EndCase
		  
**B

	  Case DigClass = 'B' .and. RealKey = a->RealKey and acc_type = 'A'
	  	Do Case
		    Case DigStrat = '1'
		      mb1 = mb1 + round(xval*.4,0)
		      mb1c = mb1c + 1
		    Case Digstrat = '3'
		      mb3 = mb3 + round(xval*.4,0)
		      mb3c = mb3c + 1
		    Case Digstrat = '4'
		      mb4 = mb4 + round(xval*.4,0)
		      mb4c = mb4c + 1
		    Case Digstrat = '5'
		      mb5 = mb5 + round(xval*.4,0)
		      mb5c = mb5c + 1
		    Case Digstrat = '6'
		      mb6 = mb6 + round(xval*.4,0)
		      mb6c = mb6c + 1
		    OtherWise
		      munk = munk + round(xval*.4,0)
		      munkc = munkc + 1
		  EndCase
		  
	  OtherWise
	  	If acc_type = 'A'
		    munk = munk + round(xval*.4,0)
		    munkc = munkc + 1
		  EndIf  
  EndCase
  
  	If acc_type = 'A'

      cons_value_mav(realprop.realkey,realprop.parcel_no,0,acckey,0,0,acessory.digclass,acessory.digstrat,;
      					iif(Ovr_Val > 0,round(xval*.4,0),round(xval*.4,0)),alias(),0,realprop.taxdistric)
  	
  	EndIf
	  skip

	EndDo
	
	MavAddComm()	
	
****starting homestead exemption stuff

	ncovex = 0
	
	sele H
	use tdtemp
	
	sele f
	use conmai
	set order to realkey
	
	sele 14
	use flpamain
	set order to realkey
		
	sele A
	go top
	ntift = 0
	
*!*	  clear
*!*	  @ 8, 0 say padc('Creating MAV Homestead Exemption Info',80)
*!*	  
*!*		do while .not. eof()

*!*			@10,20 say recno()
*!*			
*!*			ncovex = 0
*!*					
*!*			ltd = .f.
*!*			
*!*			sele tdtemp
*!*			
*!*			loca for taxdistric = realprop.taxdistric
*!*			  
*!*			If found()
*!*				ltd = .t.  
*!*			EndIf
*!*			
*!*			sele realprop
*!*				
*!*		  If !ltd 
*!*		  	skip
*!*		  	If !eof()
*!*		  		loop
*!*		  	Else
*!*		  		exit
*!*		  	EndIf
*!*		  EndIf

*!*			sele conmai

*!*			seek realprop.realkey
*!*			
*!*			If found()

*!*				ncovex = conmai.curr_ex
*!*				
*!*			Else	
*!*			
*!*				sele flpamain
*!*				seek realprop.realkey
*!*				
*!*				ncovex = flpamain.currex
*!*				
*!*			EndIf		
*!*			
*!*			sele realprop
*!*			
*!*		  If at('tift',lower(defaults.coname)) > 0
*!*		  
*!*				If ntift = 0
*!*				
*!*					exc1    = 0
*!*					exc1cnt = 0
*!*					exc2    = 0
*!*					exc2cnt = 0
*!*					exc3    = 0
*!*					exc3cnt = 0
*!*					exc4    = 0
*!*					exc4cnt = 0
*!*					exc9    = 0
*!*					exc9cnt = 0
*!*					excc    = 0
*!*					excccnt = 0
*!*					exclx   = 0
*!*					exclcnt = 0
*!*					excm    = 0
*!*					excmcnt = 0
*!*					excs    = 0
*!*					excscnt = 0
*!*					exm1    = 0
*!*					exm1cnt = 0
*!*					exm2    = 0
*!*					exm2cnt = 0

*!*				EndIf  && ntift = 0
*!*		  
*!*		  
*!*		  	tifths_mav(ntift)
*!*		  	
*!*		  	ntift = ntift + 1
*!*		  	
*!*		  	sele realprop
*!*		  	skip
*!*		  	
*!*		  	If eof()
*!*		  		exit
*!*		  	Else
*!*		  		loop
*!*		  	EndIf		

*!*		  EndIf	
*!*		  
*!*		  xcur = 0
*!*		  
*!*		  If sale_val
*!*		  	xcur = realprop.saleland1 + realprop.saleland2 + realprop.saleimp1 + realprop.saleimp2
*!*		  Else
*!*		  	xcur = mavcurr
*!*		  EndIf
*!*		  		
*!*	***begin mcintosh

*!*			If lower(defaults.coname) = 'mcintosh'
*!*		
*!*				Do Case
*!*				
*!*					Case lower(homeexempt) = 'f1'
*!*					
*!*						S1Count=S1Count+1 
*!*						if xcur>=5000
*!*							S1=S1+(5000*.4)	        
*!*						else
*!*							S1=S1+round(xcur*.4,0)   	        
*!*						endif

*!*						f1 = 0 && set to 0 because state exemption is in S1
*!*						

*!*						If xcur >= 5000
*!*						
*!*							If round(xcur * .4,0) - 2000 > round((currhomval - orighomval) * .4,0)
*!*							
*!*								f1c = f1c + round((currhomval - orighomval) * .4,0)
*!*								
*!*							Else
*!*							
*!*								f1c = f1c + round(xcur * .4,0) - 2000
*!*								
*!*							EndIf	
*!*							
*!*						EndIf	

*!*	*						f1s  = round((orighomval - currhomval) * .4,0)

*!*						If xcur >= 5000
*!*						
*!*							If round(xcur * .4,0) - 2000 > round((currhomval - orighomval) * .4,0)
*!*							
*!*								f1s = f1s + round((currhomval - orighomval) * .4,0)
*!*								
*!*							Else
*!*							
*!*								f1s = f1s + round(xcur * .4,0) - 2000
*!*								
*!*							EndIf
*!*							
*!*						EndIf		

*!*						f1cnt = f1cnt + 1

*!*					Case lower(homeexempt) = 'f3'

*!*						S3Count=S3Count+1
*!*						if xcur>=5000
*!*							S3=S3+(5000*.4)	        
*!*						else
*!*							S3=S3+round(xcur*.4,0)   	        
*!*						endif

*!*						if xcur>=25000
*!*							S3S=S3S+(25000*.4)	        
*!*						else
*!*							S3S=S3S+round(xcur*.4,0)   	        
*!*						endif

*!*						If xcur >= 5000
*!*							
*!*							If round(xcur * .4,0) - 2000 > round((currhomval - orighomval) * .4,0)
*!*							
*!*								f3c = f3c + round((currhomval - orighomval) * .4,0)
*!*								
*!*							Else
*!*							
*!*								f3c = f3c + round(xcur * .4,0) - 2000
*!*								
*!*							EndIf	
*!*							
*!*						EndIf	

*!*						If xcur >= 10000
*!*							
*!*							If round(xcur * .4,0) - 4000 > round((currhomval - orighomval) * .4,0)
*!*							
*!*								f3s = f3s + round((currhomval - orighomval) * .4,0)
*!*								
*!*							Else
*!*							
*!*								f3s = f3s + round(xcur * .4,0) - 4000
*!*								
*!*							EndIf	
*!*							
*!*						EndIf	

*!*						f3cnt = f3cnt + 1

*!*					Case lower(homeexempt) = 'f4'

*!*						S4Count=S4Count+1
*!*						
*!*						if xcur>=10000
*!*							S4=S4+(10000*.4)
*!*						else
*!*							S4=S4+round(xcur*.4,0)   	        
*!*						endif

*!*						if xcur>=25000
*!*							S4S=S4S+(25000*.4)	        
*!*						else
*!*							S4S=S4S+round(xcur*.4,0)   	        
*!*						endif


*!*						if xcur - statehsval >= 10000 && chged from 25000 to 10000 06/05/08
*!*							s465 = s465 + (10000 * .4) && chged from 25000 to 10000 06/05/08	        
*!*						else
*!*							S465 = S465+round((xcur - statehsval)*.4,0) 	         	        
*!*						endif
*!*						 
*!*						s465 = s465 + round(statehsval * .4,0)

*!*						f4 = 0
*!*						

*!*						If xcur >= 10000
*!*						
*!*							If round(xcur * .4,0) - 4000 > round((currhomval - orighomval) * .4,0)
*!*							
*!*								f4c = f4c + round((currhomval - orighomval) * .4,0)
*!*								
*!*							Else
*!*							
*!*								f4c = f4c + round(xcur * .4,0) - 4000
*!*								
*!*							EndIf	
*!*												
*!*						EndIf	

*!*						If xcur >= 25000
*!*						
*!*							If round(xcur * .4,0) - 10000 > round((currhomval - orighomval) * .4,0)
*!*							
*!*								f4s = f4s + round((currhomval - orighomval) * .4,0)
*!*								
*!*							Else
*!*							
*!*								f4s = f4s + round(xcur * .4,0) - 10000
*!*								
*!*							EndIf	
*!*						
*!*						EndIf	

*!*						f4cnt = f4cnt + 1

*!*					Case lower(homeexempt) = 'f5'

*!*						S5COUNT=S5COUNT+1
*!*						if xcur>=125000
*!*							S5=S5+(125000*.4)
*!*						else
*!*							S5=S5+round(xcur*.4,0)   
*!*						endif
*!*					
*!*						If xcur >= 1250000
*!*											
*!*							If round(xcur * .4,0) - 50000 > round((currhomval - orighomval) * .4,0)
*!*							
*!*	*!*								f5  = f5 + round((currhomval - orighomval) * .4,0)
*!*								f5  = 0
*!*								
*!*								f5c = f5c + round((currhomval - orighomval) * .4,0)
*!*								
*!*								f5s = f5s + round((currhomval - orighomval) * .4,0)
*!*																						
*!*							Else
*!*							
*!*	*!*								f5  = f5 + round(xcur * .4,0) - 50000
*!*								f5  = 0

*!*								f5c = f5c + round(xcur * .4,0) - 50000
*!*								
*!*								f5s = f5c + round(xcur * .4,0) - 50000
*!*																						
*!*							EndIf	
*!*							
*!*						EndIf	

*!*						f5cnt = f5cnt + 1
*!*						
*!*				EndCase		

*!*			EndIf

*!*	***end mcintosh	  

*!*			If lower(defaults.coname) = 'baldwin'
*!*		
*!*				Do Case
*!*				
*!*					Case lower(homeexempt) = 'f1'
*!*					
*!*						If xcur >= 5000
*!*						
*!*							f1  = f1 + 2000 + round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f1  = f1 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If xcur >= 25000
*!*						
*!*							f1c  = f1c + 10000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f1c  = f1c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If xcur >= 25000
*!*						
*!*							f1s  = f1s + 10000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f1s  = f1s + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						f1cnt = f1cnt + 1

*!*					Case lower(homeexempt) = 'f4'
*!*					
*!*						If xcur >= 10000
*!*						
*!*							f4  = f4 + 4000 + round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f4  = f4 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If xcur >= 25000
*!*						
*!*							f4c  = f4c + 10000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f4c  = f4c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If xcur >= 25000
*!*						
*!*							f4s  = f4s + 10000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f4s  = f4s + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						f4cnt = f4cnt + 1

*!*					Case lower(homeexempt) = 'f5'
*!*					
*!*						If round(xcur * .4,0) >= 50000
*!*						
*!*							f5  = f5 + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f5  = f5 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							f5c  = f5c + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f5c  = f5c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							f5s  = f5s + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f5s  = f5s + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						f5cnt = f5cnt + 1
*!*						
*!*					Case lower(homeexempt) = 'fs'
*!*					
*!*						If round(xcur * .4,0) >= 50000
*!*						
*!*							fs  = fs + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							fs  = fs + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							fsc  = fsc + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							fsc  = fsc + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							fss  = fss + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							fss  = fss + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						fscnt = fscnt + 1
*!*						
*!*					Case lower(homeexempt) = 'f15'
*!*					
*!*						If round(xcur * .4,0) >= 4000
*!*						
*!*							f15  = f15 + 4000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f15  = f15 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 10000
*!*						
*!*							f15c  = f15c + 10000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f15c  = f15c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*								
*!*						f15s  = f15s + round(xcur * .4,0)

*!*						f15cnt = f15cnt + 1
*!*						

*!*					Case lower(homeexempt) = 'f16'
*!*					
*!*						If round(xcur * .4,0) >= 50000
*!*						
*!*							f16  = f16 + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f16  = f16 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							f16c  = f16c + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							f16c  = f16c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*								
*!*						f16s  = f16s + round(xcur * .4,0)

*!*						f16cnt = f16cnt + 1


*!*					Case lower(homeexempt) = 'fs16'
*!*					
*!*						If round(xcur * .4,0) >= 50000
*!*						
*!*							fs16  = fs16 + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							fs16  = fs16 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							fs16c  = fs16c + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							fs16c  = fs16c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*								
*!*						fs16s  = fs16s + round(xcur * .4,0)

*!*						fs16cnt = fs16cnt + 1
*!*						
*!*					Case lower(homeexempt) = 'l15'
*!*					
*!*						If round(xcur * .4,0) >= 4000
*!*						
*!*							l15  = l15 + 4000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							l15  = l15 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 10000
*!*						
*!*							l15c  = l15c + 10000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							l15c  = l15c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*								
*!*						l15s  = l15s + round(xcur * .4,0)

*!*						l15cnt = l15cnt + 1
*!*						
*!*					Case lower(homeexempt) = 'l16'
*!*					
*!*						If round(xcur * .4,0) >= 50000
*!*						
*!*							l16  = l16 + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							l16  = l16 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							l16c  = l16c + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							l16c  = l16c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*								
*!*						l16s  = l16s + round(xcur * .4,0)

*!*						l16cnt = l16cnt + 1
*!*						
*!*					Case lower(homeexempt) = 'ls16'
*!*					
*!*						If round(xcur * .4,0) >= 50000
*!*						
*!*							ls16  = ls16 + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							ls16  = ls16 + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*						If round(xcur*.4,0) >= 50000
*!*						
*!*							ls16c  = ls16c + 50000 + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*							
*!*						Else

*!*							ls16c  = ls16c + round(xcur * .4,0) + ;
*!*										round((orighomval - currhomval) * .4,0)
*!*												
*!*						EndIf	

*!*								
*!*						ls16s  = ls16s + round(xcur * .4,0)

*!*						ls16cnt = ls16cnt + 1
*!*						
*!*						

*!*				EndCase		
*!*			
*!*			EndIf && county name is Baldwin

*!*			sele realprop
*!*			
*!*			If digclass = 'B'
*!*			
*!*				sb = sb + round(xcur * .4,0) - round(histval * .4,0)
*!*				sbcount = sbcount + 1

*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','B',;
*!*	      					round(xcur * .4,0) - round(histval * .4,0),alias(),0,realprop.taxdistric)
*!*				
*!*			EndIf	

*!*			If HomeExempt = 'S7'
*!*				L9 = L9 + round(CurrHomVal*.4,0)
*!*				L9Count = L9Count + 1
*!*				
*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','7',;
*!*	      					round(CurrHomVal*.4,0),alias(),0,realprop.taxdistric)
*!*				
*!*			EndIf	    

*!*			If HomeExempt = 'S6'
*!*				L8 = L8 + round(OrigHomVal*.4,0)
*!*				L8Count = L8Count + 1
*!*				
*!*	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','6',;
*!*	      					round(CurrHomVal*.4,0),alias(),0,realprop.taxdistric)
*!*				
*!*			EndIf	    

*!*			If HomeExempt = 'S8'
*!*				L9 = L9 + round(CurrHomVal*.4,0)
*!*				L9Count = L9Count + 1
*!*				L8 = L8 + round(OrigHomVal*.4,0)
*!*				L8Count = L8Count + 1
*!*			EndIf	    
*!*		

*!*			If homeexempt = 'L1 '

*!*				Do Case
*!*				
*!*					Case at('lowndes',lower(defaults.coname)) > 0
*!*					
*!*						L1Count = L1Count + 1
*!*						
*!*				     if xcur >= 5000
*!*				        L1 = L1+(5000*.4)	        
*!*				     else
*!*				        L1 = L1+round(xcur*.4,0)   	        
*!*				     endif

*!*				     if xcur >= 25000
*!*				        L1s = L1s+(25000*.4)	        
*!*				     else
*!*				        L1s = L1s+round(xcur*.4,0)   	        
*!*				     endif

*!*					Case at('dougherty',lower(defaults.coname)) > 0			     

*!*						L1Count = L1Count + 1
*!*						
*!*				     if xcur >= 5000
*!*				        L1 = L1+(5000*.4)	        
*!*				     else
*!*				        L1 = L1+round(xcur*.4,0)   	        
*!*				     endif

*!*				     if xcur >= 5000
*!*				        L1s = L1s+(5000*.4)	        
*!*				     else
*!*				        L1s = L1s+round(xcur*.4,0)   	        
*!*				     endif
*!*				     
*!*			  EndCase   

*!*			EndIf
*!*			
*!*		  if homeexempt='S1' 
*!*		  
*!*		  	Do Case
*!*		  	
*!*		  		Case lower(defaults.coname) <> 'baldwin'
*!*		  
*!*		*	     L1COUNT=L1COUNT+1
*!*			     S1Count=S1Count+1 
*!*			     if xcur>=5000
*!*			        S1=S1+(5000*.4)	 
*!*			        
*!*				      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','1',;
*!*				      					2000,alias(),0,realprop.taxdistric)
*!*			               
*!*			     else
*!*			        S1=S1+round(xcur*.4,0)
*!*				      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','1',;
*!*				      					round(xcur*.4,0),alias(),0,realprop.taxdistric)
*!*			           	        
*!*			     endif
*!*			     
*!*				  Case lower(defaults.coname) = 'baldwin'

*!*				     S1Count=S1Count+1 
*!*				     if xcur>=10000
*!*				        S1=S1+(10000*.4)	        
*!*				     else
*!*				        S1=S1+round(xcur*.4,0)   	        
*!*				     endif
*!*				     
*!*				     
*!*				EndCase

*!*		  endif && homeexempt = 's1'
*!*		  
*!*		  if homeexempt='S2'
*!*		  
*!*		     L2COUNT=L2COUNT+1
*!*		     S2Count=S2Count+1
*!*		     if xcur >= 10000
*!*		        S2=S2+(10000*.4)	        
*!*		     else
*!*		        S2=S2+round(xcur*.4,0)   	        
*!*		     endif
*!*		     
*!*		  endif
*!*		  
*!*		  If homeexempt = 'SC'
*!*		  
*!*		  	sccount = sccount + 1

*!*		    if xcur >= 5000
*!*		       Scc = Scc+(5000*.4)
*!*		      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','C',;
*!*		      					2000,alias(),0,realprop.taxdistric)
*!*		       
*!*		    else
*!*		       Scc = Scc+round(xcur*.4,0)
*!*		      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','C',;
*!*		      					round(xcur*.4,0),alias(),0,realprop.taxdistric)
*!*		        
*!*		    endif
*!*		    
*!*		    if xcur - statehsval >= 5000
*!*		       sc65 = sc65 + (5000 * .4) 	        
*!*		    else
*!*		       Sc65 = Sc65+round((xcur - statehsval)*.4,0) 	         	        
*!*		    endif
*!*		    
*!*		    sc65 = sc65 + round(statehsval *.4,0)
*!*		 
*!*		 EndIf 	

*!*	**left off here with baldwin
*!*		  
*!*		  if homeexempt='S3'
*!*		     L3COUNT=L3COUNT+1
*!*		     S3Count=S3Count+1
*!*		     if xcur>=5000
*!*		        S3=S3+(5000*.4)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','3',;
*!*			      					2000,alias(),0,realprop.taxdistric)
*!*		        	        
*!*		     else
*!*		        S3=S3+round(xcur*.4,0)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','3',;
*!*			      					round(xcur*.4,0),alias(),0,realprop.taxdistric)
*!*		           	        
*!*		     endif

*!*		     if xcur>=25000
*!*		        S3S=S3S+(25000*.4)	        
*!*		     else
*!*		        S3S=S3S+round(xcur*.4,0)   	        
*!*		     endif
*!*		     
*!*		  endif

*!*		  if homeexempt='S4' or (at('franklin',lower(defaults.coname)) > 0 and homeexempt = 'L4')

*!*		     S4COUNT=S4COUNT+1	
*!*		     
*!*		     If at('franklin',lower(defaults.coname)) > 0
*!*		     
*!*			     if xcur >= 25000
*!*			        S4 = S4 + (25000 * .4)
*!*			     else
*!*			        S4 = S4 + round(xcur * .4,0)   	        
*!*			     endif
*!*		     
*!*		     Else      

*!*			     if xcur>=10000
*!*			        S4=S4+(10000*.4)
*!*				      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','4',;
*!*				      					4000,alias(),0,realprop.taxdistric)
*!*			        
*!*			     else
*!*			        S4=S4+round(xcur*.4,0) 
*!*				      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','4',;
*!*				      					round(xcur*.4,0),alias(),0,realprop.taxdistric)
*!*			          	        
*!*			     endif
*!*			     
*!*			    EndIf 

*!*		     if xcur>=25000
*!*		        S4S=S4S+(25000*.4)	        
*!*		     else
*!*		        S4S=S4S+round(xcur*.4,0)   	        
*!*		     endif


*!*		    if xcur - statehsval >= 10000 && chged from 25000 to 10000 06/05/08
*!*		       s465 = s465 + (10000 * .4) && chged from 25000 to 10000 06/05/08	        
*!*		    else
*!*		       S465 = S465+round((xcur - statehsval)*.4,0) 	         	        
*!*		    endif
*!*		     
*!*		     s465 = s465 + round(statehsval * .4,0)
*!*		     
*!*		  endif
*!*		  
*!*		  if homeexempt='S5'
*!*		  	 L5COUNT=L5COUNT+1 	
*!*		     S5COUNT=S5COUNT+1
*!*		     if xcur - ncovex >=125000
*!*		        S5=S5+(125000*.4)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','5',;
*!*			      					50000,alias(),0,realprop.taxdistric)
*!*		        
*!*		     else
*!*		        S5=S5+round((xcur - ncovex) *.4,0)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','5',;
*!*			      					round((xcur - ncovex) *.4,0),alias(),0,realprop.taxdistric)
*!*		           
*!*		     endif
*!*		  endif

*!*		  if homeexempt='SD'
*!*		  
*!*		  	 sdCOUNT=sdCOUNT+1 	
*!*		     if xcur>=125000
*!*		        sd=sd+(125000*.4)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','D',;
*!*			      					50000,alias(),0,realprop.taxdistric)
*!*		        
*!*		     else
*!*		        Sd=Sd+round(xcur*.4,0)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','D',;
*!*			      					round(xcur *.4,0),alias(),0,realprop.taxdistric)
*!*		           
*!*		     endif

*!*		    if xcur - statehsval >= 125000
*!*		       sd65 = sd65 + (1255000 * .4) 	        
*!*		    else
*!*		       Sd65 = Sd65+round((xcur - statehsval)*.4,0) 	         	        
*!*		    endif

*!*		     
*!*		     sd65 = sd65 + round(statehsval * .4,0)
*!*		     
*!*		  endif


*!*		  if homeexempt='SE'
*!*		  	
*!*		     SECOUNT=SECOUNT+1
*!*		     if xcur>=125000
*!*		        SE=SE+(125000*.4)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','E',;
*!*			      					50000,alias(),0,realprop.taxdistric)
*!*		        
*!*		     else
*!*		        SE=SE+round(xcur*.4,0)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','E',;
*!*			      					round(xcur *.4,0),alias(),0,realprop.taxdistric)
*!*		           
*!*		     endif
*!*		     
*!*		    if xcur - statehsval >= 1255000
*!*		       se65 = se65 + (1255000 * .4) 	        
*!*		    else
*!*		       Se65 = Se65+round((xcur - statehsval)*.4,0) 	         	        
*!*		    endif
*!*		     
*!*		     SE65 = SE65 + round(statehsval * .4,0)
*!*		     
*!*		  endif
*!*		  
*!*		  If homeexempt = 'SG'
*!*		  
*!*		  	sgcount = sgcount + 1
*!*		  	
*!*		  	sg = sg + round(xcur * .4,0)
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','G',;
*!*			      					round(xcur *.4,0),alias(),0,realprop.taxdistric)
*!*		  	
*!*		  	
*!*		  EndIf	


*!*		  if homeexempt='S6'
*!*		  	 L6COUNT=L6COUNT+1 	
*!*		     S6COUNT=S6COUNT+1
*!*		     s6 = s6 + (round(currhomval*.4,0) - round(orighomval*.4,0))
*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','6',;
*!*	      					(round(currhomval*.4,0) - round(orighomval*.4,0)),alias(),0,realprop.taxdistric)

*!*		     if xcur>=5000
*!*		        S6s=S6s+(5000*.4)	
*!*		                
*!*		     else
*!*		        S6s=S6s+round(xcur*.4,0)
*!*		     endif
*!*		     
*!*		  endif

*!*		  if homeexempt='S7'
*!*		  	 L7COUNT=L7COUNT+1 	
*!*		     S7COUNT=S7COUNT+1
*!*		     s7 = s7 + (round(currhomval*.4,0) - round(orighomval*.4,0))
*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','7',;
*!*	      					(round(currhomval*.4,0) - round(orighomval*.4,0)),alias(),0,realprop.taxdistric)
*!*		     
*!*		     if xcur>=10000
*!*		        S7s=S7s+(10000*.4)	        
*!*		     else
*!*		        S7s=S7s+round(xcur*.4,0)   	        
*!*		     endif
*!*		     
*!*		  endif

*!*		  if homeexempt='S8'
*!*		  	 L8COUNT=L8COUNT+1 	
*!*		     S8COUNT=S8COUNT+1
*!*		     s8 = s8 + (round(currhomval*.4,0) - round(orighomval*.4,0))
*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','8',;
*!*	      					(round(currhomval*.4,0) - round(orighomval*.4,0)),alias(),0,realprop.taxdistric)
*!*		     
*!*		     if xcur>=25000
*!*		        S8S=S8S+(25000*.4)	        
*!*		     else
*!*		        S8S=S8S+round(xcur*.4,0)   	        
*!*		     endif
*!*		     
*!*		  endif

*!*		  if homeexempt='S9'
*!*		  	 L9COUNT=L9COUNT+1 	
*!*		     S9COUNT=S9COUNT+1
*!*		     s9 = s9 + (round(currhomval*.4,0) - round(orighomval*.4,0))
*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','9',;
*!*	      					(round(currhomval*.4,0) - round(orighomval*.4,0)),alias(),0,realprop.taxdistric)
*!*		     
*!*		     if xcur>=25000
*!*		        S9S=S9S+(25000*.4)	        
*!*		     else
*!*		        S9S=S9S+round(xcur*.4,0)   	        
*!*		     endif
*!*		     
*!*		  endif

*!*		  if homeexempt='SS'
*!*		     SSCOUNT=SSCOUNT+1
*!*		     if xcur>=125000
*!*		        SS=SS+(125000*.4)
*!*		      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','S',;
*!*		      					50000,alias(),0,realprop.taxdistric)
*!*		        
*!*		     else
*!*		        SS=SS+round(xcur*.4,0) 
*!*			      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','S',;
*!*			      					round(xcur*.4,0),alias(),0,realprop.taxdistric)
*!*		          
*!*		     endif
*!*		  endif
*!*		  
*!*		  if HistVal > 0 .and. DigClass = 'H'
*!*		  	histcnt = histcnt + 1
*!*		  	histex = histex + iif(xcur - histval > 0,(round((xcur - HistVal)*.4,0)), 0)
*!*		  	
*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','H',;
*!*	      					(round((xcur - HistVal)*.4,0)),alias(),0,realprop.taxdistric)
*!*		  	
*!*		  endif	
*!*		  if HistVal > 0 .and. DigClass = 'T'
*!*		  	trancnt = trancnt + 1
*!*		  	tranex = tranex + (round((xcur - HistVal)*.4,0))
*!*	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','T',;
*!*	      					(round((xcur - HistVal)*.4,0)),alias(),0,realprop.taxdistric)
*!*		  	
*!*		  endif
*!*		  
*!*		  If Ezy > '    ' and Ez_Exempt > 0
*!*		  
*!*		  	sx      = sx + round(ez_exempt * .4,0)
*!*		  	sxcount = sxcount + 1

*!*		    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','X',;
*!*		    					round(ez_exempt * .4,0),alias(),0,realprop.taxdistric)
*!*		  	
*!*		  EndIf
*!*		  	
*!*		  
*!*		  skip 
*!*		enddo

  sele A
  copy struc to sacount
  
  sele 35
  use sacount
  
  sele a
  go top
  clear
  @ 8, 0 say padc('Summing Pref Land',80)

  Do While !Eof()

		ltd = .f.
		
		sele tdtemp
		
		loca for taxdistric = realprop.taxdistric
		  
		If found()
			ltd = .t.  
		EndIf
		
		sele realprop
			
	  If !ltd 
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  EndIf

	 
		If val(realprop.pcy) > 0
			If defaults.digyr - val(pcy) >= 10
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
			
			EndIf
		EndIf	
	 

	  If mavpref > 0 and digclass = 'P'
	  	Pref1 = Pref1 + iif(sale_val, round(saleland2*.4,0),round(mavpref*.4,0))
	  	Pref1Ct = Pref1Ct + 1
	  	
	  	sele sacount
	  	appen blank
	  	
	  	repl realkey with realprop.realkey
	  	
	  	sele realprop
	  	
	  EndIf	
	  
	  
		skip
	EndDo	
	

	sele A

	sele C

	go top
	clear
	@ 8, 0 say padc('Summing Pref Accessories',80)
	Do While !eof()

		If realkey = 0
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf
		
		

		sele realprop
		seek acessory.realkey
		
		

		If !found()
			sele acessory
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf

		lfr  = .f.
		lsb3 = .f.
		
		If sale_val
			lsb3 = .t.
		EndIf
			
	  If found()
	  	lft = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele acessory
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	

		sele realprop		
		
		If lfr
			If val(realprop.ccy) > 0
				If defaults.digyr - val(pcy) >= 10
					sele acessory
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
			Else
				sele acessory
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf	
		EndIf			

		sele acessory


		If DigClass = 'P'
			AcPref = AcPref + iif(lsb3,round((sb346val+sb346add)*.4,0),round(mav*.4,0))
		EndIf
		skip	
	EndDo




	sele A
	go top
	clear
	@ 8, 0 say padc('Summing CU Land',80)
	Do While !eof()

		ltd = .f.
		
		sele tdtemp
		
		loca for taxdistric = realprop.taxdistric
		  
		If found()
			ltd = .t.  
		EndIf
		
		sele realprop
			
	  If !ltd 
	  	skip
	  	If !eof()
	  		loop
	  	Else
	  		exit
	  	EndIf
	  EndIf
	 
		If val(realprop.ccy) > 0
			If defaults.digyr - val(ccy) >= 10
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
			
			EndIf
		EndIf	
	 

		If digclass='V' and defaults.digyr - val(realprop.ccy) < 10 
			CuFmv1 = CuFmv1 + iif(sale_val, round(saleland1*.4,0),round(mavag*.4,0))
		EndIf	
		
		
		If digclass='W' and defaults.digyr - val(realprop.ccy) < 10 
			SwFmv1 = SwFmv1 + iif(sale_val, round(saleland1*.4,0),round(mavag*.4,0))
		EndIf	
		
		skip	
	EndDo
		
	  
	sele A

	sele C

	go top
	clear
	@ 8, 0 say padc('Summing CU Accessories',80)

	Do While !eof()

		sele realprop
		seek acessory.realkey

		If !found()
			sele acessory
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf

		lfr  = .f.
		lsb3 = .f.
		
		If sale_val
			lsb3 = .t.
		EndIf
			
	  If found()
	  	lfr = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele acessory
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	
		
			
		If lfr
			If val(realprop.ccy) > 0
				If defaults.digyr - val(realprop.ccy) >= 10
					sele acessory
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
			Else
				sele acessory
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf	
		EndIf			



		sele acessory

	  If DigClass = 'V' and defaults.digyr - val(realprop.ccy) < 10 
			CuAcc = CuAcc + iif(lsb3, round((sb346val+sb346add)*.4,0),round(mav*.4,0))
		EndIf
		
	  If DigClass = 'W'  and defaults.digyr - val(realprop.ccy) < 10  
			SwAcc = SwAcc + iif(lsb3, round((sb346val+sb346add)*.4,0),round(mav*.4,0))
		EndIf
		
		skip	
	EndDo

	sele F
  use conmai shared
  copy struc to svcount_mav
  
  sele 33
  use svcount_mav
  
  sele f

  go top
  clear
  @ 8, 0 say padc('Summing CU Totals',80)
  Do While !eof()

		sele realprop
		seek conmai.realkey

		If !found()
			sele conmai
			skip
			If !eof()
				loop
			Else
				exit
			EndIf
		EndIf
		
		lfr = .f.
		
	  If found()
	  	lft = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele conmai
	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	

		If lfr
			If val(realprop.ccy) > 0
				If defaults.digyr - val(ccy) >= 10
					sele conmai
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
			Else
				sele conmai
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf	
		EndIf			

		sele conmai
		
		If realprop.digclass = 'V'
		
	    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','V',;
	    					(round(conmai.curr_ex*.4,0)),alias(),0,realprop.taxdistric)
	    					
	  Else

	    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','W',;
	    					(round(conmai.curr_ex*.4,0)),alias(),0,realprop.taxdistric)
	  
	  EndIf  					
		
		n = 9
		Do While n > -1
			m = str(n,1,0)
			If dat&m = defaults.digyr
			
				If val&m > 0
				
					If realprop.digclass <> 'W'
				  	CuTot = CuTot + round(Val&m*.4,0)
		  			CuCnt = CuCnt + 1
		  			
		  			sele svcount_mav
		  			appen blank
		  			
		  			replace realkey with conmai.realkey,;
		  							origconval with round(conmai.Val&m*.4,0)
		  			
		  			sele conmai
		  			
		  		Else
		  			SwTot = SwTot + round(val&m*.4,0)
		  			SwCnt = SwCnt + 1
		  		EndIf
		  				
	  		EndIf
	  			
  			exit
  		EndIf	
  		n = n - 1
  	EndDo	
  	skip
  EndDo
  
  sele svcount_mav
  append blank
  
  replace parentparc with 'Summary',;
  				val0 with cutot,;
  				val1 with cufmv1,;
  				val2 with cufmv2,;
  				val3 with cuacc


**summing flpa exemption
	If file('flpamain.dbf')
		sele 14
		use flpamain shar
		set order to realkey	

		sele A
		go top
		clear
		@ 8, 0 say padc('Summing FLPA Land',80)
		Do While !eof()

			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
		
			sele realprop
				
		  If !ltd 
		  	skip
		  	If !eof()
		  		loop
		  	Else
		  		exit
		  	EndIf
		  EndIf
		  
			If val(realprop.flcy) > 0
			
				If defaults.digyr - val(flcy) >= 15
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
				
				EndIf
				
			EndIf	

			sele flpamain
			seek realprop.realkey
			
			sele realprop
			
			If flpamain.currcovval < mavag
			
				If digclass='J' and defaults.digyr - val(realprop.flcy) < 15 
				
					SjFmv1 = SjFmv1 + iif(sale_val, round(saleland1*.4,0),round(mavag*.4,0))
					
				EndIf	
				
*!*					If digclass='J' and defaults.digyr - val(realprop.flcy) < 15
*!*					 	
*!*						SjFmv2 = SjFmv2 + round(mavag*.4,0)
*!*									
*!*					EndIf
				
			EndIf	
			
			skip	
			
		EndDo
		
	**here

		sele 14
	  use flpamain shared
	  copy struc to sjcount_mav
	  
	  sele 33
	  use sjcount_mav
	  
	  sele 14

	  go top
	  clear
	  @ 8, 0 say padc('Summing FLPA Totals',80)
	  Do While !eof()

			sele realprop
			seek flpamain.realkey

			If !found()
				sele flpamain
				skip
				If !eof()
					loop
				Else
					exit
				EndIf
			EndIf
			
			lfr = .f.
			
		  If found()
		  	lft = .t.
				ltd = .f.
				
				sele tdtemp
				
				loca for taxdistric = realprop.taxdistric
				  
				If found()
					ltd = .t.  
				EndIf
				
	  
		  	sele flpamain
		  	
		  	
		  	
		  	If !ltd
			  	skip
			  	If !eof()
		  			loop
		  		Else
		  			exit
			  	EndIf		
			  EndIf	
		  EndIf	

			If lfr
				If val(realprop.flcy) > 0
					If defaults.digyr - val(flcy) >= 15
						sele flpamain
						skip
						If !eof()
							loop
						Else
							exit
						EndIf
					
					EndIf
				Else
					sele flpamain
					skip
					If !eof()
						loop
					Else
						exit
					EndIf
					
				EndIf	
			EndIf			

			sele flpamain
			
	    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','J',;
	    					(round(flpamain.currex*.4,0)),alias(),0,realprop.taxdistric)
			
			n = 15
			
			Do While n > 0
			
				m = alltrim(str(n,2,0))
				
				If dat&m = defaults.digyr
				
					If val&m > 0
					
						If realprop.digclass = 'J'
						
							If val&m < realprop.mavag
							
						  	SjTot = SjTot + round(Val&m*.4,0)
						  	
						  EndIf
						  	
			  			SjCnt = SjCnt + 1
			  			
			  			sele sjcount_mav
			  			appen blank
			  			
			  			replace realkey with flpamain.realkey
			  			
			  			sele flpamain
			  			
			  		EndIf	

		  		EndIf
		  			
	  			exit
	  		EndIf	
	  		n = n - 1
	  	EndDo	
	  	skip
	  EndDo
	
	EndIf
	  
	close databases
	
***begin personal property


	sele b
	use cons_value_mav
	
	sele g
	use defaults
	
	sele h
	use tdtemp
	
	sele c
	use taxdist
	
	sele d
	use invn
	index on perskey to xd

	sele a
	use personal	
	index on ownkey to ok	
	
  go top
  All = 1 
  clear


	clear
	
	c75 = ' '
	
	@10,20 say 'Include Accounts less than MAV 7501? (Y/N)' get c75 ;
	valid(lower(c75) = 'y' or lower(c75) = 'n')
	
	read
	  
  Messx = 'Personal Property'
  HMany = 0
  Do While .not. Eof()

    If All = 1
    	
    	ok = ownkey
    	cv = 0

    	
    	Do While ownkey = ok and !eof()
    		cv = cv + mavcurr 
    		skip
    	EndDo
    	

			If lower(c75) = 'n'
	    	If cv > 7500
		    	seek ok
		    Else
		    	If !eof()
		    		loop
		    	Else
		    		exit
		    	EndIf
		    EndIf
		  Else
		  	seek ok  				
		  EndIf  

    	
*    	seek ok
   	
			Do While ownkey = ok and !eof()

			
				ltd   = .f.
				lfp   = .f.
				nfpct = 0
				
				sele tdtemp
				
				loca for taxdistric = personal.taxdistric
				  
				If found()
					ltd = .t. 
					
					sele taxdist
					locate for taxdistric = tdtemp.taxdistric
					
					If found() 
					
						If co_fp_rm + co_fp_fg + co_fp_os > 0
						
							lfp = .t.
							
							Do Case
								
								Case co_fp_rm > 0
									nfpct = co_fp_rm
								Case co_fp_fg > 0
									nfpct = co_fp_fg
								Case co_fp_os > 0
									nfpct = co_fp_os
											
							EndCase
							
						EndIf
							
					EndIf
					 
				EndIf
				
				sele personal
					
			  If !ltd 
			  	skip
			  	If !eof()
			  		loop
			  	Else
			  		exit
			  	EndIf
			  EndIf
			
	    	Do Case	
		      Case propclass = 'R'
		        RBTOT=RBTOT+round(mavboat*.4,0)
		        
		        IF mavboat>0
		          RBNUM=RBNUM+1
		        ENDIF
		        RATOT=RATOT+round(mavplane*.4,0)
		        IF mavplane>0
		          RANUM=RANUM+1
		        ENDIF
		        IF lfp
		          RITOT=RITOT+;
		          round((mavinvn-((ROUND(mavfrport/nfpct,0))-mavfrport))*.4,0)
		          IF mavinvn-((mavfrport/nfpct)-mavfrport)>0
		            RINUM=RINUM+1
		          ENDIF
		        ELSE
		          RITOT=RITOT+round(mavinvn*.4,0)
		          IF mavinvn>0
		            RINUM=RINUM+1
		          ENDIF
		        ENDIF
		        IF lfp
		          RPTOT=RPTOT+round(ROUND(mavfrport/nfpct,0)*.4,0)
		          IF mavfrport>0
		            RPNUM=RPNUM+1
		          ENDIF  
		        ENDIF
		        RZTOT=RZTOT+round(mavother*.4,0)
		        IF mavother>0
		          RZNUM=RZNUM+1
		        ENDIF  
		        RFTOT=RFTOT+round(mavmeff*.4,0)
		        IF mavmeff>0
		          RFNUM=RFNUM+1
		        ENDIF
		        RCURR=RCURR+round(mavcurr*.4,0)
		        RCurrNum=RCurrNum+1
		      Case propclass = 'A'
		        ABTOT=ABTOT+round(mavboat*.4,0)
		        IF mavboat>0
		          ABNUM=ABNUM+1
		        ENDIF
		        AATOT=AATOT+round(mavplane*.4,0)
		        IF mavplane>0
		          AANUM=AANUM+1
		        ENDIF
		        IF lfp
		          AITOT=AITOT+;
		          round((mavinvn-((ROUND(mavfrport/nfpct,0))-mavfrport))*.4,0)
		          IF mavinvn-((mavfrport/nfpct)-mavfrport)>0
		            AINUM=AINUM+1
		          ENDIF
		        ELSE
		          AITOT=AITOT+round(mavinvn*.4,0)
		          IF mavinvn>0
		            AINUM=AINUM+1
		          ENDIF
		        ENDIF
		        IF lfp
		          APTOT=APTOT+round(ROUND(mavfrport/nfpct,0)*.4,0)
		          IF mavfrport>0
		            APNUM=APNUM+1
		          ENDIF  
		        ENDIF
		        AZTOT=AZTOT+round(mavother*.4,0)
		        IF mavother>0
		          AZNUM=AZNUM+1
		        ENDIF  
		        AFTOT=AFTOT+round(mavmeff*.4,0)
		        IF mavmeff>0
		          AFNUM=AFNUM+1
		        ENDIF
		        ACURR=ACURR+round(mavcurr*.4,0)
		        ACurrNum=ACurrNum+1
		        
		      Case propclass = 'C'
		      
		        CBTOT=CBTOT+round(mavboat*.4,0)
		        IF mavboat>0
		          CBNUM=CBNUM+1
		        ENDIF
		        CATOT=CATOT+round(mavplane*.4,0)
		        IF mavplane>0
		          CANUM=CANUM+1
		        ENDIF
		        IF lfp
		        
		        	sele invn
		        	seek personal.perskey
		        	
		        	sele personal
		        	
		          CITOT=CITOT+ round((invn.mav - invn.mavgrs)*.4,0)    &&round((mavinvn-((ROUND(mavfrport/nfpct,0))-mavfrport))*.4,0)
		          
		          IF invn.mav - invn.mavgrs > 0
		          
			          sele cons_value_mav
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round((invn.mav - invn.mavgrs)*.4,0),; 
			          				digclass with personal.propclass,;
			          				digstrat with 'I'

			          sele personal  &&round((personal.mavinvn-((ROUND(personal.mavfrport/nfpct,0))-personal.mavfrport))*.4,0)
		          
		            CINUM=CINUM+1
		          ENDIF
		        ELSE
		          CITOT=CITOT+round(mavinvn*.4,0)
		          
		          IF mavinvn>0
		          
			          sele cons_value_mav
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round(personal.mavinvn*.4,0),;
			          				digclass with personal.propclass,;
			          				digstrat with 'I'
			          				
			          sele personal

		          
		            CINUM=CINUM+1
		          ENDIF
		        ENDIF
		        IF lfp
		        
		        	sele invn
		        	seek personal.perskey
		        	
		        	sele personal
		        	
		          CPTOT=CPTOT+ round(invn.mavgrs * .4,0) &&round(ROUND(mavfrport/nfpct,0)*.4,0)
		          
		          IF mavfrport>0
		          
			          sele cons_value_mav
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round(invn.mavgrs*.4,0),;  
			          				digclass with personal.propclass,;
			          				digstrat with 'P'

			          				
			          sele personal
		          
		            CPNUM=CPNUM+1
		          ENDIF  
		        ENDIF
		        
		        CZTOT=CZTOT+round(mavother*.4,0)
		        IF mavother>0
		          CZNUM=CZNUM+1
		        ENDIF  
		        CFTOT=CFTOT+round(mavmeff*.4,0)
	        
		        IF mavmeff>0
		          CFNUM=CFNUM+1
		        ENDIF
		        CCURR=CCURR+round(mavcurr*.4,0)
		        CCurrNum=CCurrNum+1
		        
		      Case propclass = 'I'
		      
		        IBTOT=IBTOT+round(mavboat*.4,0)
		        IF mavboat>0
		          IBNUM=IBNUM+1
		        ENDIF
		        IATOT=IATOT+round(mavplane*.4,0)
		        IF mavplane>0
		          IANUM=IANUM+1
		        ENDIF
		        IF lfp
		        
		        	sele invn
		        	seek personal.perskey
		        	
		        	sele personal
		        	
		          IITOT=IITOT+round((invn.mav - invn.mavgrs)*.4,0) &&round((mavinvn-((ROUND(personal.mavfrport/nfpct,0))-personal.mavfrport))*.4,0)
		          
		          
		          IF invn.mav - invn.mavgrs >0
		          
			          sele cons_value_mav
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round((invn.mav - invn.mavgrs)*.4,0),; 
			          				digclass with personal.propclass,;
			          				digstrat with 'I'

			          sele personal  &&round((personal.mavinvn-((ROUND(personal.mavfrport/nfpct,0))-personal.mavfrport))*.4,0)
		          
		            IINUM=IINUM+1
		          ENDIF
		        ELSE
		          IITOT=IITOT+round(mavinvn*.4,0)
		          IF mavinvn>0
		          
			          sele cons_value_mav
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round(personal.mavinvn*.4,0),;
			          				digclass with personal.propclass,;
			          				digstrat with 'I'
			          				
			          sele personal
		          
		            IINUM=IINUM+1
		          ENDIF
		        ENDIF
		        IF lfp
		        
		        	sele invn
		        	seek personal.perskey
		        	
		        	sele personal
		        	
		          IPTOT=IPTOT+round(invn.mavgrs*.4,0) &&round(ROUND(mavfrport/nfpct,0)*.4,0)
		          
		          IF mavfrport>0

			          sele cons_value_mav
			          appen blank
			          
			          replace perskey with personal.perskey,;
			          				value40 with round(invn.mavgrs*.4,0),;  
			          				digclass with personal.propclass,;
			          				digstrat with 'P'
	          				
			          sele personal  &&round(ROUND(personal.mavfrport/nfpct,0)*.4,0)
		          
		            IPNUM=IPNUM+1
		          ENDIF  
		        ENDIF
		        IZTOT=IZTOT+round(mavother*.4,0)
		        IF mavother>0
		          IZNUM=IZNUM+1
		        ENDIF  
		        IFTOT=IFTOT+round(mavmeff*.4,0)
		        IF mavmeff>0
		          IFNUM=IFNUM+1
		        ENDIF
		        ICURR=ICURR+round(mavcurr*.4,0)
		        ICurrNum=ICurrNum+1
		      Case propclass = 'U'
		        UBTOT=UBTOT+round(mavboat*.4,0)
		        IF mavboat>0
		          UBNUM=UBNUM+1
		        ENDIF
		        UATOT=UATOT+round(mavplane*.4,0)
		        IF mavplane>0
		          UANUM=UANUM+1
		        ENDIF
		        IF lfp
		          UITOT=UITOT+;
		          round((mavinvn-((ROUND(mavfrport/nfpct,0))-mavfrport))*.4,0)
		          IF mavinvn-((mavfrport/nfpct)-mavfrport)>0
		            UINUM=UINUM+1
		          ENDIF
		        ELSE
		          UITOT=UITOT+round(mavinvn*.4,0)
		          IF mavinvn>0
		            UINUM=UINUM+1
		          ENDIF
		        ENDIF
		        IF lfp
		          UPTOT=UPTOT+round(ROUND(mavfrport/nfpct,0)*.4,0)
		          IF mavfrport>0
		            UPNUM=UPNUM+1
		          ENDIF  
		        ENDIF
		        UZTOT=UZTOT+round(mavother*.4,0)
		        IF mavother>0
		          UZNUM=UZNUM+1
		        ENDIF  
		        mu2=mu2+round(mavmeff*.4,0)
		        IF mavmeff>0
		          mU2c=mU2c+1
		        ENDIF
		        UCURR=UCURR+round(mavcurr*.4,0)
		        UCurrNum=UCurrNum+1
*!*			      Case propclass = 'E' .and. strata = '0'
*!*		  	      If mavcurr > 0
*!*		    	      E0TOT = E0TOT + round(mavcurr*.4,0)
*!*		      	    E0NUM = E0NUM + 1
*!*		        	EndIf
	      EndCase

				If propclass <> 'E'

		      FREETOT=FREETOT+round(mavfrport*.4,0)
		      IF mavfrport>0
		      
	          sele cons_value_mav
	          appen blank
	          
	          replace perskey with personal.perskey,;
	          				value40 with ROUND(personal.mavfrport*.4,0),;
	          				digclass with 'S',;
	          				digstrat with 'F'
	          				
	          sele personal
		      
		        FREENUM=FREENUM+1
		      ENDIF
			
				EndIf
					      
	      If propclass <> 'E'
	        CURRTOT=CURRTOT+round(mavcurr*.4,0)

	        CURRNUM=CURRNUM+1
	      EndIf

	      IF cv < 7501 .and. propclass <> 'E' and mavcurr > 0
		      SPNUM=SPNUM+1
	  	    SPTOT=SPTOT+round(mavcurr*.4,0)
	  	    
			    cons_value_mav(0,' ',personal.perskey,0,0,0,'S','P',;
			    					(round(mavcurr*.4,0)),alias(),0,personal.taxdistric)
	  	    
	    	ENDIF

	      IF PropClass + Strata = 'E1'
	        E1TOT = E1TOT + round(mavcurr*.4,0)
	        E1NUM = E1NUM + 1
	      ENDIF


	      IF PropClass + Strata = 'E2'
	        E2TOT = E2TOT + round(mavcurr*.4,0)
	        E2NUM = E2NUM + 1
	      ENDIF

	      IF PropClass + Strata = 'E3'
	        E3TOT = E3TOT + round(mavcurr*.4,0)
	        E3NUM = E3NUM + 1
	      ENDIF

	      IF PropClass + Strata = 'E4'
	        E4TOT = E4TOT + round(mavcurr*.4,0)
	        E4NUM = E4NUM + 1
	      ENDIF
	 
	      IF PropClass + Strata = 'E5'
	        E5TOT = E5TOT + round(mavcurr*.4,0)
	        E5NUM = E5NUM + 1
	      ENDIF
	  
	      IF PropClass + Strata = 'E6'
	        E6TOT = E6TOT + round(mavcurr*.4,0)
	        E6NUM = E6NUM + 1  
	      ENDIF

	      IF PropClass + Strata = 'E7'
	        E7TOT = E7TOT + round(mavcurr*.4,0)
	        E7NUM = E7NUM + 1  
	      ENDIF

	      IF PropClass + Strata = 'E8' 
	        E8TOT = E8TOT + round(mavcurr*.4,0)
	        E8NUM = E8NUM + 1
	      ENDIF

	      IF PropClass + Strata = 'E9' 
	        E9TOT = E9TOT + round(mavcurr*.4,0)
	        E9NUM = E9NUM + 1  
	      ENDIF

	      IF PropClass + Strata = 'E0' 
      
	        E0TOT = E0TOT + round(mavcurr*.4,0)
	        E0NUM = E0NUM + 1  
	        
	      ENDIF         

	      If hde_exempt > 0
	      
	      	sy      = sy + round(hde_exempt * .4,0)
	      	sycount = sycount + 1 

			    cons_value_mav(0,' ',personal.perskey,0,0,0,'S','Y',;
			    					(round(hde_exempt*.4,0)),alias(),0,personal.taxdistric)

	      	
	      EndIf	
	      
	      sele personal        

				If mavmeff > 0 and propclass <> 'E'

          sele cons_value_mav
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.mavmeff*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'F'

          sele personal
	          
				EndIf
				
				If mavboat > 0 and propclass <> 'E'

          sele cons_value_mav
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.mavboat*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'B'

          sele personal
	          
				EndIf
					          
				If mavplane > 0 and propclass <> 'E'

          sele cons_value_mav
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.mavplane*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'A'

          sele personal
	          
				EndIf

				If mavother > 0 and propclass <> 'E'

          sele cons_value_mav
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.mavother*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with 'Z'

          sele personal
	          
				EndIf
				
				If propclass = 'E'

          sele cons_value_mav
          appen blank
          
          replace perskey with personal.perskey,;
          				value40 with round(personal.mavcurr*.4,0),; 
          				digclass with personal.propclass,;
          				digstrat with personal.strata

          sele personal
				
		
				EndIf
     
	      skip
      
      EndDo

    Else

    EndIf
    
    If eof()
    	exit
    EndIf	
    HMany = HMany + 1
    
    

  EndDo

	close databases
	clear
	
	sele a
	use tdtemp
	
	sele b
	use taxdist
	
	sele tdtemp
	
	Do while !eof()
	
		sele taxdist
		locate for taxdistric = left(tdtemp.taxdistric,2)
		
		If found()

			mv  = mv + motorveh
			mvc = mvc + mvcount  &&tdcons.mvcount
			mh  = mh + mobilehome
			mhc = mhc + mhcount  &&tdcons.mhcount
			ti  = ti + timber100
			tic = tic + ticount  &&tdcons.timcount
			hd  = hd + heavyequip
			hdc = hdc + hecount  &&tdcons.hecount
			tdd = descrip
		
		EndIf
		
		sele tdtemp
		skip
		
	EndDo
	
	close databases
		
	Summit()
	
	use defaults
	
	If !mavexmpt
		Exemptions()
	EndIf	
*****start printing here
	MavPrntCr()
*-----------------------------------------------------------------------------
FUNCTION MavPrntCr

	local dt,ad
	
	covcnt = .f.

	clear
	ln = 4
	
	close database
		
	If cucnt <> mv3c + mv4c + mv5c
	
		@ln,10 say 'WARNING!!!'  
		ln = ln + 1
		@ln,10 say 'V digest class count does not equal SV count'
		ln = ln + 1
		@ln,10 say 'V Count = ' + alltrim(str(mv3c + mv4c + mv5c,4,0)) + '  SV Count = ' + alltrim(str(cucnt,4,0)) 
		
		covcnt = .t.

		If cucnt < mv3c + mv4c + mv5c
		
			sele a
			use svcount_mav
			index on realkey to xx
			
			sele b
			use realprop
			set rela to realkey into a
			index on parcel_no to xb
			
			copy fields parcel_no,ccy to sv_issues xls for realkey <> a.realkey and digclass = 'V'
			
			close databases
			
			ln = ln + 1
			@ln,10 say 'sv_issues.xls located in this folder contains a list of these parcels.'
			
		EndIf
		
		ln = ln + 2
		
	EndIf	
	
	close database
		
	If pref1ct + pref2ct <> mp3c + mp4c + mp5c
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'P digest class count does not equal SA count'
		ln = ln + 1
		@ln,10 say 'P Count = ' + alltrim(str(mp3c + mp4c + mp5c,4,0)) + ;
								'  SA Count = ' + alltrim(str(pref1ct + pref2ct,4,0)) 
		

		covcnt = .t.

		If pref1ct + pref2ct < mp3c + mp4c + mp5c
		
			sele a
			use sacount
			index on realkey to xx
			
			sele b
			use realprop
			set rela to realkey into a
			index on parcel_no to xb
			
			copy fields parcel_no,pcy to sa_issues xls for realkey <> a.realkey and digclass = 'P'
			
			close databases
			
			ln = ln + 1
			@ln,10 say 'sa_issues.xls located in this folder contains a list of these parcels.'
			
		EndIf
		
		ln = ln + 2
				
	EndIf	
	
	close datab
	
	If swcnt <> mw3c + mw4c + mw5c
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'W digest class count does not equal SW count'
		ln = ln + 1
		@ln,10 say 'W Count = ' + alltrim(str(mw3c + mw4c + mw5c,4,0)) + '  SW Count = ' + alltrim(str(swcnt,4,0)) 

		covcnt = .t.

*!*			If swcnt < mw3c + mw4c + mw5c
*!*			
*!*				sele a
*!*				use swcount_mav
*!*				index on realkey to xx
*!*				
*!*				sele b
*!*				use realprop
*!*				set rela to realkey into a
*!*				index on parcel_no to xb
*!*				
*!*				copy fields parcel_no,ccy to sw_issues xls
*!*				
*!*				close databases
*!*				
*!*				ln = ln + 1
*!*				@ln,10 say 'sw_issues.xls located in this folder contains a list of these parcels.'
*!*				
*!*			EndIf

		
		ln = ln + 2
					
	EndIf	
	
	close datab
	
	If sjcnt <> mj3c + mj4c + mj5c + mj9c
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'J digest class count does not equal SJ count'
		ln = ln + 1
		@ln,10 say 'J Count = ' + alltrim(str(mj3c + mj4c + mj5c,4,0)) + '  SJ Count = ' + alltrim(str(sjcnt,4,0)) 

		covcnt = .t.

		If sjcnt < mj3c + mj4c + mj5c + mj9c
		
			sele a
			use sjcount_mav
			index on realkey to xx
			
			sele b
			use realprop
			set rela to realkey into a
			index on parcel_no to xb
			
			copy fields parcel_no,flcy to sj_issues xls for realkey <> a.realkey and digclass = 'J'
			
			close databases
			
			ln = ln + 1
			@ln,10 say 'sj_issues.xls located in this folder contains a list of these parcels.'
			
		EndIf
		
		ln = ln + 2
					
	EndIf	

	close datab
	
	If j3ac + j4ac + j5ac + j9ac <> f3ac + f4ac + f5ac + f9ac
	
		@ln,10 say 'WARNING!!!'
		ln = ln + 1  
		@ln,10 say 'J digest class acres does not equal F digest class acres'
		ln = ln + 1
		@ln,10 say 'J Acres = ' + alltrim(str(j3ac + j4ac + j5ac + j9ac,4,0)) +;
							 '  F Acres = ' + alltrim(str(f3ac + f4ac + f5ac + f9ac,4,0))

		covcnt = .t.
		
		ln = ln + 2
					
	EndIf	

	If covcnt
	
		@ln,10 say 'Press any key to continue'
		InKey(0)
		
	EndIf		
	
	
	use tdtemp
	
	ad = ' '
	
	Do While !eof()
	
		If ad > '  '
			ad = trim(ad)+ '/' + alltrim(taxdistric)
		Else
			ad = alltrim(taxdistric)
		EndIf
		
		skip	 	
		
	EndDo
	
	If file('cons_value_mav.txt')
		erase cons_value_mav.txt
	EndIf
		
	use cons_value_mav
	copy to cons_value_mav2 delim with tab
	
	rename cons_value_mav2.txt to cons_value_mav.txt
	
	use defaults
	conx = conum
	
	use conames
	locate for num = conx
	
	Do Case
	
		Case name = 'BEN HILL'
			cname = 'benhill'
			cnam1 = name
		Case name = 'JEFF DAVIS'
			cname = 'jeffdavis'
			cnam1 = name
		Otherwise
			cname = alltrim(lower(name))
			cnam1 = name
					
	EndCase
	
	use defaults
			
	set device to print
	
	set mark to '-'
	
	dt = 'MAV_' + cname + dtoc(date()) + '_' + ;
	     left(time(),2) + '-' + subs(time(),4,2) + '-' + right(time(),2) + '.txt'
	     
	set mark to     
	
	set print to cr&dt

	ln = 2
	cl = 18
	co = trim(upper(cnam1)) +' COUNTY - ' + str(defaults.digyr,4,0) + ' MORATORIUM ASSESSED VALUE'
	ct = (80-len(co))/2
	
	@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
	ln = ln + 1	
	@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'
	
	ln = 5
	
	@ln, 5 say date()
	@ln,ct say co
	@ln,75 say "Pg 1"
	
	ln = ln + 1
	
	@ln, 5 say time()
	ln = ln + 1
	ln = ln + 1
	
	If at('/',ad) > 0
		@ln, 5 say 'TAX DISTRICTS:  ' + ad
	Else
		@ln, 5 say 'TAX DISTRICT:  ' + ad
	EndIf

	@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

	ln = ln + 1
	ln = ln + 1
	
	@ln,  5 say 'RESIDENTIAL'
	@ln, 47 say 'COMMERCIAL'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'	
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'	
	@ln, 72 say '40% VALUE'

	ln = ln + 1
	
	@ln,  5 say 'R1'
	@ln,  9 say mr1c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mr1 pict '9,999,999,999'
	@ln, 47 say 'C1'
	@ln, 51 say mc1c pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say mc1 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'R3'
	@ln,  9 say mr3c pict '999,999'
	@ln, 18 say r3ac pict '999,999.99'
	@ln, 29 say mr3 pict '9,999,999,999'
	@ln, 47 say 'C3'
	@ln, 51 say mc3c pict '999,999'
	@ln, 60 say c3ac pict '999,999.99'
	@ln, 71 say mc3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'R4'
	@ln,  9 say mr4c pict '999,999'
	@ln, 18 say r4ac pict '999,999.99'
	@ln, 29 say mr4 pict '9,999,999,999'
	@ln, 47 say 'C4'
	@ln, 51 say mc4c pict '999,999'
	@ln, 60 say c4ac pict '999,999.99'
	@ln, 71 say mc4 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'R5'
	@ln,  9 say mr5c pict '999,999'
	@ln, 18 say r5ac pict '999,999.99'
	@ln, 29 say mr5 pict '9,999,999,999'
	@ln, 47 say 'C5'
	@ln, 51 say mc5c pict '999,999'
	@ln, 60 say c5ac pict '999,999.99'
	@ln, 71 say mc5 pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'R6'
	@ln,  9 say mr6c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mr6 pict '9,999,999,999'
	@ln, 47 say 'C9'
	@ln, 51 say mc9c pict '999,999'
	@ln, 60 say c9ac pict '999,999.99'
	@ln, 71 say mc9 pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'R9'
	@ln,  9 say mr9c pict '999,999'
	@ln, 18 say r9ac pict '999,999.99'
	@ln, 29 say mr9 pict '9,999,999,999'
	@ln, 47 say 'CA'
	@ln, 51 say canum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say catot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RA'
	@ln,  9 say ranum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say ratot pict '9,999,999,999'
	@ln, 47 say 'CB'
	@ln, 51 say cbnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cbtot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RB'
	@ln,  9 say rbnum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say rbtot pict '9,999,999,999'
	@ln, 47 say 'CF'
	@ln, 51 say cfnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cftot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'RF'
	@ln,  9 say rfnum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say rftot pict '9,999,999,999'
	@ln, 47 say 'CI'
	@ln, 51 say cinum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say citot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RI'
	@ln,  9 say rinum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say ritot pict '9,999,999,999'
	@ln, 47 say 'CP'
	@ln, 51 say cpnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cptot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'RZ'
	@ln,  9 say rznum pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say rztot pict '9,999,999,999'
	@ln, 47 say 'CZ'
	@ln, 51 say cznum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say cztot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'RESIDENTIAL TRANSITIONAL'
	@ln, 47 say 'INDUSTRIAL'
	
	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'
	@ln, 72 say '40% VALUE'
	
	ln = ln + 1
	
	@ln,  5 say 'T1'
	@ln,  9 say mt1c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mt1 pict '9,999,999,999'
	@ln, 47 say 'I1'
	@ln, 51 say mi1c pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say mi1 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'T3'
	@ln,  9 say mt3c pict '999,999'
	@ln, 18 say t3ac pict '999,999.99'
	@ln, 29 say mt3 pict '9,999,999,999'
	@ln, 47 say 'I3'
	@ln, 51 say mi3c pict '999,999'
	@ln, 60 say i3ac pict '999,999.99'
	@ln, 71 say mi3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'T4'
	@ln,  9 say mt4c pict '999,999'
	@ln, 18 say t4ac pict '999,999.99'
	@ln, 29 say mt4 pict '9,999,999,999'
	@ln, 47 say 'I4'
	@ln, 51 say mi4c pict '999,999'
	@ln, 60 say i4ac pict '999,999.99'
	@ln, 71 say mi4 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'HISTORICAL'
	@ln, 47 say 'I5'
	@ln, 51 say mi5c pict '999,999'
	@ln, 60 say i5ac pict '999,999.99'
	@ln, 71 say mi5 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'I9'
	@ln, 51 say mi9c pict '999,999'
	@ln, 60 say i9ac pict '999,999.99'
	@ln, 71 say mi9 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'H1'
	@ln,  9 say mh1c pict '999,999'
	@ln, 18 say ' '
	@ln, 29 say mh1 pict '9,999,999,999'
	@ln, 47 say 'IA'
	@ln, 51 say ianum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say iatot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'H3'
	@ln,  9 say mh3c pict '999,999'
	@ln, 18 say h3ac pict '999,999.99'
	@ln, 29 say mh3 pict '9,999,999,999'
	@ln, 47 say 'IB'
	@ln, 51 say ibnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say ibtot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'AGRICULTURAL'
	@ln, 47 say 'IF'
	@ln, 51 say ifnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say iftot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'II'
	@ln, 51 say iinum pict '999,999'
	@ln, 71 say iitot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'A1'
	@ln,  9 say ma1c pict '999,999'
	@ln, 29 say ma1 pict '9,999,999,999'
	@ln, 47 say 'IP'
	@ln, 51 say ipnum pict '999,999'
	@ln, 71 say iptot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'A3'
	@ln,  9 say ma3c pict '999,999'
	@ln, 18 say a3ac pict '999,999.99'
	@ln, 29 say ma3 pict '9,999,999,999'
	@ln, 47 say 'IZ'
	@ln, 51 say iznum pict '999,999'
	@ln, 71 say iztot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'A4'
	@ln,  9 say ma4c pict '999,999'
	@ln, 18 say a4ac pict '999,999.99'
	@ln, 29 say ma4 pict '9,999,999,999'
	@ln, 47 say 'UTILITY'
	
	ln = ln + 1
	
	@ln,  5 say 'A5'
	@ln,  9 say ma5c pict '999,999'
	@ln, 18 say a5ac pict '999,999.99'
	@ln, 29 say ma5 pict '9,999,999,999'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'
	@ln, 72 say '40% VALUE'
	
	ln = ln + 1
	
	@ln,  5 say 'A6'
	@ln,  9 say ma6c pict '999,999'
	@ln, 29 say ma6 pict '9,999,999,999'
	@ln, 47 say 'U1'
	@ln, 51 say mu1c pict '999,999'
	@ln, 71 say mu1 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'A9'
	@ln,  9 say ma9c pict '999,999'
	@ln, 18 say a9ac pict '999,999.99'
	@ln, 29 say ma9 pict '9,999,999,999'
	@ln, 47 say 'U2' 
	@ln, 51 say mu2c pict '999,999'
	@ln, 71 say mu2 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'AA'
	@ln,  9 say aanum pict '999,999'
	@ln, 29 say aatot pict '9,999,999,999'
	@ln, 47 say 'U3' 
	@ln, 51 say mu3c pict '999,999'
	@ln, 60 say u3ac pict '999,999.99'
	@ln, 71 say mu3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'AB'
	@ln,  9 say abnum pict '999,999'

	@ln, 29 say abtot pict '9,999,999,999'
	@ln, 47 say 'U4' 
	@ln, 51 say mu4c pict '999,999'
	@ln, 60 say u4ac pict '999,999.99'
	@ln, 71 say mu4 pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'AF'
	@ln,  9 say afnum pict '999,999'
	@ln, 29 say aftot pict '9,999,999,999'
	@ln, 47 say 'U5' 
	@ln, 51 say mu5c pict '999,999'
	@ln, 60 say u5ac pict '999,999.99'
	@ln, 71 say mu5 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'AI'
	@ln,  9 say ainum pict '999,999'
	@ln, 29 say aitot pict '9,999,999,999'
	@ln, 47 say 'U9' 
	@ln, 51 say mu9c pict '999,999'
	@ln, 60 say u9ac pict '999,999.99'
	@ln, 71 say mu9 pict '9,999,999,999'

	ln = ln + 1

*pg x

	@ln,  5 say 'AZ'
	@ln,  9 say aznum pict '999,999'
	@ln, 29 say aztot Pict '9,999,999,999'
	@ln, 47 say 'UA' 
	@ln, 51 say uanum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say uatot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'PREFERENTIAL'
	@ln, 47 say 'UB' 
	@ln, 51 say ubnum pict '999,999'
	@ln, 60 say ' '
	@ln, 71 say ubtot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'UF' 
	@ln, 51 say ufnum pict '999,999'
	@ln, 71 say uftot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'P3'
	@ln,  9 say mp3c pict '999,999'
	@ln, 18 say p3ac pict '999,999.99'
	@ln, 29 say mp3 Pict '9,999,999,999'
	@ln, 47 say 'UZ' 
	@ln, 51 say uznum pict '999,999'
	@ln, 71 say uztot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'P4'
	@ln,  9 say mp4c pict '999,999'
	@ln, 18 say p4ac pict '999,999.99'
	@ln, 29 say mp4 Pict '9,999,999,999'
	@ln, 47 say 'EXEMPT PROPERTY' 
	
	ln = ln + 1
	
	@ln,  5 say 'P5'
	@ln,  9 say mp5c pict '999,999'
	@ln, 18 say p5ac pict '999,999.99'
	@ln, 29 say mp5 Pict '9,999,999,999'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 72 say '40% VALUE'

	ln = ln + 1
	
	@ln,  5 say 'P6'
	@ln,  9 say mp6c pict '999,999'
	@ln, 29 say mp6 Pict '9,999,999,999'
	@ln, 47 say 'E0' 
	@ln, 51 say me0c + e0num pict '999,999'
	@ln, 71 say me0 + e0tot pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'P9'
	@ln,  9 say mp9c pict '999,999'
	@ln, 18 say p9ac pict '999,999.99'
	@ln, 29 say mp9 Pict '9,999,999,999'
	@ln, 47 say 'E1' 
	@ln, 51 say me1c+e1num pict '999,999'
	@ln, 71 say me1+e1tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CONSERVATION USE'
	@ln, 47 say 'E2' 
	@ln, 51 say me2c+e2num pict '999,999'
	@ln, 71 say me2+e2tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'E3' 
	@ln, 51 say me3c+e3num pict '999,999'
	@ln, 71 say me3+e3tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'V3'
	@ln,  9 say mv3c pict '999,999'
	@ln, 18 say v3ac pict '999,999.99'
	@ln, 29 say mv3 Pict '9,999,999,999'
	@ln, 47 say 'E4' 
	@ln, 51 say me4c+e4num pict '999,999'
	@ln, 71 say me4+e4tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'V4'
	@ln,  9 say mv4c pict '999,999'
	@ln, 18 say v4ac pict '999,999.99'
	@ln, 29 say mv4 Pict '9,999,999,999'
	@ln, 47 say 'E5' 
	@ln, 51 say me5c+e5num pict '999,999'
	@ln, 71 say me5+e5tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'V5'
	@ln,  9 say mv5c pict '999,999'
	@ln, 18 say v5ac pict '999,999.99'
	@ln, 29 say mv5 Pict '9,999,999,999'
	@ln, 47 say 'E6' 
	@ln, 51 say me6c+e6num pict '999,999'
	@ln, 71 say me6+e6tot pict '9,999,999,999'

	ln = ln + 1

	@ln,  5 say 'V6'
	@ln,  9 say mv6c pict '999,999'
	@ln, 29 say mv6 Pict '9,999,999,999'
	@ln, 47 say 'E7' 
	@ln, 51 say me7c+e7num pict '999,999'
	@ln, 71 say me7+e7tot pict '9,999,999,999'

	ln = ln + 1

	@ln, 47 say 'E8' 
	@ln, 51 say me8c+e8num pict '999,999'
	@ln, 71 say me8+e8tot pict '9,999,999,999'

	ln = ln + 1

	@ln, 47 say 'E9' 
	@ln, 51 say me9c+e9num pict '999,999'
	@ln, 71 say me9+e9tot pict '9,999,999,999'

	ln = ln + 1

	@ln, 47 say 'TOT:' 
	@ln, 51 say me0c+me1c+e1num+me2c+e2num+me3c+e3num+me4c+e4num+me5c+e5num+;
	me6c+e6num+me7c+e7num+me8c+e8num+me9c+e9num pict '999,999'
	@ln, 71 say me0+me1+me2+me3+me4+me5+me6+me7+me8+me9+e1tot+e2tot+e3tot+;
	e4tot+e5tot+e6tot+e7tot+e8tot+e9tot pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say chr(3)
	
*flpa

**flpa stuff

	ln = 2
	cl = 18
	co = trim(upper(cnam1)) +' COUNTY - ' + str(defaults.digyr,4,0) + ' MORATORIUM ASSESSED VALUE'
	ct = (80-len(co))/2
	
	@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
	ln = ln + 1	
	@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'

	ln = 5
	
	@ln, 5 say date()
	@ln,ct say co
	@ln,75 say "Pg 2"
	
	ln = ln + 1
	
	@ln, 5 say time()
	ln = ln + 1
	ln = ln + 1
	
	If at('/',ad) > 0
		@ln, 5 say 'TAX DISTRICTS:  ' + ad
	Else
		@ln, 5 say 'TAX DISTRICT:  ' + ad
	EndIf

	@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

	ln = ln + 2
	
	@ln,  5 say 'ENVIRONMENTALLY SENSITIVE'
	@ln, 47 say 'BROWNFIELD'		
		
	ln = ln + 1
		
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'	
	@ln, 72 say '40% VALUE'
	
	ln = ln + 1

	@ln,  5 say 'W3'
	@ln,  9 say mW3c pict '999,999'
	@ln, 18 say W3ac pict '999,999.99'
	@ln, 29 say mW3 Pict '9,999,999,999'
	@ln, 47 say 'B1' 
	@ln, 51 say mb1c pict '999,999'
	@ln, 71 say mb1 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'W4'
	@ln,  9 say mw4c pict '999,999'
	@ln, 18 say w4ac pict '999,999.99'
	@ln, 29 say mw4 Pict '9,999,999,999'
	@ln, 47 say 'B3' 
	@ln, 51 say mb3c pict '999,999'
	@ln, 60 say b3ac pict '999,999.99'
	@ln, 71 say mb3 pict '9,999,999,999'
	
	ln = ln + 1
	
	@ln,  5 say 'W5'
	@ln,  9 say mw5c pict '999,999'
	@ln, 18 say w5ac pict '999,999.99'
	@ln, 29 say mw5 Pict '9,999,999,999'
	@ln, 47 say 'B4' 
	@ln, 51 say mb4c pict '999,999'
	@ln, 60 say b4ac pict '999,999.99'
	@ln, 71 say mb4 pict '9,999,999,999'

	ln = ln + 1		
	
	@ln,  5 say 'FLPA'
	@ln, 47 say 'B5' 
	@ln, 51 say mb5c pict '999,999'
	@ln, 60 say b5ac pict '999,999.99'
	@ln, 71 say mb5 pict '9,999,999,999'

	ln = ln + 1
	
	@ln,  5 say 'CODE'
	@ln, 10 say 'COUNT'
	@ln, 20 say 'ACRES'	
	@ln, 30 say '40% VALUE'
	@ln, 47 say 'B6' 
	@ln, 51 say mb6c pict '999,999'
	@ln, 71 say mb6 pict '9,999,999,999'


	ln = ln + 1

	@ln,  5 say 'J3'
	@ln,  9 say mj3c pict '999,999'
	@ln, 18 say j3ac pict '999,999.99'
	@ln, 29 say mj3 pict '9,999,999,999'
	@ln, 47 say 'FLPA FMV'	
	
	ln = ln + 1

	@ln,  5 say 'J4'
	@ln,  9 say mj4c pict '999,999'
	@ln, 18 say j4ac pict '999,999.99'
	@ln, 29 say mj4 pict '9,999,999,999'
	
	@ln, 47 say 'CODE'
	@ln, 52 say 'COUNT'
	@ln, 62 say 'ACRES'	
	@ln, 72 say '40% VALUE'
	
	
	ln = ln + 1

	@ln,  5 say 'J5'
	@ln,  9 say mj5c pict '999,999'
	@ln, 18 say j5ac pict '999,999.99'
	@ln, 29 say mj5 pict '9,999,999,999'

	@ln, 47 say 'F3'
	@ln, 51 say mf3c pict '999,999'
	@ln, 60 say f3ac pict '999,999.99'
	@ln, 71 say mf3 pict '9,999,999,999'
	
	
	ln = ln + 1
	
	@ln,  5 say 'J9'
	@ln,  9 say mj9c pict '999,999'
	@ln, 18 say j9ac pict '999,999.99'
	@ln, 29 say mj9 pict '9,999,999,999'

	@ln, 47 say 'F4'
	@ln, 51 say mf4c pict '999,999'
	@ln, 60 say f4ac pict '999,999.99'
	@ln, 71 say mf4 pict '9,999,999,999'
	
	
	ln = ln + 1

	@ln, 47 say 'F5'
	@ln, 51 say mf5c pict '999,999'
	@ln, 60 say f5ac pict '999,999.99'
	@ln, 71 say mf5 pict '9,999,999,999'

	ln = ln + 1
		
	@ln, 47 say 'F9'
	@ln, 51 say mf9c pict '999,999'
	@ln, 60 say f9ac pict '999,999.99'
	@ln, 71 say mf9 pict '9,999,999,999'

*summary
	ln = ln + 5

	@ln,26 say 'SUMMARY'	
	
	ln = ln + 2
	
	@ln,15 say 'GROUP'
	@ln,28 say 'COUNT'
	@ln,37 say 'ACRES'
	@ln,52 say '40% VALUE' 	
	
	ln = ln + 1
	
	@ln, 5 say 'Residential'
	@ln,27 say mr1c+mr3c+mr4c+mr5c+mr6c+mr9c+ranum+rbnum+rfnum+rinum+;
	rznum pict '999,999'
	@ln,35 say r3ac+r4ac+r5ac+r9ac pict '999,999.99'
	@ln,50 say mr1+mr3+mr4+mr5+mr6+mr9+ratot+rbtot+rftot+ritot+rztot ;
	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Residen Transitional'
	@ln,27 say mt1c+mt3c+mt4c pict '999,999'
	@ln,35 say t3ac+t4ac pict '999,999.99'
	@ln,50 say mt1+mt3+mt4	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Historic'
	@ln,27 say mh1c+mh3c pict '999,999'
	@ln,35 say h3ac pict '999,999.99'
	@ln,50 say mh1+mh3	pict '99,999,999,999'

	ln = ln + 1
	
	@ln, 5 say 'Industrial'
	@ln,27 say mi1c+mi3c+mi4c+mi5c+mi9c+ianum+ibnum+ifnum+iinum+ipnum+;
	iznum pict '999,999'
	@ln,35 say i3ac+i4ac+i5ac+i9ac pict '999,999.99'
	@ln,50 say mi1+mi3+mi4+mi5+mi9+iatot+ibtot+iftot+iitot+iztot+iptot ;
	pict '99,999,999,999'

	ln = ln + 1		
	
	@ln, 5 say 'Agricultural'
	@ln,27 say ma1c+ma3c+ma4c+ma5c+ma6c+ma9c+aanum+abnum+afnum+ainum+;
	aznum pict '999,999'
	@ln,35 say a3ac+a4ac+a5ac+a9ac pict '999,999.99'
	@ln,50 say ma1+ma3+ma4+ma5+ma6+ma9+aatot+abtot+aftot+aitot+aztot ;
	pict '99,999,999,999'

	ln = ln + 1
	
	@ln, 5 say 'Preferential'
	@ln,27 say mp3c+mp4c+mp5c+mp6c+mp9c pict '999,999'
	@ln,35 say p3ac+p4ac+p5ac+p9ac pict '999,999.99'
	@ln,50 say mp3+mp4+mp5+mp6+mp9	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Conservation Use'
	@ln,27 say mv3c+mv4c+mv5c+mv6c pict '999,999'
	@ln,35 say v3ac+v4ac+v5ac pict '999,999.99'
	@ln,50 say mv3+mv4+mv5+mv6	pict '99,999,999,999'
	
	ln = ln + 1

	@ln, 5 say 'Enviromentally Sen'
	@ln,27 say mw3c+mw4c+mw5c pict '999,999'
	@ln,35 say w3ac+w4ac+w5ac pict '999,999.99'
	@ln,50 say mw3+mw4+mw5+mw6	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Commercial'
	@ln,27 say mc1c+mc3c+mc4c+mc5c+mc9c+canum+cbnum+cfnum+cinum+cpnum+;
	cznum pict '999,999'
	@ln,35 say c3ac+c4ac+c5ac+c9ac pict '999,999.99'
	@ln,50 say mc1+mc3+mc4+mc5+mc9+catot+cbtot+cftot+citot+cztot+cptot ;
	pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Utility'
	@ln,27 say mu1c+mu2c+mu3c+mu4c+mu5c+mu6c+mu9c+uanum+ubnum+ufnum+uinum+;
	uznum pict '999,999'
	@ln,35 say u2ac+u3ac+u4ac+u5ac+u9ac pict '999,999.99'
	@ln,50 say mu1+mu2+mu3+mu4+mu5+mu6+mu9+uatot+ubtot+uftot+uitot+uztot ;
	pict '99,999,999,999'
	
	ln = ln + 1

	@ln, 5 say 'Brownfield'
	@ln,27 say mb1c+mb3c+mb4c+mb5c+mb6c pict '999,999'
	@ln,35 say b3ac+b4ac+b5ac pict '999,999.99'
	@ln,50 say mb1+mb3+mb4+mb5+mb6 pict '99,999,999,999'

	ln = ln + 1
		
	@ln, 5 say 'FLPA (J)'
	@ln,27 say mj3c+mj4c+mj5c+mj9c pict '999,999'
	@ln,35 say j3ac+j4ac+j5ac+j9ac pict '999,999.99'
	@ln,50 say mj3+mj4+mj5+mj9 pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'FLPA FMV (F)'
	@ln,27 say mf3c+mf4c+mf5c+mf9c pict '999,999'
	@ln,35 say f3ac+f4ac+f5ac+f9ac pict '999,999.99'
	@ln,50 say mf3+mf4+mf5+mf9 pict '99,999,999,999'
	
	ln = ln + 1
	

	@ln, 5 say 'Motor Vehicle'
	@ln,27 say mvc pict '999,999'
	@ln,50 say mv pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Mobile Home'
	@ln,27 say mhc pict '999,999'
	@ln,50 say mh pict '99,999,999,999'
	
	ln = ln + 1
	
	@ln, 5 say 'Timber'
	@ln,27 say tic pict '999,999'
	@ln,50 say ti pict '99,999,999,999'	
	
	ln = ln + 1
	
	@ln, 5 say 'Heavy Truck Equipment'
	@ln,27 say hdc pict '999,999'
	@ln,50 say hd pict '99,999,999,999'
	
	ln = ln + 2
	
	@ln, 5 say 'Gross Digest Total'
	@ln,27 say GrCnt pict '999,999'	
	@ln,35 say GrAc pict '999,999.99'	
	@ln,50 say GrVal pict '99,999,999,999'
	
*!*		ln = ln + 2

*!*		@ln, 5 say 'Exemptions-Bond'
*!*		@ln,27 say BnExCnt	pict '999,999'
*!*		@ln,50 say BnExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Net Bond Digest'
*!*		@ln,27 say GrCnt - BnExCnt pict '999,999'

*!*		@ln,50 say GrVal - BnExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Gross Digest'
*!*		@ln,27 say GrCnt pict '999,999'	
*!*		@ln,35 say GrAc pict '999,999.99'	
*!*		@ln,50 say GrVal pict '99,999,999,999'

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Exemptions M&O'	
*!*		@ln,27 say MoExCnt pict '999,999'
*!*		@ln,50 say MoExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Net M&O Digest'
*!*		@ln,27 say GrCnt - MoExCnt pict '999,999'	
*!*		@ln,50 say GrVal - MoExVal  pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln,27 say 'TAX LEVIED'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'TYPE'
*!*		@ln,11  say 'ASSESSED VALUE'
*!*		@ln,31 say 'MILLAGE'	
*!*		@ln,48 say 'TAX'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'M&O'
*!*		@ln,12 say GrVal - MoExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'Bond'
*!*		@ln,12 say GrVal - BnExVal pict '99,999,999,999'
		
**exemptions

*!*		ln = ln + 2
*!*		
*!*		@ln, 5 say 'HOMESTEAD AND PROPERTY EXEMPTIONS - MORATORIUM ASSESSED VALUE'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'CODE'
*!*		@ln,10 say 'COUNT'
*!*		@ln,20 say 'STATE'
*!*		@ln,36 say 'COUNTY M&O'	
*!*		@ln,52 say 'SCHOOL M&O'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'S1'
*!*		@ln, 9 say s1count pict '999,999'
*!*		@ln,18 say s1 pict '9,999,999,999'
*!*		@ln,34 say s1 pict '9,999,999,999'
*!*		@ln,50 say s1 pict '9,999,999,999'	
*!*		
*!*		ln = ln + 1
*!*		

*!*		@ln, 5 say 'SC'
*!*		@ln, 9 say sccount pict '999,999'
*!*		@ln,18 say sc65 pict '9,999,999,999'
*!*		@ln,34 say scc pict '9,999,999,999'
*!*		@ln,50 say scc pict '9,999,999,999'	
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'S3'
*!*		@ln, 9 say s3count pict '999,999'
*!*		@ln,18 say s3 pict '9,999,999,999'
*!*		@ln,34 say s3 pict '9,999,999,999'
*!*		@ln,50 say s3s pict '9,999,999,999'	

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'S4'
*!*		@ln, 9 say s4count pict '999,999'
*!*		@ln,18 say s465 pict '9,999,999,999'
*!*		
*!*		If at('franklin',lower(defaults.coname)) = 0
*!*		
*!*			@ln,34 say s4 pict '9,999,999,999'
*!*			@ln,50 say s4s pict '9,999,999,999'		
*!*			
*!*		EndIf	

*!*		ln = ln + 1	
*!*		
*!*		@ln, 5 say 'S5'
*!*		@ln, 9 say s5count pict '999,999'
*!*		@ln,18 say s5 pict '9,999,999,999'
*!*		@ln,34 say s5 pict '9,999,999,999'
*!*		@ln,50 say s5 pict '9,999,999,999'		
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'SD'
*!*		@ln, 9 say sdcount pict '999,999'
*!*		@ln,18 say sd65 pict '9,999,999,999'
*!*		@ln,34 say sd pict '9,999,999,999'
*!*		@ln,50 say sd pict '9,999,999,999'		
*!*		

*!*		ln = ln + 1

*!*		@ln, 5 say 'SS'
*!*		@ln, 9 say sscount pict '999,999'
*!*		@ln,18 say ss pict '9,999,999,999'
*!*		@ln,34 say ss pict '9,999,999,999'
*!*		@ln,50 say ss pict '9,999,999,999'		
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'SE'
*!*		@ln, 9 say secount pict '999,999'
*!*		@ln,18 say se65 pict '9,999,999,999'
*!*		@ln,34 say se pict '9,999,999,999'
*!*		@ln,50 say se pict '9,999,999,999'		
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'SG'
*!*		@ln, 9 say sgcount pict '999,999'
*!*		@ln,18 say sg pict '9,999,999,999'
*!*		@ln,34 say sg pict '9,999,999,999'
*!*		@ln,50 say sg pict '9,999,999,999'		

*!*		ln = ln + 1

*!*		@ln, 5 say 'S6'
*!*		@ln, 9 say s6count pict '999,999'
*!*		@ln,18 say s6 pict '9,999,999,999'
*!*		@ln,34 say s6s pict '9,999,999,999'
*!*		@ln,50 say s6 pict '9,999,999,999'	

*!*		ln = ln + 1	

*!*		@ln, 5 say 'S8'
*!*		@ln, 9 say s8count pict '999,999'
*!*		@ln,18 say s8 pict '9,999,999,999'
*!*		@ln,34 say s8 pict '9,999,999,999'
*!*		@ln,50 say s8s pict '9,999,999,999'	
*!*				
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'S9'
*!*		@ln, 9 say s9count pict '999,999'
*!*		@ln,18 say s9 pict '9,999,999,999'
*!*		@ln,34 say s9 pict '9,999,999,999'
*!*		@ln,50 say s9s pict '9,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname))	= 0
*!*			@ln, 5 say 'SF'
*!*			@ln, 9 say FreeNum pict '999,999'
*!*			@ln,18 say FreeTot pict '9,999,999,999'
*!*			@ln,34 say FreeTot pict '9,999,999,999'
*!*			@ln,50 say FreeTot pict '9,999,999,999'		
*!*		Else
*!*			@ln, 5 say 'L1'
*!*			@ln, 9 say L1Count pict '999,999'
*!*			@ln,18 say L1 pict '9,999,999,999'
*!*			@ln,34 say L1s pict '9,999,999,999'
*!*			@ln,50 say L1s pict '9,999,999,999'			
*!*		EndIf	
*!*		
*!*		ln = ln + 1
*!*		
*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0
*!*			@ln, 5 say 'SF'
*!*			@ln, 9 say FreeNum pict '999,999'
*!*			@ln,18 say FreeTot pict '9,999,999,999'
*!*			@ln,34 say FreeTot pict '9,999,999,999'
*!*			@ln,50 say FreeTot pict '9,999,999,999'		
*!*		Else		
*!*			@ln, 5 say 'SP'
*!*			@ln, 9 say SpNum pict '999,999'
*!*			@ln,18 say SpTot pict '9,999,999,999'
*!*			@ln,34 say SpTot pict '9,999,999,999'
*!*			@ln,50 say SpTot pict '9,999,999,999'		
*!*		EndIf
*!*		
*!*		ln = ln + 1
*!*		
*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0	
*!*			@ln, 5 say 'SP'
*!*			@ln, 9 say SpNum pict '999,999'
*!*			@ln,18 say SpTot pict '9,999,999,999'
*!*			@ln,34 say SpTot pict '9,999,999,999'
*!*			@ln,50 say SpTot pict '9,999,999,999'		
*!*		Else		
*!*			@ln, 5 say 'SA'
*!*			@ln, 9 say Pref1ct+Pref2ct pict '999,999'
*!*			@ln,18 say int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)) pict '9,999,999,999'
*!*			@ln,34 say int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)) pict '9,999,999,999'
*!*			@ln,50 say int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)) pict '9,999,999,999'		
*!*		EndIf	
*!*		
*!*		ln = ln + 1
*!*		
*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0		
*!*			@ln, 5 say 'SA'
*!*			@ln, 9 say Pref1ct+Pref2ct pict '999,999'
*!*			@ln,18 say int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)) pict '9,999,999,999'
*!*			@ln,34 say int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)) pict '9,999,999,999'
*!*			@ln,50 say int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)) pict '9,999,999,999'
*!*		Else		
*!*			@ln, 5 say 'SH'
*!*			@ln, 9 say histcnt pict '999,999'
*!*			@ln,18 say histex pict '9,999,999,999'
*!*			@ln,34 say histex pict '9,999,999,999'
*!*			@ln,50 say histex pict '9,999,999,999'		
*!*		EndIf	
*!*		
*!*		ln = ln + 1
*!*		
*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0	
*!*			@ln, 5 say 'SH'
*!*			@ln, 9 say histcnt pict '999,999'
*!*			@ln,18 say histex pict '9,999,999,999'
*!*			@ln,34 say histex pict '9,999,999,999'
*!*			@ln,50 say histex pict '9,999,999,999'		
*!*		Else				
*!*			@ln, 5 say 'ST'
*!*			@ln, 9 say TranCnt pict '999,999'
*!*			@ln,18 say TranEx pict '9,999,999,999'
*!*			@ln,34 say TranEx pict '9,999,999,999'
*!*			@ln,50 say TranEx pict '9,999,999,999'		
*!*		EndIf	
*!*		
*!*		ln = ln + 1

*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0	
*!*			@ln, 5 say 'ST'
*!*			@ln, 9 say TranCnt pict '999,999'
*!*			@ln,18 say TranEx pict '9,999,999,999'
*!*			@ln,34 say TranEx pict '9,999,999,999'
*!*			@ln,50 say TranEx pict '9,999,999,999'		
*!*		Else			
*!*			@ln, 5 say 'SV'
*!*			@ln, 9 say CuCnt pict '999,999'
*!*			@ln,18 say (CUFMV1+CUFMV2+CUACC)-CUTOT pict '9,999,999,999'
*!*			@ln,34 say (CUFMV1+CUFMV2+CUACC)-CUTOT pict '9,999,999,999'
*!*			@ln,50 say (CUFMV1+CUFMV2+CUACC)-CUTOT pict '9,999,999,999'	
*!*		EndIf	
*!*		
*!*		ln = ln + 1
*!*		
*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0	
*!*			@ln, 5 say 'SV'
*!*			@ln, 9 say CuCnt pict '999,999'
*!*			@ln,18 say (CUFMV1+CUFMV2+CUACC)-CUTOT pict '9,999,999,999'
*!*			@ln,34 say (CUFMV1+CUFMV2+CUACC)-CUTOT pict '9,999,999,999'
*!*			@ln,50 say (CUFMV1+CUFMV2+CUACC)-CUTOT pict '9,999,999,999'
*!*		Else			
*!*			@ln, 5 say 'SW'
*!*			@ln, 9 say SwCnt pict '999,999'
*!*			@ln,18 say (SwFmv1+SwFmv2+SwAcc)-SwTot pict '9,999,999,999'
*!*			@ln,34 say (SwFmv1+SwFmv2+SwAcc)-SwTot pict '9,999,999,999'
*!*			@ln,50 say (SwFmv1+SwFmv2+SwAcc)-SwTot pict '9,999,999,999'
*!*			
*!*		EndIf	
*!*		
*!*		ln = ln + 1

*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0	
*!*			@ln, 5 say 'SW'
*!*			@ln, 9 say SwCnt pict '999,999'
*!*			@ln,18 say (SwFmv1+SwFmv2+SwAcc)-SwTot pict '9,999,999,999'
*!*			@ln,34 say (SwFmv1+SwFmv2+SwAcc)-SwTot pict '9,999,999,999'
*!*			@ln,50 say (SwFmv1+SwFmv2+SwAcc)-SwTot pict '9,999,999,999'
*!*			
*!*		Else
*!*			@ln, 5 say 'SB'	
*!*			@ln, 9 say sbcount pict '999,999'
*!*			@ln,18 say sb pict '9,999,999,999'
*!*			@ln,34 say sb pict '9,999,999,999'
*!*			@ln,50 say sb pict '9,999,999,999'
*!*			
*!*			ln = ln + 1

*!*			@ln, 5 say 'SJ'	
*!*			@ln, 9 say sjcnt pict '999,999'
*!*			@ln,18 say (SjFMV1+SjFMV2)-SjTOT pict '9,999,999,999'
*!*			@ln,34 say (SjFMV1+SjFMV2)-SjTOT pict '9,999,999,999'
*!*			@ln,50 say (SjFMV1+SjFMV2)-SjTOT pict '9,999,999,999'
*!*			
*!*			ln = ln + 1
*!*			
*!*			@ln, 5 say 'SY'	
*!*			@ln, 9 say sycount pict '999,999'
*!*			@ln,18 say sy pict '9,999,999,999'
*!*			@ln,34 say sy pict '9,999,999,999'
*!*			@ln,50 say sy pict '9,999,999,999'
*!*			

*!*			ln = ln + 1
*!*			
*!*			@ln, 5 say 'SX'	
*!*			@ln, 9 say sxcount pict '999,999'
*!*			@ln,18 say sx pict '9,999,999,999'
*!*	*		@ln,34 say sx pict '9,999,999,999'  && no EZ unless joint city/county resolution
*!*	*		@ln,50 say sx pict '9,999,999,999'

*!*		EndIf	
*!*		
*!*		ln = ln + 1

*!*		If at('lowndes',lower(defaults.coname)) + ;
*!*		at('dougherty',lower(defaults.coname)) > 0	
*!*		
*!*			@ln, 5 say 'SB'	
*!*			@ln, 9 say sbcount pict '999,999'
*!*			@ln,18 say sb pict '9,999,999,999'
*!*			@ln,34 say sb pict '9,999,999,999'
*!*			@ln,50 say sb pict '9,999,999,999'
*!*			
*!*			ln = ln + 1
*!*			
*!*			@ln, 5 say 'SJ'	
*!*			@ln, 9 say sjcnt pict '999,999'
*!*			@ln,18 say (SjFMV1+SjFMV2)-SjTOT pict '9,999,999,999'
*!*			@ln,34 say (SjFMV1+SjFMV2)-SjTOT pict '9,999,999,999'
*!*			@ln,50 say (SjFMV1+SjFMV2)-SjTOT pict '9,999,999,999'

*!*			ln = ln + 1
*!*			
*!*			@ln, 5 say 'SY'	
*!*			@ln, 9 say sycount pict '999,999'
*!*			@ln,18 say sy pict '9,999,999,999'
*!*			@ln,34 say sy pict '9,999,999,999'
*!*			@ln,50 say sy pict '9,999,999,999'
*!*			
*!*			ln = ln + 1
*!*			
*!*			@ln, 5 say 'SX'	
*!*			@ln, 9 say sxcount pict '999,999'
*!*			@ln,18 say sx pict '9,999,999,999'
*!*	*!*			@ln,34 say sx pict '9,999,999,999'
*!*	*!*			@ln,50 say sx pict '9,999,999,999'
*!*			

*!*			ln = ln + 2 && moved from commented out line below to here on 8/18/08
*!*			
*!*		EndIf	
*!*		
*!*	*	ln = ln + 2
*!*		If at('franklin',lower(defaults.coname)) + at('mcintosh',lower(defaults.coname)) > 0
*!*		
*!*			If at('franklin',lower(defaults.coname)) > 0	
*!*			
*!*				@ln, 5 say 'L4'
*!*				@ln, 9 say s4count pict '999,999'
*!*		*		@ln,18 say s465 pict '9,999,999,999'
*!*				@ln,34 say s4 pict '9,999,999,999'
*!*				@ln,50 say s4s pict '9,999,999,999'		

*!*			EndIf	
*!*			
*!*			If at('mcintosh',lower(defaults.coname))> 0

*!*				@ln, 5 say 'F1'
*!*				@ln, 9 say F1Cnt pict '999,999'
*!*				@ln,18 say f1 pict '9,999,999,999'
*!*				@ln,34 say f1c pict '9,999,999,999'
*!*				@ln,50 say f1s pict '9,999,999,999'	
*!*						
*!*			EndIf	
*!*			
*!*			
*!*			ln = ln + 1
*!*			
*!*			If at('mcintosh',lower(defaults.coname)) > 0
*!*				@ln, 5 say 'F3'
*!*				@ln, 9 say F3cnt pict '999,999'
*!*				@ln,18 say F3 pict '9,999,999,999'
*!*				@ln,34 say F3c pict '9,999,999,999'
*!*				@ln,50 say F3s pict '9,999,999,999'
*!*						
*!*			EndIf
*!*			
*!*			ln = ln + 1
*!*			
*!*			If at('mcintosh',lower(defaults.coname)) > 0	
*!*				@ln, 5 say 'F4'
*!*				@ln, 9 say f4cnt pict '999,999'
*!*		  	@ln,18 say f4 pict '9,999,999,999'
*!*				@ln,34 say f4c pict '9,999,999,999'
*!*				@ln,50 say f4s pict '9,999,999,999'		
*!*			EndIf	

*!*			ln = ln + 1
*!*			
*!*			If at('mcintosh',lower(defaults.coname)) > 0	
*!*				@ln, 5 say 'F5'
*!*				@ln, 9 say f5cnt pict '999,999'
*!*				@ln,18 say f5 pict '9,999,999,999'
*!*				@ln,34 say f5c pict '9,999,999,999'
*!*				@ln,50 say f5s pict '9,999,999,999'		
*!*			EndIf	

*!*		EndIf
*!*		
*!*		ln = ln + 2
*!*		
*!*		
*!*		@ln, 5 say 'TOT:'
*!*		@ln, 9 say moexcnt pict '999,999'
*!*		@ln,18 say stexval pict '9,999,999,999'
*!*		@ln,34 say moexval pict '9,999,999,999'
*!*		@ln,50 say shexval pict '9,999,999,999'
	
	
*!*		eject page
	ln = 62

	@ln,  5 say chr(3)
	
	
***2nd page	
	
	sele a
	
	sele b
	use cons_exempt
	go top
	
	pg = 2
	
	Do While !eof()
		
		pg = pg + 1
		ln = 2
		cl = 18
		co = trim(upper(cnam1)) +' COUNTY - ' + str(defaults.digyr,4,0) + ' MORATORIUM EXEMPTIONS'
		ct = (80-len(co))/2
		
		@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
		ln = ln + 1	
		@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'

		ln = 5
		
		@ln, 5 say date()
		@ln,ct say co
		@ln,75 say "Pg " + alltrim(str(pg,2,0))
		
		ln = ln + 1
		
		@ln, 5 say time()
		ln = ln + 1
		ln = ln + 1
		
		If at('/',ad) > 0
			@ln, 5 say 'TAX DISTRICTS:  ' + ad
		Else
			@ln, 5 say 'TAX DISTRICT:  ' + ad
		EndIf

		@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

		ln = ln + 2
		
		@ln,  5 say 'TAX TYPE ' + str(taxtype,3,0) + ' - ' + ttdescrip
		
		ln = ln + 2
		
		tt = taxtype
		ec = 0
		ea = 0
		
		Do while !eof() and tt = taxtype
		
			@ln, 5 say excode + space(2) + descrip 
			@ln,43 say excount pict '999,999'
			@ln,53 say examount pict '9,999,999,999'
			
			ln = ln + 1
			ea = ea + examount
			ec = ec + excount
			
			skip
			
		EndDo
		
		ln = ln + 1
		@ln, 5 say 'Totals'
		@ln,43 say ec pict '999,999'
		@ln,53 say ea pict '9,999,999,999'

		ln = ln + 2
		@ln, 5 say 'Net Digest'
		@ln,53 say GrVal - ea pict '9,999,999,999'

		ln = 62

		@ln,  5 say chr(3)
		
			
	EndDo

	
			
*!*		@ln,26 say 'SUMMARY'	
*!*		
*!*		ln = ln + 2
*!*		
*!*		@ln,15 say 'GROUP'
*!*		@ln,28 say 'COUNT'
*!*		@ln,37 say 'ACRES'
*!*		@ln,52 say '40% VALUE' 	
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Residential'
*!*		@ln,27 say mr1c+mr3c+mr4c+mr5c+mr6c+mr9c+ranum+rbnum+rfnum+rinum+;
*!*		rznum pict '999,999'
*!*		@ln,35 say r3ac+r4ac+r5ac+r9ac pict '999,999.99'
*!*		@ln,50 say mr1+mr3+mr4+mr5+mr6+mr9+ratot+rbtot+rftot+ritot+rztot ;
*!*		pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Residen Transitional'
*!*		@ln,27 say mt1c+mt3c+mt4c pict '999,999'
*!*		@ln,35 say t3ac+t4ac pict '999,999.99'
*!*		@ln,50 say mt1+mt3+mt4	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Historic'
*!*		@ln,27 say mh1c+mh3c pict '999,999'
*!*		@ln,35 say h3ac pict '999,999.99'
*!*		@ln,50 say mh1+mh3	pict '99,999,999,999'

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Industrial'
*!*		@ln,27 say mi1c+mi3c+mi4c+mi5c+mi9c+ianum+ibnum+ifnum+iinum+ipnum+;
*!*		iznum pict '999,999'
*!*		@ln,35 say i3ac+i4ac+i5ac+i9ac pict '999,999.99'
*!*		@ln,50 say mi1+mi3+mi4+mi5+mi9+iatot+ibtot+iftot+iitot+iztot+iptot ;
*!*		pict '99,999,999,999'

*!*		ln = ln + 1		
*!*		
*!*		@ln, 5 say 'Agricultural'
*!*		@ln,27 say ma1c+ma3c+ma4c+ma5c+ma6c+ma9c+aanum+abnum+afnum+ainum+;
*!*		aznum pict '999,999'
*!*		@ln,35 say a3ac+a4ac+a5ac+a9ac pict '999,999.99'
*!*		@ln,50 say ma1+ma3+ma4+ma5+ma6+ma9+aatot+abtot+aftot+aitot+aztot ;
*!*		pict '99,999,999,999'

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Preferential'
*!*		@ln,27 say mp3c+mp4c+mp5c+mp6c+mp9c pict '999,999'
*!*		@ln,35 say p3ac+p4ac+p5ac+p9ac pict '999,999.99'
*!*		@ln,50 say mp3+mp4+mp5+mp6+mp9	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Conservation Use'
*!*		@ln,27 say mv3c+mv4c+mv5c+mv6c pict '999,999'
*!*		@ln,35 say v3ac+v4ac+v5ac pict '999,999.99'
*!*		@ln,50 say mv3+mv4+mv5+mv6	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'Enviromentally Sen'
*!*		@ln,27 say mw3c+mw4c+mw5c pict '999,999'
*!*		@ln,35 say w3ac+w4ac+w5ac pict '999,999.99'
*!*		@ln,50 say mw3+mw4+mw5+mw6	pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Commercial'
*!*		@ln,27 say mc1c+mc3c+mc4c+mc5c+mc9c+canum+cbnum+cfnum+cinum+cpnum+;
*!*		cznum pict '999,999'
*!*		@ln,35 say c3ac+c4ac+c5ac+c9ac pict '999,999.99'
*!*		@ln,50 say mc1+mc3+mc4+mc5+mc9+catot+cbtot+cftot+citot+cztot+cptot ;
*!*		pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Utility'
*!*		@ln,27 say mu1c+mu2c+mu3c+mu4c+mu5c+mu6c+mu9c+uanum+ubnum+ufnum+uinum+;
*!*		uznum pict '999,999'
*!*		@ln,35 say u2ac+u3ac+u4ac+u5ac+u9ac pict '999,999.99'
*!*		@ln,50 say mu1+mu2+mu3+mu4+mu5+mu6+mu9+uatot+ubtot+uftot+uitot+uztot ;
*!*		pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'Brownfield'
*!*		@ln,27 say mb1c+mb3c+mb4c+mb5c+mb6c pict '999,999'
*!*		@ln,35 say b3ac+b4ac+b5ac pict '999,999.99'
*!*		@ln,50 say mb1+mb3+mb4+mb5+mb6 pict '99,999,999,999'

*!*		ln = ln + 1
*!*			
*!*		@ln, 5 say 'FLPA (J)'
*!*		@ln,27 say mj3c+mj4c+mj5c+mj9c pict '999,999'
*!*		@ln,35 say j3ac+j4ac+j5ac+j9ac pict '999,999.99'
*!*		@ln,50 say mj3+mj4+mj5+mj9 pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'FLPA FMV (F)'
*!*		@ln,27 say mf3c+mf4c+mf5c+mf9c pict '999,999'
*!*		@ln,35 say f3ac+f4ac+f5ac+f9ac pict '999,999.99'
*!*		@ln,50 say mf3+mf4+mf5+mf9 pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		

*!*		@ln, 5 say 'Motor Vehicle'
*!*		@ln,27 say mvc pict '999,999'
*!*		@ln,50 say mv pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Mobile Home'
*!*		@ln,27 say mhc pict '999,999'
*!*		@ln,50 say mh pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Timber'
*!*		@ln,27 say tic pict '999,999'
*!*		@ln,50 say ti pict '99,999,999,999'	
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Heavy Truck Equipment'
*!*		@ln,27 say hdc pict '999,999'
*!*		@ln,50 say hd pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Gross Digest Total'
*!*		@ln,27 say GrCnt pict '999,999'	
*!*		@ln,35 say GrAc pict '999,999.99'	
*!*		@ln,50 say GrVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 2

*!*		@ln, 5 say 'Exemptions-Bond'
*!*		@ln,27 say BnExCnt	pict '999,999'
*!*		@ln,50 say BnExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Net Bond Digest'
*!*		@ln,27 say GrCnt - BnExCnt pict '999,999'

*!*		@ln,50 say GrVal - BnExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Gross Digest'
*!*		@ln,27 say GrCnt pict '999,999'	
*!*		@ln,35 say GrAc pict '999,999.99'	
*!*		@ln,50 say GrVal pict '99,999,999,999'

*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Exemptions M&O'	
*!*		@ln,27 say MoExCnt pict '999,999'
*!*		@ln,50 say MoExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'Net M&O Digest'
*!*		@ln,27 say GrCnt - MoExCnt pict '999,999'	
*!*		@ln,50 say GrVal - MoExVal  pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln,27 say 'TAX LEVIED'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'TYPE'
*!*		@ln,11  say 'ASSESSED VALUE'
*!*		@ln,31 say 'MILLAGE'	
*!*		@ln,48 say 'TAX'
*!*		
*!*		ln = ln + 1
*!*		
*!*		@ln, 5 say 'M&O'
*!*		@ln,12 say GrVal - MoExVal pict '99,999,999,999'
*!*		
*!*		ln = ln + 1

*!*		@ln, 5 say 'Bond'
*!*		@ln,12 say GrVal - BnExVal pict '99,999,999,999'
		
*pg y
		
*!*		If at('tift',lower(defaults.coname)) > 0
*!*		
*!*			ln = 62

*!*			@ln,  5 say chr(3)
*!*			
*!*			
*!*		***2nd page	
*!*			
*!*			ln = 2
*!*			cl = 18
*!*			co = trim(upper(defaults.coname)) +' COUNTY - MORATORIUM ASSESSED VALUE'
*!*			ct = (80-len(co))/2
*!*			
*!*			@ln, 5 say 'Counts/Values contained herein are unofficial and should be used only be the TAO office.'
*!*			ln = ln + 1	
*!*			@ln, 5 say 'The counts/values should be used for comparative/confirmation purposes only.'

*!*			ln = 5
*!*			
*!*			@ln, 5 say date()
*!*			@ln,ct say co
*!*			@ln,66 say "Pg 4"
*!*			
*!*			ln = ln + 1
*!*			
*!*			@ln, 5 say time()
*!*			ln = ln + 1
*!*			ln = ln + 1
*!*			
*!*			If at('/',ad) > 0
*!*				@ln, 5 say 'TAX DISTRICTS:  ' + ad
*!*			Else
*!*				@ln, 5 say 'TAX DISTRICT:  ' + ad
*!*			EndIf

*!*			@ln,70-len('Parcel Count: ' + alltrim(str(pcnt,6,0))) say 'Parcel Count: ' + alltrim(str(pcnt,6,0))

*!*			ln = ln + 2
*!*			
*!*			@ln, 5 say 'City of Tifton Exemptions'
*!*			
*!*			ln = ln + 2
*!*		
*!*			@ln, 5 say 'CODE'
*!*			@ln,10 say 'COUNT'
*!*			@ln,20 say 'CITY'
*!*			
*!*			ln = ln + 2
*!*			
*!*			@ln, 5 say 'C1'
*!*			@ln,10 say exc1cnt pict '999,999'
*!*			@ln,20 say exc1 pict '999,999,999'

*!*			ln = ln + 2
*!*			
*!*			@ln, 5 say 'C2'
*!*			@ln,10 say exc2cnt pict '999,999'
*!*			@ln,20 say exc2 pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'C3'
*!*			@ln,10 say exc3cnt pict '999,999'
*!*			@ln,20 say exc3 pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'C4'
*!*			@ln,10 say exc4cnt pict '999,999'
*!*			@ln,20 say exc4 pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'C9'
*!*			@ln,10 say exc9cnt pict '999,999'
*!*			@ln,20 say exc9 pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'CC'
*!*			@ln,10 say excccnt pict '999,999'
*!*			@ln,20 say excc pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'CL'
*!*			@ln,10 say exclcnt pict '999,999'
*!*			@ln,20 say exclx pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'CS'
*!*			@ln,10 say excscnt pict '999,999'
*!*			@ln,20 say excs pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'M1'
*!*			@ln,10 say exm1cnt pict '999,999'
*!*			@ln,20 say exm1 pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'M2'
*!*			@ln,10 say exm2cnt pict '999,999'
*!*			@ln,20 say exm2 pict '999,999,999'

*!*			ln = ln + 2

*!*			@ln, 5 say 'SX'
*!*			@ln,10 say sxcount pict '999,999'
*!*			@ln,20 say sx pict '999,999,999'

*!*			ln = ln + 2

*!*		EndIf &&tiftco page 4
	
	
	set print to
	set device to screen

	close all
	
	clear
	
	@ 4,20 say '*** The MAV Consolidation Report is for use in the TAO only.  It should not be'
	@ 5,20 say "*** considered as the OFFICIAL report which should come from the TC's office."
	@ 6,20 say '*** The primary functions of this report should be for confirmation/ comparative'
	@ 7,20 say '*** purposes.'
	  
	@ 9,20 say 'Notepad will now run and open the CRMAV+[date]+[time].txt allowing you to make'
	@10,20 say 'the necessary setup modifications so the Consolidation Sheet can be printed.'  
	@12,20 say 'If the data is not in a readable format, Highlight all of the text by going to'
	@13,20 say 'Edit>>Select All.  Go, to Format>>Font.  Reduce the Point size to the level that'
	@14,20 say 'provides a readable document and one that can be printed on 8.5 x 11 paper with'
	@15,20 say 'Portrait orientation.'
	@17,20 say 'To print the text, go to File>>Print.  You can close Notepad and return to'
	@18,20 say 'Fox by clicking the "X" in the upper right-hand corner of the Notepad window.'
	@22,20 say 'When you are ready to run Notepad and view the data, press any key...'

	InKey(0)
	
	run /N3 notepad CR&dt
	
	
	return

*-----------------------------------------------------------------------------
FUNCTION MavMDigA

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      ma1 = ma1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0
	      ma1c = ma1c + 1
	    EndIf  
      mp1 = mp1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
      
      	If digclass = 'P'
	        mp1c = mp1c + 1
	      Else
	       	mv1c = mv1c + 1
	      EndIf
	       	 
      EndIf 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0 
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,iif(digclass='P','P','V'),realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					

    Case Digstrat = '2'
      ma2 = ma2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0 
	      ma2c = ma2c + 1
	    EndIf  
      mp2 = mp2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp2c = mp2c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
    
      ma3 = ma3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      ma3c = ma3c + 1
      mp3 = mp3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp3c = mp3c + 1
      EndIf
      a3ac = a3ac + TotalAcres

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0));
	      					,alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      ma4 = ma4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      ma4c = ma4c + 1
      mp4 = mp4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp4c = mp4c + 1
      EndIf
      a4ac = a4ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
    
      ma5 = ma5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      ma5c = ma5c + 1
      mp5 = mp5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp5c = mp5c + 1
      EndIf
      a5ac = a5ac + TotalAcres

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      ma6 = ma6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      ma6c = ma6c + 1
      mp6 = mp6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp6c = mp6c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      ma9 = ma9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      ma9c = ma9c + 1
      mp9 = mp9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp9c = mp9c + 1
      EndIf
      a9ac = a9ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
          
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigR

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mr1 = mr1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mr1c = mr1c + 1
      mp1 = mp1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp1c = mp1c + 1
      EndIf 

			If mavag > 0 or mavag + mavpref = 0 
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),;
	      					realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mr2 = mr2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mr2c = mr2c + 1
      mp2 = mp2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp2c = mp2c + 1
      EndIf

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					

    Case Digstrat = '3'
      mr3 = mr3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mr3c = mr3c + 1
      mp3 = mp3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp3c = mp3c + 1
      EndIf
      r3ac = r3ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					

    Case Digstrat = '4'
      mr4 = mr4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mr4c = mr4c + 1
      mp4 = mp4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp4c = mp4c + 1
      EndIf
      r4ac = r4ac + TotalAcres 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    Case Digstrat = '5'
      mr5 = mr5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mr5c = mr5c + 1
      mp5 = mp5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp5c = mp5c + 1
      EndIf
      r5ac = r5ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mr6 = mr6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mr6c = mr6c + 1
      mp6 = mp6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp6c = mp6c + 1
      EndIf
    Case Digstrat = '9'
      mr9 = mr9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mr9c = mr9c + 1
      mp9 = mp9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp9c = mp9c + 1
      EndIf
      r9ac = r9ac + TotalAcres 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigC

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mc1 = mc1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mc1c = mc1c + 1
      
*!*	      sele commcnt
*!*	      append blank
*!*	      replace realkey with realprop.realkey
*!*	      sele realprop
      
      mp1 = mp1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp1c = mp1c + 1
      EndIf

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
       
    Case Digstrat = '2'
      mc2 = mc2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mc2c = mc2c + 1
      mp2 = mp2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp2c = mp2c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mc3 = mc3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mc3c = mc3c + 1
      mp3 = mp3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp3c = mp3c + 1
      EndIf
      c3ac = c3ac + TotalAcres 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    Case Digstrat = '4'
      mc4 = mc4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mc4c = mc4c + 1
      mp4 = mp4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp4c = mp4c + 1
      EndIf
      c4ac = c4ac + TotalAcres

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mc5 = mc5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mc5c = mc5c + 1
      mp5 = mp5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp5c = mp5c + 1
      EndIf
      c5ac = c5ac + TotalAcres

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mc6 = mc6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mc6c = mc6c + 1
      mp6 = mp6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp6c = mp6c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mc9 = mc9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mc9c = mc9c + 1
      mp9 = mp9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp9c = mp9c + 1
      EndIf
      c9ac = c9ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
                  
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigI

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mi1 = mi1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mi1c = mi1c + 1
      mp1 = mp1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp1c = mp1c + 1
      EndIf 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mi2 = mi2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mi2c = mi2c + 1
      mp2 = mp2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp2c = mp2c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mi3 = mi3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mi3c = mi3c + 1
      mp3 = mp3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp3c = mp3c + 1
      EndIf
      i3ac = i3ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      mi4 = mi4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mi4c = mi4c + 1
      mp4 = mp4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp4c = mp4c + 1
      EndIf
      i4ac = i4ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mi5 = mi5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mi5c = mi5c + 1
      mp5 = mp5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp5c = mp5c + 1
      EndIf
      i5ac = i5ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mi6 = mi6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mi6c = mi6c + 1
      mp6 = mp6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp6c = mp6c + 1
      EndIf
      
 			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					

    Case Digstrat = '9'
      mi9 = mi9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mi9c = mi9c + 1
      mp9 = mp9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp9c = mp9c + 1
      EndIf
      i9ac = i9ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
                  
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigV

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	
	
	sele landsubs
	seek realprop.realkey

  aac = 0
  pac = 0
  
  Do While !eof() and realkey = realprop.realkey
  
  	If !pref and sub_type <> 'CUV'
  	
  		aac  = aac + acres
  		
  	Else
  	
  		If sub_type <> 'CUV'
  	
    		pac = pac + acres
    		
    	EndIf	

  			
  	EndIf
  	
  	skip
  	
  EndDo
	
	sele realprop
	

	Do Case
    Case DigStrat = '1'
    
    	If mavag + saleland1 > 0
	      ma1 = ma1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
	      ma1c = ma1c + 1
	    EndIf
	      
	    mv1 = mv1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
	    
      If mavpref > 0
        mv1c = mv1c + 1
      EndIf 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
    
    	If mavag + saleland1 > 0
    	
	      ma2 = ma2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
	      ma2c = ma2c + 1
	      
	    EndIf
	      
      mv2 = mv2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mv2c = mv2c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
    
    	If saleland1 + a_value > 0
    	
	      ma3 = ma3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
	      ma3c = ma3c + 1

			EndIf
			
      mv3 = mv3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mv3c = mv3c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
      v3ac = v3ac + pac
      a3ac = a3ac + aac
            
    Case Digstrat = '4'
    
    	If saleland1 + mavag > 0
    	
	      ma4 = ma4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
	      ma4c = ma4c + 1
	      
	    EndIf
	      
      mv4 = mv4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mv4c = mv4c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
      v4ac = v4ac + pac
      a4ac = a4ac + aac
          
    Case Digstrat = '5'
    
    	If saleland1 + mavag > 0

	      ma5 = ma5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
	      ma5c = ma5c + 1
			
			EndIf
			
      mv5 = mv5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mv5c = mv5c + 1
      EndIf
      
      v5ac = v5ac + pac
      a5ac = a5ac + aac
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '6'
    
    	If saleland1 + mavag > 0
    	
	      ma6 = ma6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
	      ma6c = ma6c + 1

			EndIf

      mv6 = mv6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mv6c = mv6c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
    
    	If saleland1 + mavag > 0
    	
	      ma9 = ma9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
	      ma9c = ma9c + 1

			EndIf

      mv9 = mv9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mv9c = mv9c + 1
      EndIf
      v9ac = v9ac + pac
      a9ac = a9ac + aac
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
            
    OtherWise
    
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1

      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'V',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigW

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mw1 = mw1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mw1c = mw1c + 1
      mp1 = mp1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp1c = mp1c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
       
    Case Digstrat = '2'
      mw2 = mw2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mw2c = mw2c + 1
      mp2 = mp2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp2c = mp2c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mw3 = mw3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mw3c = mw3c + 1
      mp3 = mp3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp3c = mp3c + 1
      EndIf
      w3ac = w3ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      mw4 = mw4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mw4c = mw4c + 1
      mp4 = mp4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp4c = mp4c + 1
      EndIf
      w4ac = w4ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mw5 = mw5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mw5c = mw5c + 1
      mp5 = mp5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp5c = mp5c + 1
      EndIf
      w5ac = w5ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mw6 = mw6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mw6c = mw6c + 1
      mp6 = mp6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp6c = mp6c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mw9 = mw9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mw9c = mw9c + 1
      mp9 = mp9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp9c = mp9c + 1
      EndIf
      w9ac = w9ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigT

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mt1 = mt1 + round((mavag + mavpref) * .4,0)
      mt1c = mt1c + 1
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mt2 = mt2 + round((mavag + mavpref) * .4,0)
      mt2c = mt2c + 1

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mt3 = mt3 + round((mavag + mavpref) * .4,0)
      mt3c = mt3c + 1
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
      t3ac = t3ac + TotalAcres      
    Case Digstrat = '4'
      mt4 = mt4 + round((mavag + mavpref) * .4,0)
      mt4c = mt4c + 1
      t4ac = t4ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mt5 = mt5 + round((mavag + mavpref) * .4,0)
      mt5c = mt5c + 1
      t5ac = t5ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mt6 = mt6 + round((mavag + mavpref) * .4,0)
      mt6c = mt6c + 1
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mt9 = mt9 + round((mavag + mavpref) * .4,0)
      mt9c = mt9c + 1
      t9ac = t9ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    OtherWise
      munk = munk + round((mavag + mavpref) * .4,0)
      munkc = munkc + 1
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
  EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigP

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mp1 = mp1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      mp1c = mp1c + 1
      ma1 = ma1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0
        ma1c = ma1c + 1
      EndIf
      
			If mavag > 0 or ovrideval + mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0 
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
       
    Case Digstrat = '2'
      mp2 = mp2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      mp2c = mp2c + 1
      ma2 = ma2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If OvRideVal = 0 .and. mavag > 0
        ma2c = ma2c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '3'
      mp3 = mp3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      mp3c = mp3c + 1
      ma3 = ma3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0
        ma3c = ma3c + 1
      EndIf
      p3ac = p3ac + TotalAcres
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      	
      		p3ac = p3ac - acres
      		a3ac = a3ac + acres
      		aac = aac + acres
      		
      	EndIf
      	
      	If pref      	
      		pac = pac + acres
      	EndIf
      	
      	skip		
      EndDo
      
      sele realprop

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '4'
      mp4 = mp4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      mp4c = mp4c + 1
      ma4 = ma4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0
        ma4c = ma4c + 1
      EndIf
      p4ac = p4ac + TotalAcres  

      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      		p4ac = p4ac - acres
      		a4ac = a4ac + acres
      		aac  = aac + acres
      	EndIf
      	
      	If pref
      		pac = pac + acres	
      	EndIf
      	
      	skip		
      EndDo
      
      sele realprop

			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
          
    Case Digstrat = '5'
    
      mp5 = mp5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      mp5c = mp5c + 1
      ma5 = ma5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0
        ma5c = ma5c + 1
      EndIf
      p5ac = p5ac + TotalAcres      
      
      sele landsubs
      seek realprop.realkey
      
      aac = 0
      pac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      		p5ac = p5ac - acres
      		a5ac = a5ac + acres
      		aac  = aac + acres
      	EndIf
      	
      	If pref
      		pac = pac + acres
      	EndIf
      		
      	skip		
      EndDo
      
      sele realprop
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
      
    Case Digstrat = '6'
      mp6 = mp6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      mp6c = mp6c + 1
      ma6 = ma6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0
        ma6c = ma6c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mp9 = mp9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      mp9c = mp9c + 1
      ma9 = ma9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      If mavag > 0
        ma9c = ma9c + 1
      EndIf
      p9ac = p9ac + TotalAcres  
      
      sele landsubs
      seek realprop.realkey
      
      pac = 0
      aac = 0
      
      Do While !eof() and realkey = realprop.realkey
      	If sub_type <> 'CUV' and !pref
      		p9ac = p9ac - acres
      		a9ac = a9ac + acres
      		aac  = aac + acres
      	EndIf
      	
      	If pref
      		pac = pac + acres
      	EndIf
      		
      	skip		
      EndDo
      
      sele realprop
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),aac,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),pac,realprop.taxdistric)
	    EndIf  					
      
          
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigH

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mh1 = mh1 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mh1c = mh1c + 1
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)

    Case Digstrat = '2'
      mh2 = mh2 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mh2c = mh2c + 1
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)

    Case Digstrat = '3'
      mh3 = mh3 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mh3c = mh3c + 1
      h3ac = h3ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)

    Case Digstrat = '4'
      mh4 = mh4 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mh4c = mh4c + 1
      h4ac = h4ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)

    Case Digstrat = '5'
      mh5 = mh5 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mh5c = mh5c + 1
      h5ac = h5ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)

            
    Case Digstrat = '6'
      mh6 = mh6 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mh6c = mh6c + 1
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)

    Case Digstrat = '9'
      mh9 = mh9 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mh9c = mh9c + 1
      h9ac = h9ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    OtherWise
    
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return

*-----------------------------------------------------------------------------
FUNCTION MavMDigB

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mb1 = mb1 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mb1c = mb1c + 1
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
      
    Case Digstrat = '3'
      mb3 = mb3 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mb3c = mb3c + 1
      b3ac = b3ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '4'
      mb4 = mb4 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mb4c = mb4c + 1
      b4ac = b4ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '5'
      mb5 = mb5 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mb5c = mb5c + 1
      b5ac = b5ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '6'
      mb6 = mb6 + iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0))
      mb6c = mb6c + 1
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round((saleland1+saleland2)*.4,0),round((mavag + mavpref) * .4,0)),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
      
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
  
*-----------------------------------------------------------------------------
FUNCTION MavMDigE

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '0'
      me0 = me0 + round((mavag + mavpref) * .4,0)
      me0c = me0c + 1
      e0ac = e0ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case DigStrat = '1'
      me1 = me1 + round((mavag + mavpref) * .4,0)
      me1c = me1c + 1
      e1ac = e1ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
            
    Case Digstrat = '2'
      me2 = me2 + round((mavag + mavpref) * .4,0)
      me2c = me2c + 1
      e2ac = e2ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '3'
      me3 = me3 + round((mavag + mavpref) * .4,0)
      me3c = me3c + 1
      e3ac = e3ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '4'
      me4 = me4 + round((mavag + mavpref) * .4,0)
      me4c = me4c + 1
      e4ac = e4ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '5'
      me5 = me5 + round((mavag + mavpref) * .4,0)
      me5c = me5c + 1
      e5ac = e5ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '6'
      me6 = me6 + round((mavag + mavpref) * .4,0)
      me6c = me6c + 1
      e6ac = e6ac + TotalAcres

			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '7'
      me7 = me7 + round((mavag + mavpref) * .4,0)
      me7c = me7c + 1
      e7ac = e7ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '8'
      me8 = me8 + round((mavag + mavpref) * .4,0)
      me8c = me8c + 1
      e8ac = e8ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    Case Digstrat = '9'
      me9 = me9 + round((mavag + mavpref) * .4,0)
      me9c = me9c + 1
      e9ac = e9ac + TotalAcres
      
			cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					round((mavag + mavpref) * .4,0),;
	      					alias(),realprop.totalacres,realprop.taxdistric)
                  
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
*-----------------------------------------------------------------------------
FUNCTION MavMDigU

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	Do Case
    Case DigStrat = '1'
      mu1 = mu1 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mu1c = mu1c + 1
      mp1 = mp1 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp1c = mp1c + 1
      EndIf 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '2'
      mu2 = mu2 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mu2c = mu2c + 1
      mp2 = mp2 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp2c = mp2c + 1
      EndIf
			u2ac = u2ac + TotalAcres 
			
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
			     
    Case Digstrat = '3'
      mu3 = mu3 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mu3c = mu3c + 1
      mp3 = mp3 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp3c = mp3c + 1
      EndIf
      u3ac = u3ac + TotalAcres 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    Case Digstrat = '4'
      mu4 = mu4 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mu4c = mu4c + 1
      mp4 = mp4 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp4c = mp4c + 1
      EndIf
      u4ac = u4ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '5'
      mu5 = mu5 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mu5c = mu5c + 1
      mp5 = mp5 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp5c = mp5c + 1
      EndIf
      u5ac = u5ac + TotalAcres
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
            
    Case Digstrat = '6'
      mu6 = mu6 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mu6c = mu6c + 1
      mp6 = mp6 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp6c = mp6c + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
    Case Digstrat = '9'
      mu9 = mu9 + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      mu9c = mu9c + 1
      mp9 = mp9 + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        mp9c = mp9c + 1
      EndIf
      u9ac = u9ac + TotalAcres 
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
           
    OtherWise
      munk = munk + iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0))
      munkc = munkc + 1
      munk = munk + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
      If mavpref > 0
        munkc = munkc + 1
      EndIf
      
			If mavag > 0 or mavag + mavpref = 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,realprop.digclass,realprop.digstrat,;
	      					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
	    EndIf  					
            
			If mavpref > 0
	      cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'P',realprop.digstrat,;
	      					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
	    EndIf  					
      
	EndCase
  return
  
*-----------------------------------------------------------------------------
FUNCTION MavMDigJ

	lsb3 = .f.
	
	If sale_val
		lsb3 = .t.
	EndIf	

	dsx = digstrat
	dcx = digstrat + 'c'
	dax = digstrat + 'ac'
	
	mj&dsx = mj&dsx + iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0))
	mj&dcx = mj&dcx + 1
	j&dax  = j&dax + TotalAcres

	If mavag > 0 or mavag + mavpref = 0
    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'A',realprop.digstrat,;
    					iif(lsb3,round(saleland1*.4,0),round(mavag*.4,0)),alias(),realprop.totalacres,realprop.taxdistric)
  EndIf  					
        
	If mavpref > 0
    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'J',realprop.digstrat,;
    					iif(lsb3,round(saleland2*.4,0),round(mavpref*.4,0)),alias(),0,realprop.taxdistric)
  EndIf  					
	
	sele 14
	use flpamain
	set order to realkey
	
	seek realprop.realkey
	
	If found()
	
		mf&dsx = mf&dsx + round(currflpa * .4,0)
		
		sele realprop
		
		f&dax  = f&dax + flpamain.covacres
		mf&dcx = mf&dcx + 1

		If flpamain.currflpa > 0 
	    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'F',realprop.digstrat,;
	    					round(flpamain.currflpa * .4,0),alias(),flpamain.covacres,realprop.taxdistric)
	  EndIf  					
	        
	Else
	
		sele realprop
		
	EndIf
		
	return	
	
  
*-----------------------------------------------------------------------------
FUNCTION MavAddComm()

	local Pn 
	
	Pn = space(14)

	sele A
	sele D
	Use CommImp
*!*		If NetErr()
*!*		  clear
*!*		  @10, 0 say padc('File cannot be opened...Press any key',80)
*!*		  InKey(0)
*!*		  close all
*!*		  return
*!*		EndIf 
*	set relation to RealKey into A

	Do While .not. Eof() .and. Key <> 27
	  Key  = InKey()
	  linc = .f.
	  lsb3 = .f.
	  
	  sele realprop
	  seek commimp.realkey
	  
	  If sale_val
	  	lsb3 = .t.
	  EndIf	
	  
	  If income 
	  	linc = .t.
	  EndIf	

		lfr = .f.
		
	  If found()
	  	lfr = .t.
			ltd = .f.
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele commimp

	  	If linc
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	

		  If mavbldg = 0

		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  
		  EndIf

	  	
	  	If !ltd
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf	
	  EndIf	
	  
	  If !lfr
	  	sele commimp
	  	skip
	  	If eof()
	  		exit
	  	Else
	  		loop
	  	EndIf
	  Else
	  	sele commimp
	  EndIf				

	  Do Case
*!*		  	Case a->Spdist
*!*		  		skip
*!*		  		If eof()
*!*		  			skip
*!*		  		EndIf	
		  Case DigClass = 'A' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      ma1 = ma1 + ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      ma1c = ma1c + 1
			    Case Digstrat = '2'
			      ma2 = ma2 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      ma2c = ma2c + 1
			    Case Digstrat = '3'
			      ma3 = ma3 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      ma3c = ma3c + 1
			    Case Digstrat = '4'
			      ma4 = ma4 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      ma4c = ma4c + 1
			    Case Digstrat = '5'
			      ma5 = ma5 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      ma5c = ma5c + 1
			    Case Digstrat = '6'
			      ma6 = ma6 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      ma6c = ma6c + 1
			    Case Digstrat = '9'
			      ma9 = ma9 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      ma9c = ma9c + 1
			    OtherWise
			      munk = munk +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
	  	Case DigClass = 'R' .and. RealKey = a->RealKey
	  		Do Case
			    Case DigStrat = '1'
			      mr1 = mr1 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mr1c = mr1c + 1
			    Case Digstrat = '2'
			      mr2 = mr2 +  ;
			      iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mr2c = mr2c + 1
			    Case Digstrat = '3'
			      mr3 = mr3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mr3c = mr3c + 1
			    Case Digstrat = '4'
			      mr4 = mr4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mr4c = mr4c + 1
			    Case Digstrat = '5'
			      mr5 = mr5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mr5c = mr5c + 1
			    Case Digstrat = '6'
			      mr6 = mr6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mr6c = mr6c + 1
			    Case Digstrat = '9'
			      mr9 = mr9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mr9c = mr9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'C' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mc1 = mc1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mc1c = mc1c + 1
			      
*!*				      sele commcnt
*!*				      append blank
*!*				      replace realkey with commimp.realkey,;
*!*				      				commkey with commimp.commkey
*!*				      sele commimp
			      				
			    Case Digstrat = '2'
			      mc2 = mc2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mc2c = mc2c + 1
			    Case Digstrat = '3'
			      mc3 = mc3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mc3c = mc3c + 1
			    Case Digstrat = '4'
			      mc4 = mc4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mc4c = mc4c + 1
			    Case Digstrat = '5'
			      mc5 = mc5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mc5c = mc5c + 1
			    Case Digstrat = '6'
			      mc6 = mc6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mc6c = mc6c + 1
			    Case Digstrat = '9'
			      mc9 = mc9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mc9c = mc9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'I' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mi1 = mi1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mi1c = mi1c + 1
			    Case Digstrat = '2'
			      mi2 = mi2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mi2c = mi2c + 1
			    Case Digstrat = '3'
			      mi3 = mi3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mi3c = mi3c + 1
			    Case Digstrat = '4'
			      mi4 = mi4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mi4c = mi4c + 1
			    Case Digstrat = '5'
			      mi5 = mi5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mi5c = mi5c + 1
			    Case Digstrat = '6'
			      mi6 = mi6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mi6c = mi6c + 1
			    Case Digstrat = '9'
			      mi9 = mi9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mi9c = mi9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'V' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mv1 = mv1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mv1c = mv1c + 1
			    Case Digstrat = '2'
			      mv2 = mv2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mv2c = mv2c + 1
			    Case Digstrat = '3'
			      mv3 = mv3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mv3c = mv3c + 1
			    Case Digstrat = '4'
			      mv4 = mv4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mv4c = mv4c + 1
			    Case Digstrat = '5'
			      mv5 = mv5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mv5c = mv5c + 1
			    Case Digstrat = '6'
			      mv6 = mv6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mv6c = mv6c + 1
			    Case Digstrat = '9'
			      mv9 = mv9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mv9c = mv9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'W' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mw1 = mw1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mw1c = mw1c + 1
			    Case Digstrat = '2'
			      mw2 = mw2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mw2c = mw2c + 1
			    Case Digstrat = '3'
			      mw3 = mw3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mw3c = mw3c + 1
			    Case Digstrat = '4'
			      mw4 = mw4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mw4c = mw4c + 1
			    Case Digstrat = '5'
			      mw5 = mw5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mw5c = mw5c + 1
			    Case Digstrat = '6'
			      mw6 = mw6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mw6c = mw6c + 1
			    Case Digstrat = '9'
			      mw9 = mw9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mw9c = mw9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'T' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mt1 = mt1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mt1c = mt1c + 1
			    Case Digstrat = '2'
			      mt2 = mt2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mt2c = mt2c + 1
			    Case Digstrat = '3'
			      mt3 = mt3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mt3c = mt3c + 1
			    Case Digstrat = '4'
			      mt4 = mt4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mt4c = mt4c + 1
			    Case Digstrat = '5'
			      mt5 = mt5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mt5c = mt5c + 1
			    Case Digstrat = '6'
			      mt6 = mt6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mt6c = mt6c + 1
			    Case Digstrat = '9'
			      mt9 = mt9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mt9c = mt9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'P' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mp1 = mp1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mp1c = mp1c + 1
			    Case Digstrat = '2'
			      mp2 = mp2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mp2c = mp2c + 1
			    Case Digstrat = '3'
			      mp3 = mp3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mp3c = mp3c + 1
			    Case Digstrat = '4'
			      mp4 = mp4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mp4c = mp4c + 1
			    Case Digstrat = '5'
			      mp5 = mp5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mp5c = mp5c + 1
			    Case Digstrat = '6'
			      mp6 = mp6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mp6c = mp6c + 1
			    Case Digstrat = '9'
			      mp9 = mp9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mp9c = mp9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
	  	Case DigClass = 'H' .and. RealKey = a->RealKey
	  		Do Case
			    Case DigStrat = '1'
			      mh1 = mh1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mh1c = mh1c + 1
			    Case Digstrat = '2'
			      mh2 = mh2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mh2c = mh2c + 1
			    Case Digstrat = '3'
			      mh3 = mh3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mh3c = mh3c + 1
			    Case Digstrat = '4'
			      mh4 = mh4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mh4c = mh4c + 1
			    Case Digstrat = '5'
			      mh5 = mh5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mh5c = mh5c + 1
			    Case Digstrat = '6'
			      mh6 = mh6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mh6c = mh6c + 1
			    Case Digstrat = '9'
			      mh9 = mh9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mh9c = mh9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
	    Case DigClass = 'E' .and. RealKey = a->RealKey
	    	Do Case
			    Case DigStrat = '0'
			      me0 = me0 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me0c = me0c + 1
			    Case DigStrat = '1'
			      me1 = me1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me1c = me1c + 1
			    Case Digstrat = '2'
			      me2 = me2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me2c = me2c + 1
			    Case Digstrat = '3'
			      me3 = me3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me3c = me3c + 1
			    Case Digstrat = '4'
			      me4 = me4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me4c = me4c + 1
			    Case Digstrat = '5'
			      me5 = me5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me5c = me5c + 1
			    Case Digstrat = '6'
			      me6 = me6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me6c = me6c + 1
			    Case Digstrat = '7'
			      me7 = me7 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me7c = me7c + 1
			    Case Digstrat = '8'
			      me8 = me8 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me8c = me8c + 1
			    Case Digstrat = '9'
			      me9 = me9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      me9c = me9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'U' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mu1 = mu1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mu1c = mu1c + 1
			    Case Digstrat = '2'
			      mu2 = mu2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mu2c = mu2c + 1
			    Case Digstrat = '3'
			      mu3 = mu3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mu3c = mu3c + 1
			    Case Digstrat = '4'
			      mu4 = mu4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mu4c = mu4c + 1
			    Case Digstrat = '5'
			      mu5 = mu5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mu5c = mu5c + 1
			    Case Digstrat = '6'
			      mu6 = mu6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mu6c = mu6c + 1
			    Case Digstrat = '9'
			      mu9 = mu9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mu9c = mu9c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase
**B
		  Case DigClass = 'B' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mb1 = mb1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mb1c = mb1c + 1
			    Case Digstrat = '3'
			      mb3 = mb3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mb3c = mb3c + 1
			    Case Digstrat = '4'
			      mb4 = mb4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mb4c = mb4c + 1
			    Case Digstrat = '5'
			      mb5 = mb5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mb5c = mb5c + 1
			    Case Digstrat = '6'
			      mb6 = mb6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      mb6c = mb6c + 1
			    OtherWise
			      munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
			      munkc = munkc + 1
				EndCase


	  	OtherWise
		    munk = munk + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0))
		    munkc = munkc + 1
	  EndCase
	  
    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,commkey,digclass,digstrat,;
    					iif(lsb3, round((sb346val + sb346add) * .4,0),round(mavbldg * .4,0)),;
    					alias(),0,realprop.taxdistric)
	  
	  skip
*!*		  TBar()
	EndDo
	return
	

*-----------------------------------------------------------------------------
FUNCTION MavConsRep

	Do While .not. Eof() .and. Key <> 27
	  Key = InKey()

	 	  
	  sele realprop
	  seek reprop.realkey
 
	  lfr = .f.

	  If found()
	  	lfr  = .t.
			ltd  = .f.
			linc = .f.
			lsb3 = .f.
			
			If sale_val
				lsb3 = .t.
			EndIf
			
			If income 
				linc = .t.
			EndIf	
			
			sele tdtemp
			
			loca for taxdistric = realprop.taxdistric
			  
			If found()
				ltd = .t.  
			EndIf
			
  
	  	sele reprop

	  	If linc
		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  EndIf
		  
		  If mav = 0

		  	skip
		  	If !eof()
	  			loop
	  		Else
	  			exit
		  	EndIf		
		  
		  EndIf
		  
		Else
		
			sele reprop
			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf	
		  
	  EndIf	

	  	
  	If !ltd
	  	skip
	  	If !eof()
  			loop
  		Else
  			exit
	  	EndIf		
	  EndIf	
	 
	  
	  If !lfr
	  	sele reprop
	  	skip
	  	If eof()
	  		exit
	  	Else
	  		loop
	  	EndIf
	  Else
	  	sele reprop
	  EndIf				
	  
	  Do Case
*!*		  	Case a->Spdist
*!*		  		skip
*!*		  		loop
*!*		  		If eof()
*!*		  			exit
*!*		  		EndIf	
	  	Case DigClass = 'A' .and. RealKey = a->RealKey
	  		Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      ma1 = ma1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      ma1 = ma1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      ma1c = ma1c + 1
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      ma2 = ma2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      ma2 = ma2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      ma2c = ma2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      ma3 = ma3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      ma3 = ma3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      ma3c = ma3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      ma4 = ma4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      ma4 = ma4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      ma4c = ma4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      ma5 = ma5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      ma5 = ma5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      ma5c = ma5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      ma6 = ma6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      ma6 = ma6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      ma6c = ma6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      ma9 = ma9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      ma9 = ma9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      ma9c = ma9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'R' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mr1 = mr1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mr1 = mr1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mr1c = mr1c + 1
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      mr2 = mr2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mr2 = mr2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mr2c = mr2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      mr3 = mr3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mr3 = mr3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mr3c = mr3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      mr4 = mr4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mr4 = mr4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mr4c = mr4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      mr5 = mr5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mr5 = mr5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mr5c = mr5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mr6 = mr6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mr6 = mr6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mr6c = mr6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mr9 = mr9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mr9 = mr9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mr9c = mr9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
	 	  Case DigClass = 'C' .and. RealKey = a->RealKey
	 	  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mc1 = mc1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mc1 = mc1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mc1c = mc1c + 1
			      
*!*				      sele commcnt
*!*				      append blank
*!*				      replace realkey with reprop.realkey,;
*!*				      				repropkey with reprop.repropkey
*!*				      sele reprop
			      				
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      mc2 = mc2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mc2 = mc2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mc2c = mc2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      mc3 = mc3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mc3 = mc3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mc3c = mc3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      mc4 = mc4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mc4 = mc4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mc4c = mc4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      mc5 = mc5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mc5 = mc5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mc5c = mc5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mc6 = mc6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mc6 = mc6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mc6c = mc6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mc9 = mc9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mc9 = mc9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mc9c = mc9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'H' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mh1 = mh1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mh1 = mh1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mh1c = mh1c + 1
			    Case Digstrat = '2'
			    	If Ovr_Val = 0
				      mh2 = mh2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mh2 = mh2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mh2c = mh2c + 1
			    Case Digstrat = '3'
			    	If Ovr_Val = 0
				      mh3 = mh3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mh3 = mh3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mh3c = mh3c + 1
			    Case Digstrat = '4'
			    	If Ovr_Val = 0
				      mh4 = mh4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mh4 = mh4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mh4c = mh4c + 1
			    Case Digstrat = '5'
			    	If Ovr_Val = 0
				      mh5 = mh5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mh5 = mh5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mh5c = mh5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mh6 = mh6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mh6 = mh6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mh6c = mh6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mh9 = mh9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mh9 = mh9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mh9c = mh9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'I' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mi1 = mi1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mi1 = mi1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mi1c = mi1c + 1
*!*				    Case Digstrat = '2'
*!*				      mi2 = mi2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mi2c = mi2c + 1
*!*				    Case Digstrat = '3'
*!*				      mi3 = mi3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mi3c = mi3c + 1
*!*				    Case Digstrat = '4'
*!*				      mi4 = mi4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mi4c = mi4c + 1
*!*				    Case Digstrat = '5'
*!*				      mi5 = mi5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mi5c = mi5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mi6 = mi6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mi6 = mi6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mi6c = mi6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mi9 = mi9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mi9 = mi9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mi9c = mi9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'V' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mv1 = mv1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mv1 = mv1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mv1c = mv1c + 1
*!*				    Case Digstrat = '2'
*!*				      mv2 = mv2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mv2c = mv2c + 1
*!*				    Case Digstrat = '3'
*!*				      mv3 = mv3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mv3c = mv3c + 1
*!*				    Case Digstrat = '4'
*!*				      mv4 = mv4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mv4c = mv4c + 1
*!*				    Case Digstrat = '5'
*!*				      mv5 = mv5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mv5c = mv5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mv6 = mv6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mv6 = mv6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mv6c = mv6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mv9 = mv9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mv9 = mv9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mv9c = mv9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'W' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mw1 = mw1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mw1 = mw1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mw1c = mw1c + 1
*!*				    Case Digstrat = '2'
*!*				      mw2 = mw2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mw2c = mw2c + 1
*!*				    Case Digstrat = '3'
*!*				      mw3 = mw3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mw3c = mw3c + 1
*!*				    Case Digstrat = '4'
*!*				      mw4 = mw4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mw4c = mw4c + 1
*!*				    Case Digstrat = '5'
*!*				      mw5 = mw5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mw5c = mw5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mw6 = mw6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mw6 = mw6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mw6c = mw6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mw9 = mw9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mw9 = mw9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mw9c = mw9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'T' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mt1 = mt1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mt1 = mt1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mt1c = mt1c + 1
*!*				    Case Digstrat = '2'
*!*				      mt2 = mt2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mt2c = mt2c + 1
*!*				    Case Digstrat = '3'
*!*				      mt3 = mt3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mt3c = mt3c + 1
*!*				    Case Digstrat = '4'
*!*				      mt4 = mt4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mt4c = mt4c + 1
*!*				    Case Digstrat = '5'
*!*				      mt5 = mt5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mt5c = mt5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mt6 = mt6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mt6 = mt6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mt6c = mt6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mt9 = mt9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mt9 = mt9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mt9c = mt9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'P' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			    	If Ovr_Val = 0
				      mp1 = mp1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mp1 = mp1 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mp1c = mp1c + 1
*!*				    Case Digstrat = '2'
*!*				      mp2 = mp2 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mp2c = mp2c + 1
*!*				    Case Digstrat = '3'
*!*				      mp3 = mp3 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mp3c = mp3c + 1
*!*				    Case Digstrat = '4'
*!*				      mp4 = mp4 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mp4c = mp4c + 1
*!*				    Case Digstrat = '5'
*!*				      mp5 = mp5 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
*!*				      mp5c = mp5c + 1
			    Case Digstrat = '6'
			    	If Ovr_Val = 0
				      mp6 = mp6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mp6 = mp6 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mp6c = mp6c + 1
			    Case Digstrat = '9'
			    	If Ovr_Val = 0
				      mp9 = mp9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    Else
				      mp9 = mp9 + iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))
				    EndIf  				      
			      mp9c = mp9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'E' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '0'
			      me0 = me0 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me0c = me0c + 1
			    Case DigStrat = '1'
			      me1 = me1 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me1c = me1c + 1
			    Case Digstrat = '2'
			      me2 = me2 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me2c = me2c + 1
			    Case Digstrat = '3'
			      me3 = me3 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me3c = me3c + 1
			    Case Digstrat = '4'
			      me4 = me4 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me4c = me4c + 1
			    Case Digstrat = '5'
			      me5 = me5 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me5c = me5c + 1
			    Case Digstrat = '6'
			      me6 = me6 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me6c = me6c + 1
			    Case Digstrat = '7'
			      me7 = me7 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me7c = me7c + 1
			    Case Digstrat = '8'
			      me8 = me8 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me8c = me8c + 1
			    Case Digstrat = '9'
			      me9 = me9 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      me9c = me9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
		  Case DigClass = 'U' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mu1 = mu1 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mu1c = mu1c + 1
		    	Case Digstrat = '2'
		      	mu2 = mu2 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mu2c = mu2c + 1
			    Case Digstrat = '3'
			      mu3 = mu3 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mu3c = mu3c + 1
			    Case Digstrat = '4'
			      mu4 = mu4 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mu4c = mu4c + 1
			    Case Digstrat = '5'
			      mu5 = mu5 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mu5c = mu5c + 1
			    Case Digstrat = '6'
			      mu6 = mu6 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mu6c = mu6c + 1
			    Case Digstrat = '9'
			      mu9 = mu9 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mu9c = mu9c + 1
			    OtherWise
			      munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase
**b
		  Case DigClass = 'B' .and. RealKey = a->RealKey
		  	Do Case
			    Case DigStrat = '1'
			      mb1 = mb1 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mb1c = mb1c + 1
			    Case Digstrat = '3'
			      mb3 = mb3 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mb3c = mb3c + 1
			    Case Digstrat = '4'
			      mb4 = mb4 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mb4c = mb4c + 1
			    Case Digstrat = '5'
			      mb5 = mb5 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mb5c = mb5c + 1
			    Case Digstrat = '6'
			      mb6 = mb6 + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      mb6c = mb6c + 1
			    OtherWise
			      munk  = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
			      munkc = munkc + 1
				EndCase


	    OtherWise
		    munk = munk + iif(Ovr_val=0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)))
	  	  munkc = munkc + 1
	  EndCase
	  
    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,repropkey,0,digclass,digstrat,;
    					iif(Ovr_Val > 0,iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0)),;
    					iif(lsb3, round((sb346val + sb346add) * .4,0),round(mav * .4,0))),alias(),0,realprop.taxdistric)
	  
	  skip
*!*		  TBar()
	EndDo
*-----------------------------------------------------------------------------
*!*	FUNCTION Summit

*!*		use defaults
*!*		
*!*		GrCnt = mr1c+mr3c+mr4c+mr5c+mr6c+mr9c+ranum+rbnum+rfnum+rinum+rznum+;
*!*		mt1c+mt3c+mt4c+;
*!*		mh1c+mh3c+;
*!*		ma1c+ma3c+ma4c+ma5c+ma6c+ma9c+aanum+abnum+afnum+ainum+aznum+;
*!*		mp3c+mp4c+mp5c+mp6c+mp9c+;
*!*		mv3c+mv4c+mv5c+mv6c+;
*!*		mw3c+mw4c+mw5c+;
*!*		mc1c+mc3c+mc4c+mc5c+mc9c+canum+cbnum+cfnum+cinum+cznum+cpnum+;
*!*		mi1c+mi3c+mi4c+mi5c+mi9c+ianum+ibnum+ifnum+iinum+iznum+ipnum+;
*!*		mu1c+mu2c+mu3c+mu4c+mu5c+mu6c+mu9c+uanum+ubnum+ufnum+uinum+uznum+;
*!*		mvc+mhc+tic+hdc+mb1c+mb3c+mb4c+mb5c+mb6c+;
*!*		mj1c+mj3c+mj4c+mj5c+mj9c

*!*		GrAc = r3ac+r4ac+r5ac+r9ac+;
*!*		t3ac+t4ac+;
*!*		h3ac+;
*!*		a3ac+a4ac+a5ac+a9ac+;
*!*		p3ac+p4ac+p5ac+;
*!*		v3ac+v4ac+v5ac+;
*!*		w3ac+w4ac+w5ac+;
*!*		c3ac+c4ac+c5ac+c9ac+;
*!*		i3ac+i4ac+i5ac+i9ac+;
*!*		u3ac+u4ac+u5ac+u9ac+u2ac+b3ac+b4ac+b5ac+;
*!*		j3ac+j4ac+j5ac+j9ac


*!*		***bond exemptions
*!*		BnExCnt = s5count+FreeNum+Pref1ct+Pref2ct+SpNum+histcnt+TranCnt+CuCnt+sscount

*!*		BnExVal =s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
*!*		histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+ss+((SwFMV1+SwFMV2+SwACC)-SwTOT) + ;
*!*		((SjFMV1+SjFMV2)-SjTOT)



*!*		***m&0 exemptions

*!*		MoExCnt = s5count+FreeNum+Pref1ct+Pref2ct+SpNum+histcnt+TranCnt+CuCnt+;
*!*		s1count+s3count+s4count+l4count+s6count+s8count+s9count;
*!*		+sbcount+sccount+sdcount+secount+sgcount+swcnt+sscount+sjcnt  &&removed l3count
*!*		

*!*		If at('lowndes',lower(defaults.coname)) > 0
*!*			MoExCnt = MoExCnt + L1Count
*!*		EndIf	

*!*		StExVal = s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
*!*		histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+s1+s3+s465+l3c+l4c+ss+;
*!*		s6+s8+s9+sb+sg+se65+sd65 +((SwFMV1+SwFMV2+SwACC)-SwTOT)+sc65+;
*!*		((SjFMV1+SjFMV2)-SjTOT)
*!*		
*!*		
*!*		MoExVal = s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
*!*		histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+s1+s3+s4+l3c+l4c+ss+;
*!*		s6+s8+s9+sb+sg+se+sd +((SwFMV1+SwFMV2+SwACC)-SwTOT)+scc+((SjFMV1+SjFMV2)-SjTOT)
*!*	*!*		s5a

*!*		If at('lowndes',lower(defaults.coname)) > 0
*!*			MoExVal = MoExVal + L1s
*!*		EndIf	

*!*		If at('mcintosh',lower(defaults.coname)) > 0
*!*			MoExVal = MoExVal + f4c + f5c + f1c + f3c
*!*		EndIf	
*!*		


*!*		ShExVal = s5+FreeTot+(int(round(((AcPref+Pref1+Pref2)*2.5)*.1,0)))+SpTot+;
*!*		histex+TranEx+((CUFMV1+CUFMV2+CUACC)-CUTOT)+s1+s3s+s4s+l3s+l4s+ss + s6s +;
*!*		s8s + s9s + sb + ((SwFMV1+SwFMV2+SwACC)-SwTOT) + scc + sd + sg + se + ((SjFMV1+SjFMV2)-SjTOT)

*!*		If at('lowndes',lower(defaults.coname)) > 0
*!*			ShExVal = ShExVal + L1s
*!*		EndIf		

*!*		If at('mcintosh',lower(defaults.coname)) > 0
*!*			ShExVal = ShExVal + f4s + f5s + f3s + f1s
*!*		EndIf		


*!*		GrVal = mr1+mr3+mr4+mr5+mr6+mr9+ratot+rbtot+rftot+ritot+rztot+;
*!*		mt1+mt3+mt4+;
*!*		mh1+mh3+;
*!*		ma1+ma3+ma4+ma5+ma6+ma9+aatot+abtot+aftot+aitot+aztot+;
*!*		mp3+mp4+mp5+mp6+mp9+;
*!*		mv3+mv4+mv5+mv6+;
*!*		mw3+mw4+mw5+;
*!*		mc1+mc3+mc4+mc5+mc9+catot+cbtot+cftot+citot+cztot+cptot+;
*!*		mi1+mi3+mi4+mi5+mi9+iatot+ibtot+iftot+iitot+iztot+iptot+;
*!*		mu1+mu2+mu3+mu4+mu5+mu6+mu9+uatot+ubtot+uftot+uitot+uztot+;
*!*		mv+mh+ti+hd+mb1+mb3+mb4+mb5+mb6+;
*!*		mj1+mj3+mj4+mj5+mj9

*!*		close databases
*!*		
*!*		return

*-------------------------------------------------------------------------
FUNCTION cons_value_mav(rk,pn,pk,ak,res,ck,dc,ds,v4,fn,ac,td)

	sele cons_value_mav
	append blank

	replace realkey with rk,;
					parcel_no with pn,;
					perskey with pk,;
					acckey with ak,;
					repropkey with res,;
					commkey with ck,;
					digclass with dc,;
					digstrat with ds,;
					value40 with v4,;
					acres with ac,;
					taxdistric with td
					
	sele &fn
	return

*-------------------------------------------------------------------------
FUNCTION tifths

	If digclass = 'B'
	
		sb = sb + round(curr_val * .4,0) - round(histval * .4,0)
		sbcount = sbcount + 1

    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','B',;
    					round(curr_val * .4,0) - round(histval * .4,0),alias(),0,realprop.taxdistric)
		
	EndIf	

	If HomeExempt = 'S7'
		L9 = L9 + round(CurrHomVal*.4,0)
		L9Count = L9Count + 1
		
    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','7',;
    					round(CurrHomVal*.4,0),alias(),0,realprop.taxdistric)
		
	EndIf	    

	If HomeExempt = 'S6'
		L8 = L8 + round(OrigHomVal*.4,0)
		L8Count = L8Count + 1
		
    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','6',;
    					round(CurrHomVal*.4,0),alias(),0,realprop.taxdistric)
		
	EndIf	    

	If HomeExempt = 'S8'
		L9 = L9 + round(CurrHomVal*.4,0)
		L9Count = L9Count + 1
		L8 = L8 + round(OrigHomVal*.4,0)
		L8Count = L8Count + 1
	EndIf	    


	If homeexempt = 'L1 '

		Do Case
		
			Case at('lowndes',lower(defaults.coname)) > 0
			
				L1Count = L1Count + 1
				
		     if curr_val >= 5000
		        L1 = L1+(5000*.4)	        
		     else
		        L1 = L1+round(curr_val*.4,0)   	        
		     endif

		     if curr_val >= 25000
		        L1s = L1s+(25000*.4)	        
		     else
		        L1s = L1s+round(curr_val*.4,0)   	        
		     endif

			Case at('dougherty',lower(defaults.coname)) > 0			     

				L1Count = L1Count + 1
				
		     if curr_val >= 5000
		        L1 = L1+(5000*.4)	        
		     else
		        L1 = L1+round(curr_val*.4,0)   	        
		     endif

		     if curr_val >= 5000
		        L1s = L1s+(5000*.4)	        
		     else
		        L1s = L1s+round(curr_val*.4,0)   	        
		     endif
		     
	  EndCase   

	EndIf
	
  if homeexempt='S1' 
  
  	Do Case
  	
  		Case lower(defaults.coname) <> 'baldwin'
  
*	     L1COUNT=L1COUNT+1
	     S1Count=S1Count+1 
	     if curr_val>=5000
	        S1=S1+(5000*.4)
	        
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','1',;
		      					0,alias(),0,realprop.taxdistric)
	        	        
	     else
	        S1=S1+round(curr_val*.4,0)   	        
	        
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','1',;
		      					0,alias(),0,realprop.taxdistric)
	        
	     endif
	     
		  Case lower(defaults.coname) = 'baldwin'

		     S1Count=S1Count+1 
		     if curr_val>=10000
		        S1=S1+(10000*.4)	        
		     else
		        S1=S1+round(curr_val*.4,0)   	        
		     endif
		     
		     
		EndCase

  endif && homeexempt = 's1'
  
  if homeexempt='S2'
  
     L2COUNT=L2COUNT+1
     S2Count=S2Count+1
     if curr_val >= 10000
        S2=S2+(10000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','2',;
	      					4000,alias(),0,realprop.taxdistric)
        	        
     else
        S2=S2+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','2',;
	      					round(curr_val*.4,0),alias(),0,realprop.taxdistric)
           	        
     endif
     
  endif
  
  If homeexempt = 'SC'
  
  	sccount = sccount + 1

    if curr_val >= 5000
       Scc = Scc+(5000*.4)
      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','C',;
      					2000,alias(),0,realprop.taxdistric)
       
    else
       Scc = Scc+round(curr_val*.4,0)

      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','C',;
      					round(curr_val*.4,0),alias(),0,realprop.taxdistric)
        
    endif
    
    if curr_val - statehsval >= 5000
       sc65 = sc65 + (5000 * .4) 	        
    else
       Sc65 = Sc65+round((curr_val - statehsval)*.4,0) 	         	        
    endif
    
    sc65 = sc65 + round(statehsval *.4,0)
 
 EndIf 	

**left off here with baldwin
  
  if homeexempt='S3'
     L3COUNT=L3COUNT+1
     S3Count=S3Count+1
     if curr_val>=5000
        S3=S3+(5000*.4)

	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','3',;
	      					2000,alias(),0,realprop.taxdistric)
        	        
     else
        S3=S3+round(curr_val*.4,0)
        
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','3',;
	      					round(curr_val*.4,0),alias(),0,realprop.taxdistric)
           	        
     endif

     if curr_val>=25000
        S3S=S3S+(25000*.4)	        
     else
        S3S=S3S+round(curr_val*.4,0)   	        
     endif
     
  endif

  if homeexempt='S4' or (at('franklin',lower(defaults.coname)) > 0 and homeexempt = 'L4')

     S4COUNT=S4COUNT+1	
     
     If at('franklin',lower(defaults.coname)) > 0
     
	     if curr_val >= 25000
	        S4 = S4 + (25000 * .4)
	     else
	        S4 = S4 + round(curr_val * .4,0)   	        
	     endif
     
     Else      

	     if curr_val>=10000
	        S4=S4+(10000*.4)
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','4',;
		      					4000,alias(),0,realprop.taxdistric)
	        
	     else
	        S4=S4+round(curr_val*.4,0)
		      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','4',;
		      					4000,alias(),0,realprop.taxdistric)
	           	        
	     endif
	     
	    EndIf 

     if curr_val>=25000
        S4S=S4S+(25000*.4)	        
     else
        S4S=S4S+round(curr_val*.4,0)   	        
     endif


    if curr_val - statehsval >= 10000 && chged from 25000 to 10000 06/05/08
       s465 = s465 + (10000 * .4) && chged from 25000 to 10000 06/05/08	        
    else
       S465 = S465+round((curr_val - statehsval)*.4,0) 	         	        
    endif
     
     s465 = s465 + round(statehsval * .4,0)
     
  endif
  
  if homeexempt='S5'
  	 L5COUNT=L5COUNT+1 	
     S5COUNT=S5COUNT+1
     if curr_val>=125000
        S5=S5+(125000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','5',;
	      					4000,alias(),0,realprop.taxdistric)
        
     else
        S5=S5+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','5',;
	      					4000,alias(),0,realprop.taxdistric)
           
     endif
  endif

  if homeexempt='SD'
  
  	 sdCOUNT=sdCOUNT+1 	
     if curr_val>=125000
        sd=sd+(125000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','D',;
	      					4000,alias(),0,realprop.taxdistric)
        
     else
        Sd=Sd+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','D',;
	      					4000,alias(),0,realprop.taxdistric)
           
     endif

    if curr_val - statehsval >= 125000
       sd65 = sd65 + (1255000 * .4) 	        
    else
       Sd65 = Sd65+round((curr_val - statehsval)*.4,0) 	         	        
    endif

     
     sd65 = sd65 + round(statehsval * .4,0)
     
  endif


  if homeexempt='SE'
  	
     SECOUNT=SECOUNT+1
     if curr_val>=125000
        SE=SE+(125000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','E',;
	      					4000,alias(),0,realprop.taxdistric)
        
     else
        SE=SE+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','E',;
	      					4000,alias(),0,realprop.taxdistric)
           
     endif
     
    if curr_val - statehsval >= 1255000
       se65 = se65 + (1255000 * .4) 	        
    else
       Se65 = Se65+round((curr_val - statehsval)*.4,0) 	         	        
    endif
     
     SE65 = SE65 + round(statehsval * .4,0)
     
  endif
  
  If homeexempt = 'SG'
  
  	sgcount = sgcount + 1
  	
  	sg = sg + round(curr_val * .4,0)
    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','G',;
    					4000,alias(),0,realprop.taxdistric)
  	
  	
  EndIf	


  if homeexempt='S6'
  	 L6COUNT=L6COUNT+1 	
     S6COUNT=S6COUNT+1
     s6 = s6 + (round(currhomval*.4,0) - round(orighomval*.4,0))

     if curr_val>=5000
        S6s=S6s+(5000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','6',;
	      					4000,alias(),0,realprop.taxdistric)
        	        
     else
        S6s=S6s+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','6',;
	      					4000,alias(),0,realprop.taxdistric)
           	        
     endif
     
  endif

  if homeexempt='S7'
  	 L7COUNT=L7COUNT+1 	
     S7COUNT=S7COUNT+1
     s7 = s7 + (round(currhomval*.4,0) - round(orighomval*.4,0))
     
     if curr_val>=10000
        S7s=S7s+(10000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','7',;
	      					4000,alias(),0,realprop.taxdistric)
        	        
     else
        S7s=S7s+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','7',;
	      					4000,alias(),0,realprop.taxdistric)
           	        
     endif
     
  endif

  if homeexempt='S8'
  	 L8COUNT=L8COUNT+1 	
     S8COUNT=S8COUNT+1
     s8 = s8 + (round(currhomval*.4,0) - round(orighomval*.4,0))
     
     if curr_val>=25000
        S8S=S8S+(25000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','8',;
	      					4000,alias(),0,realprop.taxdistric)
        	        
     else
        S8S=S8S+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','8',;
	      					4000,alias(),0,realprop.taxdistric)
           	        
     endif
     
  endif

  if homeexempt='S9'
  	 L9COUNT=L9COUNT+1 	
     S9COUNT=S9COUNT+1
     s9 = s9 + (round(currhomval*.4,0) - round(orighomval*.4,0))
     
     if curr_val>=25000
        S9S=S9S+(25000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','9',;
	      					4000,alias(),0,realprop.taxdistric)
        	        
     else
        S9S=S9S+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','9',;
	      					4000,alias(),0,realprop.taxdistric)
           	        
     endif
     
  endif

  if homeexempt='SS'
     SSCOUNT=SSCOUNT+1
     if curr_val>=125000
        SS=SS+(125000*.4)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','S',;
	      					4000,alias(),0,realprop.taxdistric)
        
     else
        SS=SS+round(curr_val*.4,0)
	      cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','S',;
	      					4000,alias(),0,realprop.taxdistric)
           
     endif
  endif
  
  if HistVal > 0 .and. DigClass = 'H'
  	histcnt = histcnt + 1
  	histex = histex + (round((Curr_Val - HistVal)*.4,0))

    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','H',;
    					0,alias(),0,realprop.taxdistric)
  	
  endif	
  if HistVal > 0 .and. DigClass = 'T'
  	trancnt = trancnt + 1
  	tranex = tranex + (round((Curr_Val - HistVal)*.4,0))
  	
    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','T',;
    					0,alias(),0,realprop.taxdistric)
  	
  endif	

  If Ezy > '    ' and Ez_Exempt > 0
  
  	sx      = sx + round(ez_exempt * .4,0)
  	sxcount = sxcount + 1

    cons_value(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','X',;
    					0,alias(),0,realprop.taxdistric)
  	
  EndIf
	  
	
	return

*-----------------------------------------
FUNCTION tifths_mav(nload)
	
	lsb3 = .f.
	xcur = 0
	
	If realprop.sale_val
		lsb3 = .t.
		xcur = realprop.saleland1 + realprop.saleland2 + realprop.saleimp1 + realprop.saleimp2
	Else
		xcur = realprop.mavcurr	
	EndIf	


	If homeexempt = 'C1'
	
    S1Count=S1Count+1 
    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=5000
      S1=S1+(5000*.4)	        
    else
      S1=S1+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
   
    exc1cnt = exc1cnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
      exc1=exc1+10000        
    else
      exc1=exc1+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif

	EndIf

	If homeexempt = 'C2' 
	
   	S4Count=S4Count+1 
		if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=10000
    	S4=S4+(10000*.4)
	  else
    	S4=S4+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
	  endif
 
 	 if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
 	   S4S=S4S+(25000*.4)	        
	 else
	   S4S=S4S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
	 endif


	  if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 10000 && chged from 25000 to 10000 06/05/08
  	   s465 = s465 + (10000 * .4) && chged from 25000 to 10000 06/05/08	        
    else
      S465 = S465+round((xcur - statehsval)*.4,0) 	         	        
 	  endif
   
 	  s465 = s465 + round(statehsval * .4,0)
     
   	exc2cnt = exc2cnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=62500
      exc2=exc2+25000        
    else
      exc2=exc2+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && c2

	If homeexempt = 'C3'
	
    S3Count=S3Count+1
    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=5000
      S3=S3+(5000*.4)	        
    else
      S3=S3+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
      S3S=S3S+(25000*.4)	        
    else
      S3S=S3S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
   
    exc3cnt = exc3cnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=62500
      exc3=exc3+25000        
    else
      exc3=exc3+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif

	EndIf && c3

	If homeexempt = 'C4' 
	
   	S4Count=S4Count+1 
		if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=10000
    	S4=S4+(10000*.4)
	  else
    	S4=S4+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
	  endif
 
 	 if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
 	   S4S=S4S+(25000*.4)	        
	 else
	   S4S=S4S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
	 endif


	  if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 10000 && chged from 25000 to 10000 06/05/08
  	   s465 = s465 + (10000 * .4) && chged from 25000 to 10000 06/05/08	        
    else
      S465 = S465+round((xcur - statehsval)*.4,0) 	         	        
 	  endif
   
 	  s465 = s465 + round(statehsval * .4,0)
     
   	exc4cnt = exc4cnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=62500
      exc4=exc4+25000        
    else
      exc4=exc4+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && c4
	
	If homeexempt = 'C9' 
	
    S9COUNT=S9COUNT+1
    s9 = s9 + (round(currhomval*.4,0) - round(orighomval*.4,0))
     
    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
      S9S=S9S+(25000*.4)	        
    else
      S9S=S9S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif

	  if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 10000 && chged from 25000 to 10000 06/05/08
  	   s465 = s465 + (10000 * .4) && chged from 25000 to 10000 06/05/08	        
    else
      S465 = S465+round((xcur - statehsval)*.4,0) 	         	        
 	  endif
   
 	  s465 = s465 + round(statehsval * .4,0)
     
   	exc9cnt = exc9cnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=62500
      exc9=exc9+25000        
    else
      exc9=ex92+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && c9

	If homeexempt = 'CC' 
	
  	sccount = sccount + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) >= 5000
       Scc = Scc+(5000*.4)
    else
       Scc = Scc+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0)) 
    endif
    
    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 5000
       sc65 = sc65 + (5000 * .4) 	        
    else
       Sc65 = Sc65+round((xcur - statehsval)*.4,0) 	         	        
    endif
    
    sc65 = sc65 + round(statehsval *.4,0)
     
   	excccnt = excccnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
      excc=excc+10000        
    else
      excc=excc+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && cc
	
	If homeexempt = 'CL' or homeexempt = 'CM'
	
  	s1count = s1count + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) >= 5000
       S1 = S1+(5000*.4)
    else
       S1 = S1+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0)) 
    endif
    
   	exclcnt = exclcnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=62500
      exclx=exclx+25000       
    else
      exclx=exclx+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && cl or cm

	If homeexempt = 'CS' 
	
  	sccount = sccount + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) >= 5000
       Scc = Scc+(5000*.4)
    else
       Scc = Scc+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0)) 
    endif
    
    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 5000
       sc65 = sc65 + (5000 * .4) 	        
    else
       Sc65 = Sc65+round((xcur - statehsval)*.4,0) 	         	        
    endif
    
    sc65 = sc65 + round(statehsval *.4,0)
     
   	excscnt = excscnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=62500
      excs=excs+25000        
    else
      excs=excs+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && cs

	If homeexempt = 'M1' 
	
   	exm1cnt = exm1cnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
      exm1=exm1+10000        
    else
      exm1=exm1+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && m1
	
	If homeexempt = 'M2' 
	
   	exm2cnt = exm2cnt + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=62500
      exm2=exm2+25000        
    else
      exm2=exm2+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
    endif
	     
	
	EndIf && m2
	

	If digclass = 'B'
	
		sb = sb + round(xcur * .4,0) - round(histval * .4,0)
		sbcount = sbcount + 1
		
	EndIf	

	If HomeExempt = 'S7'
		L9 = L9 + round(CurrHomVal*.4,0)
		L9Count = L9Count + 1
	EndIf	    

	If HomeExempt = 'S6'
		L8 = L8 + round(OrigHomVal*.4,0)
		L8Count = L8Count + 1
	EndIf	    

	If HomeExempt = 'S8'
		L9 = L9 + round(CurrHomVal*.4,0)
		L9Count = L9Count + 1
		L8 = L8 + round(OrigHomVal*.4,0)
		L8Count = L8Count + 1
	EndIf	    

  if homeexempt='S1' 
  
  	Do Case
  	
  		Case lower(defaults.coname) <> 'baldwin'
  
*	     L1COUNT=L1COUNT+1
	     S1Count=S1Count+1 
	     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=5000
	        S1=S1+(5000*.4)	        
	     else
	        S1=S1+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
	     endif
	     
		  Case lower(defaults.coname) = 'baldwin'

		     S1Count=S1Count+1 
		     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=10000
		        S1=S1+(10000*.4)	        
		     else
		        S1=S1+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
		     endif
		     
		     
		EndCase

  endif && homeexempt = 's1'
  
  if homeexempt='S2'
  
     L2COUNT=L2COUNT+1
     S2Count=S2Count+1
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) >= 10000
        S2=S2+(10000*.4)	        
     else
        S2=S2+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif
     
  endif
  
  If homeexempt = 'SC'
  
  	sccount = sccount + 1

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) >= 5000
       Scc = Scc+(5000*.4)
    else
       Scc = Scc+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0)) 
    endif
    
    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 5000
       sc65 = sc65 + (5000 * .4) 	        
    else
       Sc65 = Sc65+round((xcur - statehsval)*.4,0) 	         	        
    endif
    
    sc65 = sc65 + round(statehsval *.4,0)
 
 EndIf 	

  
  if homeexempt='S3'
     L3COUNT=L3COUNT+1
     S3Count=S3Count+1
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=5000
        S3=S3+(5000*.4)	        
     else
        S3=S3+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif

     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
        S3S=S3S+(25000*.4)	        
     else
        S3S=S3S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif
     
  endif

  if homeexempt='S4' or (at('franklin',lower(defaults.coname)) > 0 and homeexempt = 'L4')

     S4COUNT=S4COUNT+1	
     
     If at('franklin',lower(defaults.coname)) > 0
     
	     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) >= 25000
	        S4 = S4 + (25000 * .4)
	     else
	        S4 = S4 + round(xcur * .4,0)   	        
	     endif
     
     Else      

	     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=10000
	        S4=S4+(10000*.4)
	     else
	        S4=S4+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
	     endif
	     
	    EndIf 

     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
        S4S=S4S+(25000*.4)	        
     else
        S4S=S4S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif


    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 10000 && chged from 25000 to 10000 06/05/08
       s465 = s465 + (10000 * .4) && chged from 25000 to 10000 06/05/08	        
    else
       S465 = S465+round((xcur - statehsval)*.4,0) 	         	        
    endif
     
     s465 = s465 + round(statehsval * .4,0)
     
  endif
  
  if homeexempt='S5'
  	 L5COUNT=L5COUNT+1 	
     S5COUNT=S5COUNT+1
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=125000
        S5=S5+(125000*.4)
     else
        S5=S5+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   
     endif
  endif

  if homeexempt='SD'
  
  	 sdCOUNT=sdCOUNT+1 	
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=125000
        sd=sd+(125000*.4)
     else
        Sd=Sd+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   
     endif

    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 125000
       sd65 = sd65 + (1255000 * .4) 	        
    else
       Sd65 = Sd65+round((xcur - statehsval)*.4,0) 	         	        
    endif

     
     sd65 = sd65 + round(statehsval * .4,0)
     
  endif


  if homeexempt='SE'
  	
     SECOUNT=SECOUNT+1
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=125000
        SE=SE+(125000*.4)
     else
        SE=SE+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   
     endif
     
    if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr) - statehsval >= 1255000
       se65 = se65 + (1255000 * .4) 	        
    else
       Se65 = Se65+round((xcur - statehsval)*.4,0) 	         	        
    endif
     
     SE65 = SE65 + round(statehsval * .4,0)
     
  endif
  
  If homeexempt = 'SG'
  
  	sgcount = sgcount + 1
  	
  	sg = sg + round(xcur * .4,0)
  	
  EndIf	


  if homeexempt='S6'
  	 L6COUNT=L6COUNT+1 	
     S6COUNT=S6COUNT+1
     s6 = s6 + (round(currhomval*.4,0) - round(orighomval*.4,0))

     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=5000
        S6s=S6s+(5000*.4)	        
     else
        S6s=S6s+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif
     
  endif

  if homeexempt='S7'
  	 L7COUNT=L7COUNT+1 	
     S7COUNT=S7COUNT+1
     s7 = s7 + (round(currhomval*.4,0) - round(orighomval*.4,0))
     
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=10000
        S7s=S7s+(10000*.4)	        
     else
        S7s=S7s+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif
     
  endif

  if homeexempt='S8'
  	 L8COUNT=L8COUNT+1 	
     S8COUNT=S8COUNT+1
     s8 = s8 + (round(currhomval*.4,0) - round(orighomval*.4,0))
     
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
        S8S=S8S+(25000*.4)	        
     else
        S8S=S8S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif
     
  endif

  if homeexempt='S9'
  	 L9COUNT=L9COUNT+1 	
     S9COUNT=S9COUNT+1
     s9 = s9 + (round(currhomval*.4,0) - round(orighomval*.4,0))
     
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=25000
        S9S=S9S+(25000*.4)	        
     else
        S9S=S9S+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   	        
     endif
     
  endif

  if homeexempt='SS'
     SSCOUNT=SSCOUNT+1
     if iif(lsb3,saleland1 + saleland2+saleimp1+saleimp2,mavcurr)>=125000
        SS=SS+(125000*.4)
     else
        SS=SS+iif(lsb3,round((saleland1 + saleland2+saleimp1+saleimp2)*.4,0),round(mavcurr*.4,0))   
     endif
  endif
  
  if HistVal > 0 .and. DigClass = 'H'
  	histcnt = histcnt + 1
  	histex = histex + (round((xcur - HistVal)*.4,0))
  	
    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','H',;
    					(round((xcur - HistVal)*.4,0)),alias(),0,realprop.taxdistric)
  	
  endif	
  if HistVal > 0 .and. DigClass = 'T'
  	trancnt = trancnt + 1
  	tranex = tranex + (round((xcur - HistVal)*.4,0))
    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','T',;
    					(round((xcur - HistVal)*.4,0)),alias(),0,realprop.taxdistric)
  	
  endif
  
  If Ezy > '    ' and Ez_Exempt > 0
  
  	sx      = sx + round(ez_exempt * .4,0)
  	sxcount = sxcount + 1

    cons_value_mav(realprop.realkey,realprop.parcel_no,0,0,0,0,'S','X',;
    					round(ez_exempt * .4,0),alias(),0,realprop.taxdistric)
  	
  EndIf

*-------------------------------------------------------
FUNCTION Exemptions

	clear

	@10,20 say 'Creating Exemptions from CalcExemptions..'
	
	If file('cons_exempt1.dbf')

		erase cons_exempt1.dbf
		
	EndIf

	create table temp(taxtype n(3),;
										ttdescrip c(30),;
										excode c(5),;
										descrip c(30),;									
										cov_hs c(1),;
										excount n(6),;	
										examount n(10))
										
	use temp
	copy to cons_exempt1 fox2x

	close database
	
	create table temp(perskey n(10),;
										realkey n(10),;
										taxdistric c(2),;
										taxtype n(3),;										
										ttdescrip c(30),;
										excode c(5),;
										descrip c(30),;									
										cov_hs c(1),;
										excount n(6),;	
										examount n(10))
										
	use temp
	copy to cons_exempt_detail fox2x

	sele a
	use calcexemptions alias ce

	sele b
	use cons_exempt1
	index on str(taxtype,3,0) + cov_hs + excode to xb

	sele c
	use exemptcode

	sele d
	use taxtype
	
	sele e
	use tdtemp
	
	sele f
	use realprop
	set order to realkey
	
	sele g
	use personal
	set order to perskey
	
	sele h
	use cons_exempt_detail
	
	sele 10
	use defaults

	sele ce

	Do while !eof()

		@12,20 say recno()
			
		If (act_exempt = 0 and cov_hs = 'C' and excode <> 'SH' and excode <> 'ST') or excode = 'S0'
		
			skip
			
			If !eof()
				loop
			Else
				exit
			EndIf
					
		EndIf
		
		If realkey > 0

			sele realprop
			seek ce.realkey
			
			sele tdtemp
			locate for taxdistric = realprop.taxdistric
			
			If !found()
			
				sele ce
				skip
				
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf
						
		EndIf
		
		sele ce
				
		If perskey > 0
		
			If excode = 'SP' and lower(c75) = 'n'
			
				skip
				
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf			

			sele personal
			seek ce.perskey
			
			sele tdtemp
			locate for taxdistric = personal.taxdistric
			
			If !found()
			
				sele ce
				skip
				
				If !eof()
					loop
				Else
					exit
				EndIf
				
			EndIf
						
		EndIf

		sele ce

		If cov_hs = 'C'
			ch = 'C'
		Else
			ch = ' '
		EndIf
				
		sele cons_exempt1
		seek str(ce.taxtype,3,0) + ch + ce.excode
		
		If found()
		
			If lower(chost) = 'y' and ce.taxtype = 12 and ce.excode = 'L' and ce.realkey > 0
				
				rland = 0
				rimp  = 0
				rnohs = 0
			
				If realprop.totalacres > 5
				
					rland = ;
					round(iif(realprop.ovrideval>0, realprop.ovrideval, realprop.a_value + realprop.p_value)/realprop.totalacres,0) * 5
				Else
				
					rland = iif(realprop.ovrideval>0,realprop.ovrideval,realprop.a_value + realprop.p_value)
					
				EndIf
				
				rimp = realprop.fmvres + realprop.fmvacc + realprop.fmvcom
				
				rnohs = iif(round((rland + rimp) * .4,0) > ce.maxexempt, ce.maxexempt, round((rland + rimp) * .4,0)) 			
			
				replace excount with excount + 1,;
								examount with examount + rnohs
			

				sele cons_exempt_detail
				append blank
				
				replace perskey with ce.perskey,;
								realkey with ce.realkey,;
								taxdistric with iif(ce.perskey>0,personal.taxdistric,realprop.taxdistric),;
								excode with ce.excode,;
								examount with rnohs,;
								taxtype with ce.taxtype
			
			
			Else
			
				replace excount with excount + 1,;
								examount with examount + ce.act_exempt
								
				sele cons_exempt_detail
				append blank
				
				replace perskey with ce.perskey,;
								realkey with ce.realkey,;
								taxdistric with iif(ce.perskey>0,personal.taxdistric,realprop.taxdistric),;
								excode with ce.excode,;
								examount with ce.act_exempt,;
								taxtype with ce.taxtype
								
								
			EndIf
							
		Else
			
			append blank
			
			replace taxtype with ce.taxtype,;
							excode with ce.excode,;
							excount with 1,;
							examount with examount + ce.act_exempt,;
							cov_hs with ch
							
			sele exemptcode
			locate for excode = ce.excode
			
			replace cons_exempt1.descrip with descrip	
			
			sele taxtype
			locate for taxtype = ce.taxtype
			
			replace cons_exempt1.ttdescrip with descrip			

*			If 
			sele cons_exempt_detail
			append blank
			
			replace perskey with ce.perskey,;
							realkey with ce.realkey,;
							taxdistric with iif(ce.perskey>0,personal.taxdistric,realprop.taxdistric),;
							excode with ce.excode,;
							examount with ce.act_exempt,;
							taxtype with ce.taxtype
							
		EndIf

		sele cons_exempt_detail
		append blank
		
		replace perskey with ce.perskey,;
						realkey with ce.realkey,;
						taxdistric with iif(ce.perskey>0,personal.taxdistric,realprop.taxdistric),;
						excode with ce.excode,;
						examount with ce.act_exempt,;
						taxtype with ce.taxtype
						
		If at('ware',lower(defaults.coname)) > 0 and ce.cov_hs = 'H' and excode='S' and taxtype = 3
		
			rk   = realkey
			nsex = act_exempt
			
			skip -1
			
			If excode = 'M' and taxtype = 3
				repl examount with examount - nsex
			EndIf			
			
		EndIf					
		
		sele ce
		skip										
		

	EndDo

	sele cons_exempt1
	copy to cons_exempt

	close all

	use cons_exempt

	Do while !eof()

		If cov_hs = ' '
			replace cov_hs with 'H'
		EndIf
		
		skip
			
	EndDo

	copy to cons_exempt xls

	close all
	
	use cons_exempt_detail
	copy to cons_exempt_detail sdf

	return  																		