compile function print_quote( QuoteIds )
declare function security_check, set_printer, get_printer, msg, fieldcount, entid, repository
declare function ex_vm_rem, obj_Install, Printer_Select
declare subroutine security_err_msg
 
$insert security_rights_equ
$insert oiprint_equates
$insert msg_equates
$insert company_equ
$insert names_equ
$insert quote_equ
$insert prod_spec_equ
$insert quote_spec_equ
$insert lsl_users_equ


EQU F_NAME$			TO 1
EQU F_POINTSIZE$	TO 2
EQU F_JUST$			TO 3
EQU F_BOLD$			TO 4
EQU F_ITALICS$		TO 5
EQU F_UNDERLINE$	TO 6
EQU F_STRIKETHRU$	TO 7
EQU F_FORECOLOR$	TO 8
EQU F_ESCAPEMENT$	TO 9



equ MaxLayers$ to 10
equ ComLastPrint$ to 9.43

* EVentually this code could be modified to not xlate all the symbollics but rather
* open dict to @dict and use {field} ; not a high priority

Ncnt = fieldcount( QuoteIds, @fm )


 
  * New Style PDF printing (OI7.1) added 1/29/04 John C. Henry, J.C. Henry & Co.

*FileNameParms = 'Printing Quote':@FM: '' :@FM: 6 :@FM: ''
PrintSetup	= ''
PrintSetup<1,1>	= '2'	;* Preview Normal
PrintSetup<1,2> = '5'	;* Display all buttons except Printer Setup
PrintSetup<1,3>	= '0'	;* Display Printing Window
PrintSetup<1,6> = '7'	;* Preview window - keyboard and mouse support

stat = Set_Printer( 'INIT', FileNameParms, 'Quote', .5:@fm:.25:@fm:.25:@fm:.25, 0:@fm:1 , PrintSetup)



*Stat = set_printer( 'INIT', '', '', .5:@fm:.25:@fm:.25:@fm:.25, 0:@fm:1,PrintPreview)

