PROCEDURE pbarcode

PARAMETERS pcbill_no

PUSH KEY 
IF ALIAS() <> 'JOB_MAST'
	DO ERR_MSG WITH 'BARCODE PRINTING IS ONLY POSSIBLE FOR COUNTER SALES BILL'
	POP KEY 
	RETURN .F.
ENDIF 
PRIVATE lcjobcard_no
lcjobcard_no = job_mast.jobcard_no
IF SEEK(lcjobcard_no,'JOB_BODY','JOBCARD_NO')
	SELECT JOB_BODY
	SET ORDER TO JOBCARD_NO IN JOB_BODY
*!*		SET TALK OFF
*!*		SET TEXTMERGE ON NOSHOW      && Enable text merge, no output to screen
*!*		SET TEXTMERGE DELIMITERS TO   
*!*		PRIVATE lnFileHandel
*!*		lnFileHandel = FCREATE('barcode.prn')
*!*		IF lnFileHandel = -1 
*!*			DO err_msg WITH 'UNABLE TO CREATE BARCODE'
*!*			POP KEY
*!*			RETURN .F.
*!*		ENDIF 
	SET PRINTER TO barcode.prn
	set devi to prin
	SET PRINTER on
	SET CONSOLE OFF 
*!*		STORE lnFileHandel TO _text
	SCAN REST WHILE JOBCARD_NO = lcjobcard_no 
		IF ! SEEK(job_body.item_no,'ITEMMAST','ITEM_NO')
			DO ERR_MSG WITH 'ITEM WAS NOT FOUND IN ITEM MASTER'
		ENDIF 
		FOR I = 1 TO QTY
			DO PRINTBARCODE
		ENDF 
	ENDSCAN 
	SET PRINTER TO 
	SET PRINTER off 
	SET DEVICE TO SCREEN
	SET CONSOLE ON 
*!*		SET TEXTMERGE OFF 
*!*		_TEXT = -1
*!*		= FCLOSE(lnFileHandel)
	MODIFY FILE barcode.prn nomo 
	IF yesno('DO YOU WANT TO PRINT BAR CODE ?') = 'YES'
		! type barcode.prn > prn
	ENDIF 
	SELECT JOB_MAST
ENDIF 
POP KEY 

PROCEDURE PRINTBARCODE 


?'SIZE 72.6 mm, 35 mm'
?'GAP 3 mm, 0 mm'
?'SPEED 4'
?'DENSITY 7'
?'DIRECTION 0,0'
?'REFERENCE 0,0'
?'OFFSET 0 mm'
?'SHIFT 0'
?'SET PEEL OFF'
?'SET CUTTER OFF'
?'SET TEAR ON'
?'CLS'
?'CODEPAGE 850'
?'TEXT 439,270,"ROMAN.TTF",180,1,9,"HERO HONDA MOTORS LTD"'
?'TEXT 418,246,"ROMAN.TTF",180,1,4,"34,BASANT LOK, VASANT VIHAR, NEW DELHI - 110057"'
?'TEXT 445,230,"0",180,4,4,"Costomer Care Toll Free No. 1800 11 5555 (Form MTNL/BSNL lines)"'
?'TEXT 562,71,"ROMAN.TTF",90,1,10,"GENUINE"'
?'TEXT 493,197,"ROMAN.TTF",180,1,5,"PART NO."'
?'TEXT 493,173,"ROMAN.TTF",180,1,5,"DESCRIPTION"'
?'TEXT 493,149,"ROMAN.TTF",180,1,5,"SIZE / DIMENSION"'
?'TEXT 493,125,"ROMAN.TTF",180,1,5,"QUANTITY"'
?'TEXT 493,101,"ROMAN.TTF",180,1,5,"PKG. MOUNTH & YR."'
?'TEXT 373,197,"ROMAN.TTF",180,1,5,":"'
?'TEXT 373,173,"ROMAN.TTF",180,1,5,":"'
?'TEXT 373,149,"ROMAN.TTF",180,1,5,":"'
?'TEXT 373,125,"ROMAN.TTF",180,1,5,":"'
?'TEXT 373,101,"ROMAN.TTF",180,1,5,":"'
?'TEXT 357,197,"ROMAN.TTF",180,1,5,' + job_body.item_no
?'TEXT 357,173,"ROMAN.TTF",180,1,5,' + ALLTRIM(itemmast.item)
?'TEXT 357,125,"ROMAN.TTF",180,1,5,"1 No."'
?'TEXT 357,101,"ROMAN.TTF",180,1,5,"06 / 2008"'
?'TEXT 229,149,"ROMAN.TTF",180,1,5,"MRP INCL. OF ALL TAXES (IN RS)"'
?'TEXT 229,125,"ROMAN.TTF",180,1,5,"(PER UNIT)"'
?'TEXT 125,125,"ROMAN.TTF",180,1,5,"(PER PACK)"'
?'TEXT 221,101,"ROMAN.TTF",180,1,5,' + ALLTRIM(STR(job_body.spare_rt,10,2))
?'TEXT 110,101,"ROMAN.TTF",180,1,5,'+ALLTRIM(STR(job_body.spare_rt,10,2))
?'BARCODE 515,79,"128M",70,0,180,2,4,"!10524!100k150ls/!09900225006723001"'
?'PRINT 1,1'