Font = ''
Stat = set_printer( 'FONT', Font )
for i = 1 to Ncnt
   ThisQuote = QuoteIds<i>
   QuoteRec = xlate( 'QUOTE', ThisQuote, '', 'X' )
   PSNId = QuoteRec<quote_prod_spec_id$>
   PSNRec = xlate( 'PROD_SPEC', PSNId, '', 'X' )
	PrevPSNs = QuoteRec<quote_prev_prod_spec_ids$>
	AllPSNs = PrevPSNs:@vm:PSNId
	
   * Set all printvariables
   
   CustID         = QuoteRec<quote_cust_no$>
   CustRec        = xlate( 'COMPANY', CustID, '', 'X' )
   CSZ            = xlate( 'COMPANY', CustID, 'CSZ', 'X' )
   CustAddress    = CustRec<company_address$>
   CustAddress    = ex_vm_rem( CustAddress )
   Buyer          = oconv( CustID, '[XLATE_CONV,COMPANY*CO_NAME]' )
   Seller         = 'Silicon Division'
   AcctRep        = xlate( 'QUOTE', ThisQuote, 'ACCT_REP', 'X' )
   AcctRepRec     = xlate( 'LSL_USERS', AcctRep, '', 'X' )
   AcctRepDID     = oconv( AcctRepRec<lsl_users_did$>, '[PHONE_FORMAT]' )
   AcctRepEmail   = AcctRepRec<lsl_users_email$>
   AcctRepFax     = oconv( AcctRepRec<lsl_users_fax$>, '[PHONE_FORMAT]' )
   AcctRep        = oconv( xlate( 'QUOTE', ThisQuote, 'ACCT_REP', 'X' ), '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )   
   FaxNumber      = oconv( QuoteRec<quote_fax$>, '[PHONE_FORMAT]' )
   if FaxNumber = '' then
      FaxNumber = QuoteRec<quote_ifax$>
   end
   QuoteDetail = QuoteRec<quote_detail$>
   PPW         = oconv( QuoteRec<quote_price$>, 'MD2,$' )
   Quantity    = QuoteRec<quote_quantity$>
   Amount      = oconv( xlate( 'QUOTE', ThisQuote, 'AMOUNT', 'X' ), 'MD2,$' )
   NameNo  = QuoteRec<quote_name_no$>
   Contact = xlate( 'NAMES', NameNo, 'FIRST_LAST', 'X' )
   NameRec = xlate( 'NAMES', NameNo, '', 'X' )
   PTypes  = NameRec<names_phone_types$>
   IPTypes = NameRec<names_intl_phone_types$>   
   Phones  = NameRec<names_phone$>
   IPhones = NameRec<names_intl_phone$>
   ContactEmail = NameRec<names_email$>
   convert @lower_case to @upper_case in PTypes
   convert @lower_case to @upper_case in IPTypes
   PhoneToUse = ''
   locate 'OFFICE' in PTypes using @vm setting TPos then
      PhoneToUse = oconv( Phones<1,TPos>, '[PHONE_FORMAT]' ) 
   end else
   
      * Basically delete all FAX numbers and then use the top one   
      
      Pcnt = fieldcount( Phones, @vm )
      for Pp = Pcnt to 1 step -1
         if PTypes<1,Pp> = 'FAX' then
            Phones = delete( Phones, 1, Pp, 0 )
         end 
      next Pp
      PhoneToUse = oconv( Phones<1,1>, '[PHONE_FORMAT]' ) ;* SIMPLY TAKE THE FIRST ONE
   end
   if PhoneToUse = '' then
      locate 'OFFICE' in IPhones using @vm setting TPos then
         PhoneToUse = IPhones<1,TPos>
      end else
         * Basically delete all fax numbers and then use the top one
         Pcnt = fieldcount( IPhones, @vm )      
	      for Pp = Pcnt to 1 step -1
	         if IPTypes<1,Pp> = 'FAX' then
	            IPhones = delete( IPhones, 1, Pp, 0 )
	         end 
	      next Pp
         PhoneToUse = IPhones<1,1>
      end
   end
   RFQ        = QuoteRec<quote_req_quote_num$>
   EntryDate  = oconv( QuoteRec<quote_entry_date$>, 'D2/' )
   Spec       = PSNRec<prod_spec_spec_num$><1,1>
   Terms      = QuoteRec<quote_terms$>
   FOBPoint   = QuoteRec<quote_other_fob_point$>
   if FOBPoint = '' then
      FOBPoint = 'Mesa, Arizona U.S.A.'
   end
   Comments   = QuoteRec<quote_comments$>
   Convert @tm to @fm in Comments
   

   SpecSub     = PSNRec<prod_spec_spec_substrate$>
   SubOrient   = SpecSub<1,QSSubOrientation$>
   SubDiam     = SpecSub<1,QSSubWafersize$>
   SubDopant   = SpecSub<1,QSSubDopant$>
   SubRest     = SpecSub<1,QSSubResistivity$>
   SubBL1      = SpecSub<1,QSSubBl1Dopant$>
   SubBl2      = SpecSub<1,QSSubBl2Dopant$>
   SubBl3      = SpecSub<1,QSSubBl3Dopant$>
   SubPolish   = SpecSub<1,QSSubPolish$>
   SubResUnits = SpecSub<1,QSSubResUnits$>
   if SubBL1 = '' then
      SubBL1 = 'None'
   end
   if SubBL2 = '' then
      SubBL2 = 'None'
   end
   if SubBL3 = '' then
      SubBL3 = 'None'
   end

	* Print the Company Logo and Information
	
	location = 0.06:@fm:0.0:@fm:1.57:@fm:1
	BitMapPath = obj_Install('Get_Prop','ColorBMP')
	
	stat = Set_Printer('BMP',BitMapPath,location, 0,1)  
   
   Font<F_NAME$> = 'Arial'
   Font<F_POINTSIZE$> = 17
   Font<F_BOLD$> = 1
   Void = set_printer( 'FONT', Font )
   
   *   
                            
   TableColInfo = '~^+10800'
   TableInfo = ''
   TableInfo:= 'Quotation'
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   
   Void = set_printer( 'TEXT', '' )
   Void = set_printer( 'TEXT', '' )
   
   Font<F_POINTSIZE$> = 6
   Void = set_printer( 'FONT', Font )
   Void = set_printer( 'TEXT', '' )
   
   Font<F_POINTSIZE$> = 11
   Font<F_BOLD$> = 1
   Void = set_printer( 'FONT', Font )
   TableColInfo = '~>+10800'
      
   TableInfo = oconv( ThisQuote<quote_entry_date$>, 'D2/' )
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )

   Void = set_printer( 'TEXT', '' )

   * BUYER AND SELLER INFORMATION
      
   Void = set_printer( 'LINESTYLE', PS_SOLID:@fm:1 )
   Void = set_printer( 'LINE',0:@fm:1.0:@fm:7.56:@fm:1.0, 0 )
   
   Font<F_NAME$> = 'Arial'
   Font<F_POINTSIZE$> = 14
   Font<F_BOLD$> = 1   
   Void = set_printer( 'FONT', Font )
   TableColInfo = '^~5400':@vm:'^~5400'
   TableInfo = 'Seller':@vm:'Buyer'
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   Void = set_printer( 'FONT', '' )
   *Void = set_printer( 'TEXT', '' )
   Font<F_POINTSIZE$> = 11
   Font<F_BOLD$> = 0   
   Void = set_printer( 'FONT', Font )
   
   CompName = obj_Install('Get_Prop','Company')
   Division = obj_Install('Get_Prop','Division')
   
   TableInfo = CompName:@vm:'':@fm
   
   IF Division NE '' THEN
		TableInfo:= Division:@vm:'':@fm
   END
   		
   TableInfo:= obj_Install('Get_Prop','Address'):@vm:Buyer:@fm
   TableInfo:= obj_Install('Get_Prop','CSZ'):@vm:Contact:@fm
   TableInfo:= 'Phone:':obj_Install('Get_Prop','Phone'):@vm:CustAddress<1,1>:@fm
   TableInfo:= 'Fax:':obj_Install('Get_Prop','FAX'):@vm:CustAddress<1,2>:@fm
   TableInfo:= obj_Install('Get_Prop','EMail'):@vm:CustAddress<1,3>:@fm
   TableInfo:= '':@vm:CSZ:@fm
   TableInfo:= 'ACCT Rep: ':AcctRep:@vm:'Phone#: ':PhoneToUse:@fm
   TableInfo:= 'E-Mail: ':AcctRepEmail:@vm:'Fax#: ':FaxNumber:@fm
   TableInfo:= 'Phone: ':AcctRepDID:@vm:'E-Mail: ':ContactEmail:@fm
   TableInfo:= 'Fax: ':AcctRepFax:@vm:'Fob Point: ':FOBPoint:@fm
   TableInfo:= '':@vm:'':@vm:''
   TableColInfo = '<~5400':@vm:'<~5400'
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   CurPos = get_printer( 'POS' )
   
   CurYPos = CurPos<2>-.03
   Void = set_printer( 'LINE', 3.5:@fm:1.0:@fm:3.5:@fm:CurYPos, 0 )   
   Void = set_printer( 'LINE', 0:@fm:CurYPos:@fm:7.5:@fm:CurYPos, 0 )

   
   * GENERAL INFORMATION AREA
   Font<F_POINTSIZE$> = 12
   Font<F_BOLD$> = 1
   Font<F_ITALICS$> = 1 ;* ITALIC
   Void = set_printer( 'FONT', Font )
   TableColInfo = '~^+10800'
   TableInfo = ''
   TableInfo:= 'General Information'
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   Void = set_printer( 'TEXT', '' )   
   Font<F_POINTSIZE$> = 11
   Font<F_BOLD$> = 0
   Font<F_ITALICS$> = 0
   Void = set_printer( 'FONT', Font )
   PartNumbers = xlate( 'PROD_SPEC', PSNId, prod_spec_part_nums$, 'X' )
   if index( PartNumbers, @vm, 1 ) then
      * MULTIPLE PART NUMBERS SO JUST PRINT SEE SPEC
      PartNumbers = 'See Spec'
   end   
   TableColInfo = '~<+3600':@vm:'~<+3600':@vm:'~<+3600'
   TableInfo = ''
   TableInfo:= 'Customer#: ':CustId:@vm:'Quote#: ':ThisQuote:@vm:'PSN#: ':PSNId:@fm
   TableInfo:= 'Customer RFQ: ':RFQ:@vm:'Spec#: ':Spec:@vm:'Part#: ':PartNumbers:@fm
   TableInfo:= 'Payment Terms: ':Terms:@vm:@vm:@fm
   TableInfo:= '':@vm:'':@vm:''
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   CurPos = get_printer( 'POS' )
   CurYPos = CurPos<2>-.03
   Void = set_printer( 'LINE', 0:@fm:CurYPos:@fm:7.5:@fm:CurYPos, 0 )
      
   Font<F_POINTSIZE$> = 12 
   Font<F_ITALICS$> = 1
   Font<F_BOLD$> = 1
   Void = set_printer( 'FONT', Font )                          
   TableColInfo = '~^+10800'
   TableInfo = ''
   TableInfo:= 'Substrate Specifications'
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   Void = set_printer( 'TEXT', '' )
   Font<F_POINTSIZE$> = 11
   Font<F_BOLD$> = 0
   Font<F_ITALICS$> = 0
   Void = set_printer( 'FONT', Font )
   
   TableColInfo = '~<+3600':@vm:'~<+3600':@vm:'~<+3600'
   TableInfo = ''
   TableInfo = 'Diameter: ':SubDiam:@vm:'Dopant: ':SubDopant:@vm:'Polish: ':SubPolish
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
  	Font<F_NAME$> = 'MS LineDraw'
	*Font<F_NAME$> = 'Arial'  
   Void = set_printer( 'FONT', Font )
   CurPos = get_printer( 'POS' )
   CurYPos = CurPos<2>
   Void = set_printer( 'TEXTXY',SubRest:SubResUnits, 3.29:@fm:CurYPos, '', 0 )   
   Font<F_NAME$> = 'Arial'
   Void = set_printer( 'FONT', Font )
   TableInfo = 'Orientation: ':SubOrient:@vm:'Resistivity: ':@vm:''
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   TableInfo = 'BL#1: ':SubBL1:@vm:'BL#2: ':SubBL2:@vm:'BL#3: ':SubBL3:@fm:'':@vm:'':@vm:''
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )      
   CurPos = get_printer( 'POS' )
   CurYPos = CurPos<2>-.03
   Void = set_printer( 'LINE', 0:@fm:CurYPos:@fm:7.5:@fm:CurYPos, 0 )                                 
      
   * HAVE TO DO A TEXT XY FOR THE SUBSTRATE RESISTIVITY CAUSE OF THE FONT
   * DID NOT WANT TO USE LINEDRAW FOR EVERYTHING
   * THIS WILL WORK CAUSE ALL PRINTING ABOVE SPECIFIES NO WRAPPING SO I AM
   * GUARANTEED THIS XY POS <IHOPE><BIGGRIN>
 
   
   * EPITAXIAL SPECIFICATION LABELS
   Font<F_NAME$> = 'Arial'
   Font<F_POINTSIZE$> = 12
   Font<F_BOLD$> = 1
   Font<F_ITALICS$> = 1 ;* ITALIC
   Font<6> = 0
   Void = set_printer( 'FONT', Font )
   TableColInfo = '~^+10800'
   TableInfo = ''
   TableInfo:= 'Epitaxial Specifications':@fm:'':@fm
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   TableInfo = ''
   TableInfo = 'Layer'
   TableInfo:= '~Thickness~Measured By~Resistivity~Measured By~Dopant'
   convert '~' to @vm in TableInfo
   TableColInfo = '^~806':@vm:'^~2247':@vm:'^~1836':@vm:'^~2247':@vm:'^~1836':@vm:'^~1828'
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_ALL )
   TableInfo = ''                          

   * EPITAXIAL SPECIFICATION DATA
   Font<F_NAME$> = 'MS LineDraw'
   Font<F_ITALICS$> = 0
   Font<F_POINTSIZE$> = 9
   Font<F_BOLD$> = 0
   Void = set_printer( 'FONT', Font )
   AllPSNs = ex_vm_rem( AllPSNs )
	APCnt = fieldcount( AllPSNs, @vm )
	CurLay = 0
	*
	if APCnt > MaxLayers$ then
	   Void = set_printer( 'TERM' )
  		MsgInfo = ''
  		MsgInfo<mtext$> = 'There are more than ':MaxLayers$:'.  Please notify the MIS Department.'
  		MsgInfo<micon$> = '!'
  		Void = msg( '', MsgInfo )
  		return 0 
	end
	TTableInfo = ''
	TotLayCnt = 0 
	for Lay = 1 to APCnt
		ThisPSN = AllPSNs<1,Lay>
		PSNLayRec = xlate( 'PROD_SPEC', ThisPSN, '', 'X' )
		SpecEpiLay = PSNLayRec<prod_spec_spec_epi$>
		convert char(247) to @fm in SpecEpiLay ;* SEP LAY NOT USED ANYMORE
		convert char(248) to @fm in SpecEpiLay 
		SLayCnt = fieldcount( SpecEpiLay, @fm )
		for SLay = 1 to SLayCnt
		   CurLay += 1
		   TotLayCnt += 1
	   	if SLay > 3 then
	   		* WE HAVE MORE THAN A 3RD LAYER DEFINED AS A SAME REACTOR LAYER
	   		* AND WE ONLY HAVE UP TO L3 FOR THE BELOW FIELDS SO GIVE AN ERR
	   		* MESSAGE CAUSE WE COULD ALWAYS CREATE 4-XXX 
	   		* BUT THEY SAID THEY WILL NEVER GO OVER THREE LAYERS - ( UNTIL I CODE IT THAT WAY
	   		* BIG WIDE CHEEKY GRIN
	   		Void = set_printer( 'TERM' )
	   		MsgInfo = ''
	   		MsgInfo<mtext$> = 'PSN# ':ThisPSN:' has more than three layers in the same reactor...Please notify the MIS Department.'
	   		MsgInfo<micon$> = '!'
	   		Void = msg( '', MsgInfo )
	   		return 0 
	   	end
	   	TMin  = 'THICK_MIN_L':SLay
	   	TMax  = 'THICK_MAX_L':SLay
			TTarg = 'THICK_TARGET_L':SLay
			TMeas = 'THICK_MEASURE_L':SLay
			TUnit = 'THICK_UNITS_L':SLay
			RMin  = 'RES_MIN_L':SLay
			RMax  = 'RES_MAX_L':SLay
			RTarg = 'RES_TARGET_L':SLay
			RMeas = 'RES_MEASURE_L':SLay
			RUnit = 'RES_UNITS_L':SLay
			CMin  = 'CON_MIN_L':SLay
			CMax  = 'CON_MAX_L':SLay
			CTarg = 'CON_TARGET_L':SLay
			CMeas = 'CON_MEASURE_L':SLay
			CUnit = 'CON_UNITS_L':SLay
			Dop   = 'DOPANT_L':SLay
		   
		   TMinData  = oconv( xlate( 'PROD_SPEC', ThisPSN, TMin, 'X' ), 'MD2' )
		   TMaxData  = oconv( xlate( 'PROD_SPEC', ThisPSN, TMax, 'X' ), 'MD2' )
			TTargData = oconv( xlate( 'PROD_SPEC', ThisPSN, TTArg, 'X' ), 'MD2' )
			TMeasData = field( xlate( 'PROD_SPEC', ThisPSN, TMeas, 'X' ), '~', 1 )
			TUnitData = xlate( 'PROD_SPEC', ThisPSN, TUnit, 'X' )
			
			RTargData = oconv( xlate( 'PROD_SPEC', ThisPSN, RTarg, 'X' ), 'MD3' )
			RMinData  = oconv( xlate( 'PROD_SPEC', ThisPSN, RMin, 'X' ), 'MD3' )
			RMaxData  = oconv( xlate( 'PROD_SPEC', ThisPSN, RMax, 'X' ), 'MD3' )
			RMeasData = field( xlate( 'PROD_SPEC', ThisPSN, RMeas, 'X' ), '~', 1 )
			RUnitData = xlate( 'PROD_SPEC', ThisPSN, RUnit, 'X' ) 
			
			CMinData  = oconv( xlate( 'PROD_SPEC', ThisPSN, CMin, 'X' ), 'MS21' )
			CMaxData  = oconv( xlate( 'PROD_SPEC', ThisPSN, CMax, 'X' ), 'MS21' )
			CTargData = oconv( xlate( 'PROD_SPEC', ThisPSN, CTarg, 'X' ), 'MS21' )
			CMeasData = field( xlate( 'PROD_SPEC', ThisPSN, CMeas, 'X' ), '~', 1 )			
			CUnitData = xlate( 'PROD_SPEC', ThisPSN, CUnit, 'X' ) 			
			
			
			DopData   = xlate( 'PROD_SPEC', ThisPSN, Dop, 'X' )
			* THE NEXT 2 IF STMTS WILL TRIM OFF THE GAS FLOW DETAIL
			* I.E. 1000 PPM, 1%,
			if index( DopData, 'Boron', 1 ) then
			   if index( DopData, 'Germanium', 1 ) then
			      * LEAVE ALONE IT IS BORON/GERMANIUM
			   end else
			      * TRIM OFF THE %
			      DopData = 'Boron'
			   end
			end
			if index( DopData, 'Arsenic', 1 ) then
			   DopData = 'Arsenic'
			end
  		   TTableInfo = TotLayCnt:@vm:TMinData:'-':TMaxData:TUnitData:@vm:TMeasData:@vm
			if RTargData then
			   TTableInfo:= RMinData:'-':RMaxData:RUnitData:@vm
			end else
			   TTableInfo:= CMinData:'-':CMaxData:CUnitData:@vm
			end
			* WE COULD HAVE IT SPECD BY CONCENTRATION
			* AND HAVE THE MEASURE BY SRP UNDER RESISTIVITY
			* IN OTHER WORDS WE SPEC BY CONCENTRATION BUT WE
			* SRP FOR RESISTIVITY
         if RMeasData <> '' then
            TTableInfo:= RMeasData:@vm
         end else
            TTableInfo:= CMeasData:@vm         
         end
         TTAbleInfo:= DopData						
	      TableInfo<-1> = TTableInfo		
		next SLay
	next Lay
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_ALL )
	Void = set_printer( 'TEXT', '' )
	
	QDCnt = fieldcount( QuoteDetail, @vm )
	Font<F_NAME$> = 'Arial'
   Font<F_POINTSIZE$> = 12 
   Font<F_ITALICS$> = 1
   Font<F_BOLD$> = 1
   Void = set_printer( 'FONT', Font )
   TableColInfo = '~^+10800'
   TableInfo = ''
   TableInfo:= 'Pricing Information':@fm:'':@fm
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_NONE )
   
   TableInfo = 'Line':@vm:'Detail Description':@vm:'Per Unit':@vm:'Qty':@vm:'Total'
   TableColInfo = '^~806':@vm:'<~6294':@vm:'>~1080':@vm:'>~907':@vm:'>~1714'
   Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_COLUMNS_TOP_BOTTOM )
   Font<F_POINTSIZE$> = 11 
   Font<F_ITALICS$> = 0
   Font<F_BOLD$> = 0
   Void = set_printer( 'FONT', Font )
   TableColInfo = '^~806':@vm:'<~6294':@vm:'>~1080':@vm:'>~907':@vm:'>~1714'
	for Li = 1 to QDCnt
   	TableInfo = Li:@vm:QuoteDetail<1,Li>:@vm:PPW<1,Li>:@vm:Quantity<1,Li>:@vm:Amount<1,Li>
   	Void = set_printer( 'ADDTABLE', TableColInfo, '', TableInfo, '', '', 0, TB_COLUMNS_TOP_BOTTOM )
	next Li
	
   * COMMENTS
   Void = set_printer( 'TEXT', '' )
   Font<F_POINTSIZE$> = 12
   Font<F_BOLD$> = 1
   Font<F_ITALICS$> = 1
   Void = set_printer( 'FONT', Font )
   Void = set_printer( 'TEXT', 'COMMENTS:' )
   Font<F_POINTSIZE$> = 10
   Font<F_BOLD$> = 0
   Font<F_ITALICS$> = 0
   Void = set_printer( 'FONT', Font )
   TableColInfo = '<-10080'
   if ( TotLayCnt > 1 ) then
      Comments = 'Layer one is closest to the substrate.':@fm:Comments
   end
   CLCnt = fieldcount( Comments, @fm )
   for CL = 1 to CLCnt
	   CurPos = get_printer( 'POS' )<2>
	   if CurPos < ComLastPrint$ then ;* OTHERWISE WILL HAVE TO TRUNCATE	   
      	Void = set_printer( 'ADDTABLE', TableColInfo, '', Comments<CL>, '', '', 0, TB_NONE )
      end
   next CL
	
	* BUYERS ACCEPTANCE:

	Font<F_POINTSIZE$> = 12
	Font<F_BOLD$> = 1
	Font<F_ITALICS$> = 1
	Void = set_printer( 'FONT', Font )
	Void = set_printer( 'TEXTXY', 'Buyers Acceptance:', 0:@fm:9.54, '', 0 )
	Font<F_POINTSIZE$> = 10
	Font<F_BOLD$> = 0
	Font<F_ITALICS$> = 0
	Void = set_printer( 'FONT', Font )
	Void = set_printer( 'TEXTXY', 'Signature', 0:@fm:9.87, '', 0 )
	Void = set_printer( 'TEXTXY', 'Print Name', 2.75:@fm:9.87, '', 0 )
	Void = set_printer( 'TEXTXY', 'Date', 5.5:@fm:9.87, '', 0 )
   Void = set_printer( 'LINE', .56:@fm:9.99:@fm:2.73:@fm:9.99, 0 )
   Void = set_printer( 'LINE', 3.41:@fm:9.99:@fm:5.47:@fm:9.99, 0 )
   Void = set_printer( 'LINE', 5.75:@fm:9.99:@fm:7.44:@fm:9.99, 0 )
   Tout = 'Prices Quoted are valid for Sixty (60) days.  Prices subject to change without notice.'
  	Void = set_printer( 'TEXTXY', Tout, 0:@fm:10.06, '', 0 )
next i   
* termination
stat = set_printer( 'TERM' )       
RETURN 0
*===========================================================================*

