USE autopara IN 0 EXCLUSIVE 

SELECT autopara
DO ADDFIELD WITH 'AUTOPARA','AUTOSMSLNK','C(1)' 	  		  && DT 05/09/09  BY PRAMOD
DO ADDFIELD WITH 'AUTOPARA','BATTERYFLG','C(1)' 	  		  && DT 17/04/09  BY PRITEN


DO ADDFIELD WITH 'LEDGER','CHQBANKNAM','C(10)' 	  		  && DT 17/12/2012  BY VIREN    FOR CHQUE PRINTING
DO ADDFIELD WITH 'LEDGER','CHEQUEFILE','C(20)' 	  		  && DT 17/12/2012  BY VIREN	FOR CHQUE PRINTING


REPLACE version WITH '7.5.06.1'
REPLACE OUTOF_DATE WITH CTOD('10/07/2009')
USE IN AUTOPARA
IF GCPROTECTDBC = 'Y'
	IF EMPTY(DBGETPROP('autosoft',"DATABASE","DBCEVENTFILENAME"))
		IF DBSETPROP('AUTOSOFT',"DATABASE","DBCEVENTS",.T.) = .T.
			IF DBSETPROP('autosoft',"DATABASE","DBCEVENTFILENAME" ,SYS(2003) + '\dbcsecurity.fxp')
				IF DBSETPROP('AUTOSOFT',"DATABASE","DBCEVENTS",.T.) = .T.
					DO ERR_MSG WITH 'PASSWORD PROTECTION IS ACTIVATED'
				ELSE 
					MESSAGEBOX('PROTECTION WAS NOT ACTIVATED')
				ENDIF
			ENDIF 
		ELSE 
			MESSAGEBOX('PROTECTION WAS NOT ACTIVATED')
			CLOSE ALL
			CANCEL 
		ENDIF 
		
	ENDIF
ENDIF

*** PROGRAM TO UPGRADE STRUCTURE ****

DO SET_MENU
CLEAR
ON ERROR

PRIVATE LCRUNUPDYESNO
LCRUNUPDYESNO = '   '
DO FORM UPDATE_KHOPADI TO LCRUNUPDYESNO
IF LCRUNUPDYESNO = "NO"
	DO ATTENTION WITH 'UPDATE STRUCTURE WAS NOT DONE'
	DO CLS_MENU
	RETURN
ENDIF

PRIVATE msource,mtarget
STORE ' ' to msource,mtarget
msource = SYS(2003) +  '\data\' + gccompany_no + '\' + ltrim(str(year(mstart_dt))) + ltrim(str(year(mend_dt))) 
mtarget = SYS(2003) + '\DATA_BAK\' + gccompany_no + '\' + ltrim(str(year(mstart_dt))) + ltrim(str(year(mend_dt))) + '-ON-' + + STRT(DTOC(DATE()),'/','-')
DO OK_MSG WITH 'BACKUP WAS TAKEN IN : ' + CHR(13) + CHR(13) + mtarget + CHR(13)+ CHR(13) + 'FOLDER'
IF ! FILE('INFOACCESS.SYS')
	USE ACCESSRIGHTS
	COPY TO INFOACCESS.SYS 
	USE INFOACCESS.SYS ALIA INFOACCESS EXCLUSIVE 
	INDEX ON DOCNAME TAG DOCNAME ADDITIVE 
	INDEX ON DOCTYPE TAG DOCTYPE ADDITIVE
	INDEX ON USER_ID TAG USER_ID ADDITIVE
	INDEX ON user_id+doctype+docname TAG USERRIGHTS  ;
		FOR ! DELETED() CANDIDATE ADDITIVE
	USE IN INFOACCESS		
ENDIF
IF ! openfile(.T.)	
	DO err_beep
	lnresp = 1
	DO attention WITH 'THERE WAS PROBLEM IN OPENING DATA FILES;CONTACT YOUR SYSTEM ADMINISTRATOR'
	QUIT 
ENDIF 

gcUpgradeFlg = 'Y'


DO ADDFIELD WITH 'BOOKING','SMSFLAG','C(1)'		  	  			&& By Pramod 09/01/13 
DO ADDFIELD WITH 'SALEMAST','RTOPASSSMS','C(1)'		  	  		&& By Pramod 09/01/13 
DO ADDFIELD WITH 'SALEMAST','RTODOCUSMS','C(1)'		  	  		&& By Pramod 09/01/13 
DO ADDFIELD WITH 'SALEMAST','REDYVEHSMS','C(1)'					&& By Pramod 09/01/13

DO ADDFIELD WITH 'para','HandlingAc','c(6)'		  	  	  		&& By Priten 27/12/12 
DO ADDFIELD WITH 'para','sqRtoPrFlg ','c(1)'		  	  	  	&& By Priten 27/12/12 
DO ADDFIELD WITH 'para','speInspFee','c(1)'		  	  	  		&& By Priten 27/12/12 
DO ADDFIELD WITH 'para','splitRInc','c(1)'		  	  	  		&& By Priten 27/12/12 

DO ADDFIELD WITH 'CSI_INS','INSPAIDON','D(8)'		  	  		&& By Pramod 25/12/12 
DO ADDFIELD WITH 'CSI_INS','PREVINSAMT','N(10,2)'		  	  	&& By Pramod 25/12/12 
DO ADDFIELD WITH 'CSI_INS','CLOSFOLOWP','C(1)'		  	  	  	&& By Pramod 25/12/12 

DO ADDFIELD WITH 'rtoInsBody','rtoProfit','n(10,2)'				&& BY Priten 25/12/12
DO ADDFIELD WITH 'para','MultSalert','C(1)'						&& BY Priten 06/12/12
IF FSIZE('taxable','dealerSale') = 0	 && If taxable is added first time , calculate taxable and replace
	DO ADDFIELD WITH 'dealerSale','taxable','n(10,2)'					&& BY Priten 02/09/12
	UPDATE dealerSale SET taxable = (dealerSale.vat_amt + dealerSale.aVat_amt)*100/(12.5 + 2.5)
ENDIF 
IF FSIZE('taxableAmt','dealerBodye') = 0	 && If taxable is added first time , calculate taxable and replace
	DO ADDFIELD WITH 'dealerBody','taxableAmt','n(10,2)'				&& BY Priten 02/09/12
	UPDATE dealerBody SET taxableAmt = dealerBody.amount - st_amt - avat_amt
ENDIF



IF FSIZE('isalman_id','SALESMAN')=0
	DO ADDFIELD WITH 'SALESMAN','isalman_id','I' 				&& BY VIREN 17/12/12   FOR STORE UNIQUE ID
ENDIF

IF FSIZE('isalman_id','BOOKING')=0
	DO ADDFIELD WITH 'BOOKING','isalman_id','I' 				&& BY VIREN 17/12/12    FOR STORE UNIQUE ID
ENDIF


DO ADDFIELD WITH 'itemMast','TaxFreeFlg','C(1)'						&& BY Priten 19/08/12
DO ADDFIELD WITH 'job_comp','prevJobNo','C(7)'						&& BY Priten 19/08/12
DO ADDFIELD WITH 'job_comp','prevJobDt','D'							&& BY Priten 19/08/12
DO ADDFIELD WITH 'job_comp','prevMechNo','C(3)'						&& BY Priten 19/08/12

IF FSIZE('receipt_no','bank_deposit') = 6	&& If lenght is 6 increase to 7 so that JMR can be accomodated
	ALTER table bank_deposit alter COLUMN receipt_no c(7)
ENDIF 

DO ADDFIELD WITH 'para','multiSaleRt','C(1)'		&& MultiSaleRt - Multiple Sale Rate (ShowRoom) Is applicable or not
DO ADDFIELD WITH 'bank_deposit','source','C(20)'		&& Source - from where cheque on hand entry was entered
UPDATE ledger SET account = "CHEQUE ON HAND" ;
	WHERE ACCOUNT = "CHEQUE ON HAND SHOWROOM CLIENT"	&& BY PRITEN ON 17/06/12 AS NOW A/C NAME FOR CHEQUE ON HAND CONCET IS CHANGED
DO ADDFIELD WITH 'booking','prevBillDt','d'			&& Previous year bill date for previous year booking
IF FSIZE('ServebookNo','brokerpurchase') > 0
	DO ADDFIELD WITH 'brokerpurchase','ServbookNo','C(15)'		&& Godown wise location of item 	&& By Priten on 29/04/2012
	UPDATE brokerpurchase SET ServbookNo = ServebookNo
	ALTER table brokerpurchase drop ServebookNo
ENDIF
DO ADDFIELD WITH 'brokerpurchase','ServbookNo','C(15)'		&& sERVICE BOOK NO.

IF FSIZE('glocation','godown_i') = 0
	DO ADDFIELD WITH 'godown_i','glocation','C(10)'		&& Godown wise location of item 	&& By Priten on 29/04/2012
	SELECT godown_i
	SCAN
		IF SEEK(item_no,'itemMast','item_no')
			REPLACE gLocation WITH itemMast.location
		ENDIF 
	ENDSCAN 
ENDIF




********************************************************************************************************************************

IF LEN(CRTM.CRTRECPTNO) < 20
	ALTER TABLE CRTM ALTER COLUMN CRTRECPTNO C(20)
ENDIF
IF LEN(CRTM.TMPREGINO) < 20
	ALTER TABLE CRTM ALTER COLUMN TMPREGINO C(20)
ENDIF


DO ADDFIELD WITH 'AGENT','LOCK_FLG','C(1)'								&& BY Pramod 03/09/12
DO ADDFIELD WITH 'AGENT','GODOWN_NO','C(2)'								&& BY Pramod 03/09/12
DO ADDFIELD WITH 'AGENT','ACCOUNT_NO','C(6)'							&& BY Pramod 03/09/12
DO ADDFIELD WITH 'LEDGER','STATE','C(20)'								&& BY Pramod 03/09/12

DO ADDFIELD WITH 'PARA','MI_RETUFLG','c(1)'			&& By Pramod 21/07/2012 && MATERIAL ISSUE RETURN CONSEPT (FOR HET BAJAJ)

DO ADDFIELD WITH 'ISSUEBOD','RETU_QTY','N(10,3)'						&& BY Pramod 19/07/12 
DO ADDFIELD WITH 'ISSUEBOD','BAL_QTY','N(10,3)'							&& BY Pramod 19/07/12 
DO ADDFIELD WITH 'ISSUEBOD','RETUREASON','C(200)'						&& BY Pramod 19/07/12 
DO ADDFIELD WITH 'ISSUEBOD','RETU_DATE','D(8)'							&& BY Pramod 19/07/12 
DO ADDFIELD WITH 'ISSUEBOD','RETURNBY','C(10)'							&& BY Pramod 19/07/12 
UPDATE ISSUEBOD SET BAL_QTY = (QTY - RETU_QTY) WHERE EMPTY(BAL_QTY)


DO ADDFIELD WITH 'INSRENEWAL','INSPAYDOC','C(8)'						&& By Pramod 10/07/2012
DO ADDFIELD WITH 'INSRENEWAL','HINSPAYDOC','C(8)'						&& By Pramod 10/07/2012
DO ADDFIELD WITH 'INSRENEWAL','TOTAL_AMT','N(9,2)'						&& By Pramod 10/07/2012
DO ADDFIELD WITH 'INSRENEWAL','HINS_AMT','N(9,2)'						&& By Pramod 10/07/2012
DO ADDFIELD WITH 'INSRENEWAL','HINS_AC','C(6)'							&& By Pramod 10/07/2012

DO ADDFIELD WITH 'SALEMAST','GLCompFlg','C(1)'				 			&& By Pramod 27/06/2012

****************************************************************************************************
********************************* AUTODMS RELATED FIELDS *******************************************
****************************************************************************************************


DO ADDFIELD WITH 'SALEMAST','PRINDCTIME','T(8)'							&& BY Pramod 14/08/12

DO ADDFIELD WITH 'LEDGER','STATE','C(20)'								&& BY Pramod 14/08/12

DO ADDFIELD WITH 'VEHICLE','DMSADDBY','C(15)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'VEHICLE','DMSADDDT','D(8)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'VEHICLE','DMSRDPURNO','C(30)'					  		&& By Pramod 30/01/2012
DO ADDFIELD WITH 'VEHICLE','DMSRDRECNO','C(30)'					  		&& By Pramod 30/01/2012
DO ADDFIELD WITH 'VEHICLE','RsVhRdPur','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'VEHICLE','TrgVhRdPur','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'VEHICLE','TypVhRdPur','C(60)'							&& By Pramod 03/03/2012


DO ADDFIELD WITH 'IT_PUR','TaxOthrPer','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','TaxOthrAmt','N(10,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','VatOthrPer','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','VatOthrAmt','N(10,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','aVatOthPer','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','aVatOthAmt','N(10,2)'						&& By Pramod 03/03/2012

DO ADDFIELD WITH 'IT_PUR','RsSprPur','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','TrgSprPur','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','TypSprPur','C(60)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'IT_PUR','DMSORDERNO','C(30)'							&& By Pramod 13/02/2012
DO ADDFIELD WITH 'IT_PUR','DMSBILLDT','D(8)'							&& By Pramod 13/02/2012
DO ADDFIELD WITH 'IT_PUR','DMSBILLNO','C(30)'							&& By Pramod 13/02/2012
DO ADDFIELD WITH 'IT_PUR','DMSADD_BY','C(10)'							&& By Pramod 13/02/2012
DO ADDFIELD WITH 'IT_PUR','DMSADD_DT','D(8)'							&& By Pramod 13/02/2012

DO ADDFIELD WITH 'PROFORMA','RsEnquiry','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'PROFORMA','TrgEnquiry','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'PROFORMA','TypEnquiry','C(60)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'PROFORMA','CURNT_MODL','C(40)'					  	&& By Pramod 06/01/2011
DO ADDFIELD WITH 'PROFORMA','DMSENQNO','C(30)'					  		&& By Pramod 06/01/2011
DO ADDFIELD WITH 'PROFORMA','DMSCONTCID','C(30)'					  	&& By Pramod 06/01/2011
DO ADDFIELD WITH 'PROFORMA','DMSPROFINV','C(30)'					  	&& By Pramod 06/01/2011
DO ADDFIELD WITH 'PROFORMA','BOOKING_NO','C(6)'                         && By Pramod 06/01/2011
DO ADDFIELD WITH 'PROFORMA','DMSADDBY','C(15)'					  		&& By Pramod 07/01/2011
DO ADDFIELD WITH 'PROFORMA','DMSADDDT','T(8)'					  		&& By Pramod 07/01/2011

DO ADDFIELD WITH 'SALEMAST','RsEnquiry','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','RsVsDir','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','RsVsAgent','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','RsVsDlr','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','TrgEnquiry','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','TrgVSDir','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','TrgVsAgnt','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','TrgVsDlr','N(5,2)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','TypEnquiry','C(60)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','TypVSDir','C(60)'							&& By Pramod 03/03/2012	
DO ADDFIELD WITH 'SALEMAST','TypVsAgnt','C(60)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','TypVsDlr','C(60)'							&& By Pramod 03/03/2012
DO ADDFIELD WITH 'SALEMAST','DMSENQNO','C(30)'					  		&& By Pramod 26/01/2012
DO ADDFIELD WITH 'SALEMAST','DMSCONTCID','C(30)'					  	&& By Pramod 26/01/2012
DO ADDFIELD WITH 'SALEMAST','DMSPROFINV','C(30)'					  	&& By Pramod 26/01/2012
DO ADDFIELD WITH 'SALEMAST','DMSADDBY','C(15)'					  		&& By Pramod 26/01/2012
DO ADDFIELD WITH 'SALEMAST','DMSADDDT','T(8)'					  		&& By Pramod 26/01/2012
DO ADDFIELD WITH 'SALEMAST','DMSBILL_NO','C(30)'						&& By Pramod 10/01/2011
DO ADDFIELD WITH 'SALEMAST','DMSBILADBY','C(30)'						&& By Pramod 10/01/2011
DO ADDFIELD WITH 'SALEMAST','DMSBILADDT','D(8)'							&& By Pramod 10/01/2011

DO ADDFIELD WITH 'BRANCHSALE','RsVsBrDir','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','RsVsBrAgn','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','RsVsBrDlr','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','TrgVsBrDir','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','TrgVsBrAgn','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','TrgVsBrDlr','N(5,2)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','TypVsBrDir','C(60)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','TypVsBrAgn','C(60)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','TypVsBrDlr','C(60)'						&& By Pramod 03/03/2012
DO ADDFIELD WITH 'BRANCHSALE','DMSRECPTNO','C(30)'						&& By Pramod 22/01/2011
DO ADDFIELD WITH 'BRANCHSALE','DMSBILADBY','C(30)'						&& By Pramod 22/01/2011
DO ADDFIELD WITH 'BRANCHSALE','DMSBILADDT','D(8)'						&& By Pramod 22/01/2011

DO ADDFIELD WITH 'VEHICLETRNBODY','RsVIntTrn','N(5,2)'					&& By Pramod 03/03/2012
DO ADDFIELD WITH 'VEHICLETRNBODY','TrgVIntTrn','N(5,2)'					&& By Pramod 03/03/2012
DO ADDFIELD WITH 'VEHICLETRNBODY','TypVIntTrn','C(60)'					&& By Pramod 03/03/2012
DO ADDFIELD WITH 'VEHICLETRNBODY','DMSINWRDNO','C(30)'					&& By Pramod 19/01/2011
DO ADDFIELD WITH 'VEHICLETRNBODY','DMSINWADBY','C(30)'					&& By Pramod 19/01/2011
DO ADDFIELD WITH 'VEHICLETRNBODY','DMSINWADDT','D(8)'					&& By Pramod 19/01/2011

DO ADDFIELD WITH 'JOB_MAST','DMSREMARK','C(200)'					  	&& By Pramod 04/02/2012
DO ADDFIELD WITH 'JOB_MAST','DMSBYREMRK','C(1)'					  		&& By Pramod 30/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSLABRFLG','C(1)'					  		&& By Pramod 30/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSMIWAFLG','C(1)'					  		&& By Pramod 30/12/2010
DO ADDFIELD WITH 'JOB_BODY','DMSISUEQTY','N(9,3)'					  	&& By Pramod 30/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSJCDT','D(8)'					  		&& By Pramod 29/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSJCNO','C(30)'					  		&& By Pramod 29/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSSRNO','C(30)'					  		&& By Pramod 29/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSMIFLG','C(1)'					  		&& By Pramod 29/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSBILLNO','C(30)'					  		&& By Pramod 29/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSBILLDT','D(8)'					  		&& By Pramod 29/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSBILLAMT','N(12,2)'				  		&& By Pramod 29/12/2010
DO ADDFIELD WITH 'JOB_MAST','DMSCOUFLG','C(1)'					  		&& By Pramod 29/12/2010

DO ADDFIELD WITH 'ITEMMAST','DMSLABCODE','C(30)'					  	&& By Pramod 04/02/2012
DO ADDFIELD WITH 'ITEMMAST','LOCKFORDMS','C(1)'					  		&& By Pramod 04/02/2012

DO ADDFIELD WITH 'HPARECPTBODY','DMSHPAIDNO','C(30)'					&& By Pramod 10/01/2011
DO ADDFIELD WITH 'HPARECPTBODY','DMSHPAADBY','C(30)'					&& By Pramod 10/01/2011
DO ADDFIELD WITH 'HPARECPTBODY','DMSHPAADDT','D(8)'						&& By Pramod 10/01/2011

DO ADDFIELD WITH 'TRANSECT','DMSCLIVONO','C(30)'					  	&& By Pramod 09/01/2011
DO ADDFIELD WITH 'TRANSECT','DMSCLIADBY','C(30)'					  	&& By Pramod 09/01/2011
DO ADDFIELD WITH 'TRANSECT','DMSCLIADDT','D(8)'					  		&& By Pramod 09/01/2011

DO ADDFIELD WITH 'RECEIPT','DMSRECPTNO','C(30)'					  		&& By Pramod 09/01/2011
DO ADDFIELD WITH 'RECEIPT','DMSRECADBY','C(30)'					  		&& By Pramod 09/01/2011
DO ADDFIELD WITH 'RECEIPT','DMSRECADDT','D(8)'					  		&& By Pramod 09/01/2011

DO ADDFIELD WITH 'BOOKING','DMSBKCANNO','C(30)'					  		&& By Pramod 08/01/2011
DO ADDFIELD WITH 'BOOKING','DMSBKCADBY','C(30)'					  		&& By Pramod 08/01/2011
DO ADDFIELD WITH 'BOOKING','DMSBKCADDT','D(8)'					  		&& By Pramod 08/01/2011
DO ADDFIELD WITH 'BOOKING','DMSORDERNO','C(30)'					  		&& By Pramod 07/01/2011
DO ADDFIELD WITH 'BOOKING','DMSADDBY','C(15)'					  		&& By Pramod 07/01/2011
DO ADDFIELD WITH 'BOOKING','DMSADDDT','T(8)'					  		&& By Pramod 07/01/2011

ALTER TABLE PROFORMA ALTER COLUMN DMSADDBY C(3)                       	&& DT. 21/05/2011  Pramod
ALTER TABLE BOOKING ALTER COLUMN DMSADDBY C(3)                       	 && DT. 21/05/2011  Pramod
ALTER TABLE BOOKING ALTER COLUMN DMSBKCADBY C(3)                      	&& DT. 21/05/2011  Pramod
ALTER TABLE RECEIPT ALTER COLUMN DMSRECADBY C(3)                      	&& DT. 21/05/2011  Pramod
ALTER TABLE SALEMAST ALTER COLUMN DMSBILADBY C(3)                     	&& DT. 21/05/2011  Pramod
ALTER TABLE BRANCHSALE ALTER COLUMN DMSBILADBY C(3)                   	&& DT. 21/05/2011  Pramod
ALTER TABLE VEHICLETRNBODY ALTER COLUMN DMSINWADBY C(3)               	&& DT. 21/05/2011  Pramod

ALTER TABLE JOB_MAST ALTER COLUMN DJCRDADDBY C(3)                       && DT. 18/05/2011  Pramod 
ALTER TABLE JOB_MAST ALTER COLUMN DMISUADDBY C(3)                       && DT. 18/05/2011  Pramod 
ALTER TABLE JOB_MAST ALTER COLUMN DWARYADDBY C(3)                       && DT. 18/05/2011  Pramod 
ALTER TABLE JOB_MAST ALTER COLUMN DCOMPADDBY C(3)                       && DT. 18/05/2011  Pramod 
ALTER TABLE JOB_MAST ALTER COLUMN DJBILADDBY C(3)                       && DT. 18/05/2011  Pramod 
ALTER TABLE JOB_MAST ALTER COLUMN DCOUNADDBY C(3)                       && DT. 18/05/2011  Pramod 
ALTER TABLE JOB_MAST ALTER COLUMN DMSCOUFLG C(1)                        && DT. 18/05/2011  Pramod  

DO ADDFIELD WITH 'JOB_DMS','JOBCARD_NO','C(7)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DJCRDADDBY','C(15)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DJCRDADDDT','T(8)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMISUADDBY','C(15)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMISUADDDT','T(8)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DWARYADDBY','C(15)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DWARYADDDT','T(8)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DCOMPADDBY','C(15)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DCOMPADDDT','T(8)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DJBILADDBY','C(15)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DJBILADDDT','T(8)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DCOUNADDBY','C(3)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DCOUNADDDT','T(8)'				 && By Pramod 23/06/2012

DO ADDFIELD WITH 'JOB_DMS','DMSBYREMRK','C(1)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSLABRFLG','C(1)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSMIWAFLG','C(1)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_BODY','DMSISUEQTY','N(9,3)'			 && By Pramod 23/06/2012

DO ADDFIELD WITH 'JOB_DMS','DMSJCDT','D(8)'					 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSJCNO','C(30)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSSRNO','C(30)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSMIFLG','C(1)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSBILLNO','C(30)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSBILLDT','D(8)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSBILLAMT','N(12,2)'			 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','DMSCOUFLG','C(1)'				 && By Pramod 23/06/2012

DO ADDFIELD WITH 'JOB_DMS','RsFrJcard','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','RsFrMisu','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','RsRgJcard','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','RsJcCompW','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','RsMiCompW','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','RsMiWoCom','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','RsCouWoBr','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','RsCouBrn','N(5,2)'				 && By Pramod 23/06/2012

DO ADDFIELD WITH 'JOB_DMS','TrgFrJcard','N(5,2)'			 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TrgFrMisu','N(5,2)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TrgRgJcard','N(5,2)'			 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TrgJcCompW','N(5,2)'			 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TrgMiCompW','N(5,2)'			 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TrgMiWoCom','N(5,2)'			 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TrgCouWoBr','N(5,2)'			 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TrgCouBrn','N(5,2)'				 && By Pramod 23/06/2012

DO ADDFIELD WITH 'JOB_DMS','TypFrJcard','C(60)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TypFrMisu','C(60)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TypRgJcard','C(60)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TypJcCompW','C(60)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TypMiCompW','C(60)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TypMiWoCom','C(60)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TypCouWoBr','C(60)'				 && By Pramod 23/06/2012
DO ADDFIELD WITH 'JOB_DMS','TypCouBrn','C(60)'				 && By Pramod 23/06/2012

DO ADDFIELD WITH 'JOB_DMS','DMSREMARK','C(200)'				 && By Pramod 23/06/2012

ALTER TABLE JOB_MAST DROP COLUMN DJCRDADDBY
ALTER TABLE JOB_MAST DROP COLUMN DJCRDADDDT
ALTER TABLE JOB_MAST DROP COLUMN DMISUADDBY
ALTER TABLE JOB_MAST DROP COLUMN DMISUADDDT
ALTER TABLE JOB_MAST DROP COLUMN DWARYADDBY
ALTER TABLE JOB_MAST DROP COLUMN DWARYADDDT
ALTER TABLE JOB_MAST DROP COLUMN DCOMPADDBY
ALTER TABLE JOB_MAST DROP COLUMN DCOMPADDDT
ALTER TABLE JOB_MAST DROP COLUMN DJBILADDBY
ALTER TABLE JOB_MAST DROP COLUMN DJBILADDDT
ALTER TABLE JOB_MAST DROP COLUMN DCOUNADDBY
ALTER TABLE JOB_MAST DROP COLUMN DCOUNADDDT

ALTER TABLE JOB_MAST DROP COLUMN RsFrJcard
ALTER TABLE JOB_MAST DROP COLUMN RsFrMisu
ALTER TABLE JOB_MAST DROP COLUMN RsRgJcard
ALTER TABLE JOB_MAST DROP COLUMN RsJcCompW
ALTER TABLE JOB_MAST DROP COLUMN RsMiCompW
ALTER TABLE JOB_MAST DROP COLUMN RsMiWoCom
ALTER TABLE JOB_MAST DROP COLUMN RsCouWoBr
ALTER TABLE JOB_MAST DROP COLUMN RsCouBrn

ALTER TABLE JOB_MAST DROP COLUMN TrgFrJcard
ALTER TABLE JOB_MAST DROP COLUMN TrgFrMisu
ALTER TABLE JOB_MAST DROP COLUMN TrgRgJcard
ALTER TABLE JOB_MAST DROP COLUMN TrgJcCompW
ALTER TABLE JOB_MAST DROP COLUMN TrgMiCompW
ALTER TABLE JOB_MAST DROP COLUMN TrgMiWoCom
ALTER TABLE JOB_MAST DROP COLUMN TrgCouWoBr
ALTER TABLE JOB_MAST DROP COLUMN TrgCouBrn

ALTER TABLE JOB_MAST DROP COLUMN TypFrJcard
ALTER TABLE JOB_MAST DROP COLUMN TypFrMisu
ALTER TABLE JOB_MAST DROP COLUMN TypRgJcard
ALTER TABLE JOB_MAST DROP COLUMN TypJcCompW
ALTER TABLE JOB_MAST DROP COLUMN TypMiCompW
ALTER TABLE JOB_MAST DROP COLUMN TypMiWoCom
ALTER TABLE JOB_MAST DROP COLUMN TypCouWoBr
ALTER TABLE JOB_MAST DROP COLUMN TypCouBrn


USE (MPROG_PATH) + "INFO.SYS" IN 0 alia password EXCLUSIVE 
	DO ADDFIELD WITH 'PASSWORD','MIN_RIGHTS','C(1)' 	 	       		&& By Pramod 07/07/2011

	DO ADDFIELD WITH 'PASSWORD','LOCKUSER','C(1)' 	 	       			&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','SERVICEFLG','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','SALESFLG','C(1)' 	 	       			&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTFRJCARD','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTFRMISU','C(1)' 	 	       			&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTRGJCARD','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTJCCOMPW','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTMICOMPW','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTMIWOCOM','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTCOUWOBR','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTCOUBRN','C(1)' 	 	       			&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTSPRPUR','C(1)' 	 	       			&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTENQUIRY','C(1)' 	 	       		&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTVSDIR','C(1)' 	 	       			&& By Pramod 02/07/2012
	DO ADDFIELD WITH 'PASSWORD','ENTVSAGNT','C(1)' 	 	       			&& By Pramod 02/07/2012	
	DO ADDFIELD WITH 'PASSWORD','ENTVSDLR','C(1)' 	 	       			&& By Pramod 02/07/2012	
	DO ADDFIELD WITH 'PASSWORD','ENTVSBRDIR','C(1)' 	 	       		&& By Pramod 02/07/2012		
	DO ADDFIELD WITH 'PASSWORD','ENTVSBRAGN','C(1)' 	 	       		&& By Pramod 02/07/2012			
	DO ADDFIELD WITH 'PASSWORD','ENTVSBRDLR','C(1)' 	 	       		&& By Pramod 02/07/2012				
	DO ADDFIELD WITH 'PASSWORD','ENTVINTTRN','C(1)' 	 	       		&& By Pramod 02/07/2012					
	DO ADDFIELD WITH 'PASSWORD','ENTVHRDPUR','C(1)' 	 	       		&& By Pramod 02/07/2012						
	DO ADDFIELD WITH 'PASSWORD','EXPBRNSALE','C(1)' 	 	       		&& By Pramod 02/07/2012							
	DO ADDFIELD WITH 'PASSWORD','IMPBRNSALE','C(1)' 	 	       		&& By Pramod 02/07/2012								
	DO ADDFIELD WITH 'PASSWORD','REPORTS','C(1)' 	 	       			&& By Pramod 02/07/2012									
	DO ADDFIELD WITH 'PASSWORD','MIS','C(1)' 	 	       				&& By Pramod 02/07/2012										

	DO ADDFIELD WITH 'PASSWORD','RsFrJcard','N(5,2)' 	 	       		&& By Pramod 02/07/2012										
	DO ADDFIELD WITH 'PASSWORD','RsFrMisu','N(5,2)' 	 	       		&& By Pramod 02/07/2012										
	DO ADDFIELD WITH 'PASSWORD','RsRgJcard','N(5,2)' 	 	       		&& By Pramod 02/07/2012										
	DO ADDFIELD WITH 'PASSWORD','RsJcCompW','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsMiCompW','N(5,2)' 	 	       		&& By Pramod 02/07/2012											
	DO ADDFIELD WITH 'PASSWORD','RsMiWoCom','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsCouWoBr','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsCouBrn','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsSprPur','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsEnquiry','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsVsDir','N(5,2)' 	 	       			&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsVsAgent','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsVsDlr','N(5,2)' 	 	       			&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsVsBrDir','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsVsBrAgn','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','RsVsBrDlr','N(5,2)' 	 	       		&& By Pramod 02/07/2012														
	DO ADDFIELD WITH 'PASSWORD','RsVIntTrn','N(5,2)' 	 	       		&& By Pramod 02/07/2012														
	DO ADDFIELD WITH 'PASSWORD','RsVhRdPur','N(5,2)' 	 	       		&& By Pramod 02/07/2012														
	
	DO ADDFIELD WITH 'PASSWORD','TrgFrJcard','N(5,2)' 	 	       		&& By Pramod 02/07/2012										
	DO ADDFIELD WITH 'PASSWORD','TrgFrMisu','N(5,2)' 	 	       		&& By Pramod 02/07/2012										
	DO ADDFIELD WITH 'PASSWORD','TrgRgJcard','N(5,2)' 	 	       		&& By Pramod 02/07/2012										
	DO ADDFIELD WITH 'PASSWORD','TrgJcCompW','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgMiCompW','N(5,2)' 	 	       		&& By Pramod 02/07/2012											
	DO ADDFIELD WITH 'PASSWORD','TrgMiWoCom','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgCouWoBr','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgCouBrn','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgSprPur','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgEnquiry','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgVsDir','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgVsAgnt','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgVsDlr','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgVsBrDir','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgVsBrAgn','N(5,2)' 	 	       		&& By Pramod 02/07/2012												
	DO ADDFIELD WITH 'PASSWORD','TrgVsBrDlr','N(5,2)' 	 	       		&& By Pramod 02/07/2012														
	DO ADDFIELD WITH 'PASSWORD','TrgVIntTrn','N(5,2)' 	 	       		&& By Pramod 02/07/2012														
	DO ADDFIELD WITH 'PASSWORD','TrgVhRdPur','N(5,2)' 	 	       		&& By Pramod 02/07/2012														

	DO ADDFIELD WITH 'PASSWORD','DirEntClos','C(1)' 	 	       		&& By Pramod 02/07/2012															

	DO ADDFIELD WITH 'PASSWORD','BACKUP','C(1)' 	 	       			&& By Pramod 02/07/2012															
	DO ADDFIELD WITH 'PASSWORD','RESTORE','C(1)' 	 	       			&& By Pramod 02/07/2012																	
	
USE IN PASSWORD


*********************************************************************************************************************
*********************************************************************************************************************

DO ADDFIELD WITH 'PARA','RTOPROFPST','c(1)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','PRTOSEPFLG','c(1)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','RTOPROFADJ','c(6)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','SQRTOPRFLG','c(1)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','SQRTOPRFAC','c(6)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','OTHRTOINAC','c(6)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','RECSERCASH','c(6)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','RECSERCHEQ','c(6)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','INSFEEPOST','c(6)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'PARA','RTOPROFAC','c(6)'						 && By Pramod 06/06/2012   

*********************************************************************************************************************

ALTER TABLE ESTIBODY ALTER COLUMN QTY N(9,3)

DO ADDFIELD WITH 'BANK_DEPOSIT','source','c(20)'					&& By Priten 13/06/2012    Source from where Cheque on hand entry was captured
DO ADDFIELD WITH 'jReceipt','chqHandFlg','c(1)'						&& By Priten 12/06/2012    Received Cheque is deposited in bank or not (For cheque on hand)
DO ADDFIELD WITH 'jReceipt','bankDepoNo','c(6)'						&& By Priten 12/06/2012    If Received Cheque is deposited in bank then entryNo (For cheque on hand)
DO ADDFIELD WITH 'jReceipt','bankDepoDt','d'						&& By Priten 12/06/2012    Received Cheque is deposited in bank then entry date  (For cheque on hand)
DO ADDFIELD WITH 'transect','vatFlg','c(1)'							&& By Priten 07/06/2012    Vat rate for Transaction is with Vat in Client voucher
DO ADDFIELD WITH 'transect','TaxableAmt','n(10,2)'					&& By Priten 07/06/2012    Vat rate for Transaction is with Vat in Client voucher
DO ADDFIELD WITH 'transect','VatAmt','n(10,2)'						&& By Priten 07/06/2012    Vat rate for Transaction is with Vat in Client voucher
DO ADDFIELD WITH 'transect','aVatAmt','n(10,2)'						&& By Priten 07/06/2012    Addi. Vat AMT for Transaction is with Vat in Client voucher
DO ADDFIELD WITH 'transect','aVatRt','n(5,2)'						&& By Priten 07/06/2012    Addi. Vat rate for Transaction is with Vat in Client voucher
DO ADDFIELD WITH 'transect','vatRt','n(5,2)'						&& By Priten 07/06/2012    Vat rate for Transaction is with Vat in Client voucher
DO ADDFIELD WITH 'transect','vatIOFlg','c(1)'						&& By Priten 07/06/2012    Transaction is with Vat or Not in Client voucher

DO ADDFIELD WITH 'para','ASKCASHFLG','c(1)'						 && By Pramod 06/06/2012   
DO ADDFIELD WITH 'para','vsAccAc','c(6)'						 && By Priten 02/06/2012    Accessory Sales A/C at Vehicle sales bill
DO ADDFIELD WITH 'para','vsHelmatAc','c(6)'						 && By Priten 02/06/2012	Helmat Sales A/C at Vehicle sales bill
DO updItemGodownBal WITH '01'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '02'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '03'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '04'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '05'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '06'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '07'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '08'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '09'             && Godown1 Balance		&& By Priten on 21/04/2012
DO updItemGodownBal WITH '10'             && Godown1 Balance		&& By Priten on 21/04/2012

DO ADDFIELD WITH 'ESTIMATE','JOBSITE','c(50)'						 && By Pramod 20/05/2012
DO ADDFIELD WITH 'ESTIMATE','OTHER','N(10,2)'						 && By Pramod 20/05/2012

DO ADDFIELD WITH 'SALEMAST','HELMATAMT','N(10,2)'					&& BY PRAMOD 07/05/2012
DO ADDFIELD WITH 'DEALERSALE','PREV_FLG','C(1)'						&& By Pramod on 07/05/2012

DO ADDFIELD WITH 'para','cRecptSer','C(1)'		&& cash receipt series		&& By Priten on 29/03/2012
DO ADDFIELD WITH 'para','chRecptSer','C(1)'		&& cheque receipt series	&& By Priten on 29/03/2012
DO ADDFIELD WITH 'para','rtoFormula','C(254)'								&& By Priten on 29/03/2012
DO ADDFIELD WITH 'bank_deposit','creditAc','C(6)'							&& By Priten on 27/03/2012
IF FSIZE('recptType','receipt') = 0
	DO ADDFIELD WITH 'receipt','receptType','C(6)'							&& By Priten 20/03/2012
	UPDATE receipt SET receptType = "CLIENT" 
ENDIF
DO ADDFIELD WITH 'receipt','creditAc','C(6)'								&& By Priten 20/03/2012
USE (MPROG_PATH) + "INFO.SYS" IN 0 alia password EXCLUSIVE 
	DO ADDFIELD WITH 'PASSWORD','vrcptentry','C(1)' 	 	       		  && By Priten 11/04/2012	For Receipt Entry rights
	DO ADDFIELD WITH 'PASSWORD','SHWVALUSTK','C(1)' 	 	       		  && By Pramod 01/03/2012	
USE IN PASSWORD

IF FSIZE("rdTaxCust","rtoInsBody") = 0			&& By Priten 08/03/2012
	DO ADDFIELD WITH 'rtoInsBody','rdTaxCust','N(5,2)'						
	UPDATE rtoInsBody set rtoInsBody.rdTaxCust = rtoinsbody.road_tax 
ENDIF
DO ADDFIELD WITH 'rtoInsurance','rtoTaxRt','N(5,2)'						&& By Priten 07/03/2012

***********************************************************************************************************

DO ADDFIELD WITH 'para','RoadTaxRt','n(5,2)'						  && By Priten 9/03/2012
DO ADDFIELD WITH 'rtoInsurancce','rtoTaxRt','n(5,2)'				  && By Priten 5/03/2012
DO ADDFIELD WITH 'para','rtoTaxRt','n(5,2)'						      && By Priten 5/03/2012
DO ADDFIELD WITH 'para','pstRProfit','c(1)'						  	  && By Priten 5/03/2012
DO ADDFIELD WITH 'job_mast','PODt','D'						  	  	  && By Priten & Sanket 15/02/2012
DO ADDFIELD WITH 'job_mast','PONo','C(15)'						  	  && By Priten & Sanket 15/02/2012
DO ADDFIELD WITH 'job_body','itCst_rt','n(5,2)'						  && By Priten 10/02/2012
DO ADDFIELD WITH 'job_mast','jobSite','c(50)'						  && By Priten 27/01/2012
DO ADDFIELD WITH 'job_mast','vehHours','c(10)'						  && By Priten 27/01/2012
DO ADDFIELD WITH 'dealerToCustomer','chasisNo','c(20)'				  && By Priten 10/01/2012
DO ADDFIELD WITH 'PARA','PaidLabFlg','C(1)' 		  		  	  	  && DT 27/12/12  BY PRITEN

IF FSIZE('pmcSingleAc','para') > 0
	PRIVATE lcpmcSingleAc 
	lcpmcSingleAc = para.pmcSingleAc
	ALTER TABLE para drop COLUMN pmcSingleAc
	ALTER TABLE para add COLUMN pmcSinglAc c(1)
	UPDATE para set pmcSinglAc = lcpmcSingleAc
ENDIF 

DO ADDFIELD WITH 'SALEMAST','RTO_REGDT','D(10)'							&& By Pramod 20/01/2012

DO ADDFIELD WITH 'DEALERBODY','CLIBILLNO','C(6)' 		  		  	  	&& DT 23/02/10  BY PRITEN
DO ADDFIELD WITH 'JOB_MAST','OTHER_AC','C(6)' 		  		  	  	  	&& DT 12/02/10  BY PRITEN
DO ADDFIELD WITH 'PARA','PMCSINGLAC','C(1)' 		  		  	  	  	&& DT 12/02/10  BY PRITEN

DO ADDFIELD WITH 'BOOKING','EFFPRICEDT','D(8)'							&& By Pramod 16/11/2011
DO ADDFIELD WITH 'para','dtbookrate','c(1)'								&& By Pramod 14/11/2011

DO ADDFIELD WITH 'para','dcControl','c(1)'								&& By Priten 10/11/2011
DO ADDFIELD WITH 'booking','COMPANYFLG','c(1)'							&& By Pramod 18/09/2011

USE (MPROG_PATH) + "INFO.SYS" IN 0 alia password EXCLUSIVE 
	DO ADDFIELD WITH 'PASSWORD','SHWVALUSTK','C(1)' 	 	       			&& By Pramod 01/03/2012
	DO ADDFIELD WITH 'PASSWORD','MIN_RIGHTS','C(1)' 	 	       		&& By Pramod 07/07/2011
USE IN PASSWORD

DO ADDFIELD WITH 'BOOKING','HELMATAMT','N(10,2)'						&& BY PRITEN 05/09/2011
DO ADDFIELD WITH 'PARA','MARKETLINK','C(1)'								&& BY PRITEN 05/09/2011

DO ADDFIELD WITH 'CLIENTINFO','NPAYOUTPER','N(5,2)'						&& By Pramod 27/08/2011
DO ADDFIELD WITH 'CLIENTINFO','EXTWBOOKNO','C(25)'         				&& By Pramod 26/08/2011

DO ADDFIELD WITH 'CLIENTINFO','GLNOMINY','c(40)'						&& By Pramod 16/07/2011
DO ADDFIELD WITH 'CLIENTINFO','GLRELATION','c(40)'						&& By Pramod 16/07/2011
DO ADDFIELD WITH 'CLIENTINFO','GLNOMIBDT','D(8)'						&& By Pramod 02/10/2011


DO ADDFIELD WITH 'JOB_MAST','NPMCOILFLG','C(1)'         				&& By Pramod 15/08/2011
DO ADDFIELD WITH 'PMCSCHEM','NEWPMCOIL','C(1)'         					&& By Pramod 15/08/2011
DO ADDFIELD WITH 'CLIENTINFO','HELTPAIDON','D(8)'         				&& By Pramod 15/08/2011

DO ADDFIELD WITH 'BOOKING','HEALTHDOC','C(8)'         					&& By Pramod 15/08/2011
DO ADDFIELD WITH 'RTOINSBODY','HEALTHINS','N(10,3)'         			&& By Pramod 15/08/2011
DO ADDFIELD WITH 'RTOINSBODY','MODELHELTH','N(10,3)'         			&& By Pramod 15/08/2011

DO ADDFIELD WITH 'CLIENTINFO','EXWPAIDON','D(8)'         				&& By Pramod 11/08/2011
DO ADDFIELD WITH 'RTOINSBODY','EXWARAMT','N(10,3)'         				&& By Pramod 11/08/2011
DO ADDFIELD WITH 'RTOINSBODY','MODELEXTW','N(10,3)'         			&& By Pramod 11/08/2011

DO ADDFIELD WITH 'BOOKING','EXTWDOCNO','C(8)'         					&& By Pramod 11/08/2011

DO ADDFIELD WITH 'PARA','RTOWITHZON','C(1)'         					&& By Pramod 10/08/2011
DO ADDFIELD WITH 'PARA','RTOWEBLINK','C(10)'							&& By Pramod 14/07/2011

DO ADDFIELD WITH 'SALEMAST','WARRWEBFLG','C(1)'         				&& By Pramod 08/08/2011
DO ADDFIELD WITH 'CLIENTINFO','WARRWEBFLG','C(1)'         				&& By Pramod 08/08/2011
DO ADDFIELD WITH 'MODEL','EXTWMODEL','I(4)'	          					&& By Pramod 02/08/2011

DO ADDFIELD WITH 'CLIENTINFO','NEWPMCOIL','C(1)'         				&& By Pramod 08/08/2011

DO ADDFIELD WITH 'MODEL','EDBRTORATE','N(10,2)'	          				&& By Pramod 14/07/2011
DO ADDFIELD WITH 'MODEL','ERTORATE','N(10,2)'	          				&& By Pramod 14/07/2011
DO ADDFIELD WITH 'MODEL','RTO_MODEL','C(254)'							&& By Pramod 14/07/2011
DO ADDFIELD WITH 'MODEL','RTOCLASCOD','I(4)'							&& By Pramod 14/07/2011
DO ADDFIELD WITH 'MODEL','RTOVEHITYP','C(10)'							&& By Pramod 14/07/2011

DO ADDFIELD WITH 'PARA','RTOTAXMODE','C(10)'							&& By Pramod 14/07/2011
DO ADDFIELD WITH 'PARA','RTOINSTYPE','I(4)'								&& By Pramod 14/07/2011

DO ADDFIELD WITH 'BOOKING','RTOREGITYP','C(10)'							&& By Pramod 14/07/2011
DO ADDFIELD WITH 'BOOKING','RTOOWNRTYP','I(4)'							&& By Pramod 14/07/2011
DO ADDFIELD WITH 'INS_COMP','RTOCODE','C(10)'							&& By Pramod 14/07/2011

DO ADDFIELD WITH 'JRECEIPT','OTHRADJ_AC','C(6)'							&& By Pramod 07/07/2011
DO ADDFIELD WITH 'JRECEIPT','OTHRADJAMT','N(10,2)'						&& By Pramod 07/07/2011

DO ADDFIELD WITH 'CLIENTINFO','RTOWEBFLAG','C(1)'						&& By Pramod 27/06/2011

DO ADDFIELD WITH 'HPAMAST','City','C(20)'								&& By Pramod 27/06/2011
DO ADDFIELD WITH 'HPAMAST','Pin','N(6)'									&& By Pramod 27/06/2011

DO ADDFIELD WITH 'MODEL','Healthins','N(10,2)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'MODEL','Access_Amt','N(10,2)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'MODEL','GoodLife1','N(10,2)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'MODEL','GoodLife3','N(10,2)'							&& By Pramod 27/06/2011

DO ADDFIELD WITH 'BOOKING','HPARTOFLG','c(1)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'BOOKING','ACCESRYFLG','c(1)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'BOOKING','PASSPRTFLG','c(1)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'BOOKING','HELTINSFLG','c(1)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'BOOKING','EXTWARRFLG','c(1)'							&& By Pramod 27/06/2011
DO ADDFIELD WITH 'BOOKING','HELTINSFLG','c(1)'							&& By Pramod 27/06/2011

DO ADDFIELD WITH 'BOOKING','CRTM_FLG','c(1)'							&& By Pramod 24/06/2011
DO ADDFIELD WITH 'BOOKING','OPTICALFLG','c(1)'							&& By Pramod 24/06/2011

DO ADDFIELD WITH 'HPARECPTBODY','LOAN_NO','C(15)'						&& By Pramod 01/07/2011

DO ADDFIELD WITH 'INSRENEWAL','POLICYNO','c(25)'						&& By Pramod 23/06/2011

DO ADDFIELD WITH 'PARA','RTOPROFIT','c(1)'								&& By Pramod 23/06/2011
DO ADDFIELD WITH 'PMCSCHEM','PMC_OILNO','c(20)'							&& By Pramod 19/06/2011
DO ADDFIELD WITH 'PMCSCHEM','REMIDAY1','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','REMIDAY2','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','REMIDAY3','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','REMIDAY4','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','REMIDAY5','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','REMIDAY6','N(3)'							&& By Pramod 18/06/2011

DO ADDFIELD WITH 'PMCSCHEM','BFREMIDAY1','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','BFREMIDAY2','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','BFREMIDAY3','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','BFREMIDAY4','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','BFREMIDAY5','N(3)'							&& By Pramod 18/06/2011
DO ADDFIELD WITH 'PMCSCHEM','BFREMIDAY6','N(3)'							&& By Pramod 18/06/2011

DO ADDFIELD WITH 'PMC_REGI','DUE1DT','D(8)'								&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','FOLOWUP1DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','CALL1DUEDT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','SRVDONE1DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','DUE2DT','D(8)'								&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','FOLOWUP2DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','CALL2DUEDT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','SRVDONE2DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','DUE3DT','D(8)'								&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','FOLOWUP3DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','CALL3DUEDT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','SRVDONE3DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','DUE4DT','D(8)'								&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','FOLOWUP4DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','CALL4DUEDT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','SRVDONE4DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','DUE5DT','D(8)'								&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','FOLOWUP5DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','CALL5DUEDT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','SRVDONE5DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','DUE6DT','D(8)'								&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','FOLOWUP6DT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','CALL6DUEDT','D(8)'							&& By Pramod 17/06/2011
DO ADDFIELD WITH 'PMC_REGI','SRVDONE6DT','D(8)'							&& By Pramod 17/06/2011

DO ADDFIELD WITH 'rtoInsurance','DealerFlg','c(1)'						&& By Priten 16/06/2011
DO ADDFIELD WITH 'para','dcLockDue','c(1)'								&& By Priten 15/06/2011
DO ADDFIELD WITH 'rtoInsurance','dealerAc','c(6)'						&& By Priten 12/06/2011
DO ADDFIELD WITH 'CLIENTINFO','FIN_MONTHS','N(3)'						&& By Pramod 04/06/2011
DO ADDFIELD WITH 'CLIENTINFO','DISBURSAMT','N(10,2)'					&& By Pramod 04/06/2011
DO ADDFIELD WITH 'CLIENTINFO','NPAYOUTAMT','N(10,2)'					&& By Pramod 03/06/2011
DO ADDFIELD WITH 'CLIENTINFO','NPAYOUTDUE','N(10,2)'					&& By Pramod 03/06/2011
DO ADDFIELD WITH 'CLIENTINFO','NHPANO','N(3)'							&& By Pramod 03/06/2011


***********************************************************************************************************

DO ADDFIELD WITH 'PARA','RTO_ACPOST','C(1)'		  	  	  	  			&& DT 12/03/11  BY PRAMOD
DO ADDFIELD WITH 'MODEL','RTODBL','N(9,2)' 	  			  				&& DT 06/03/11  BY PRAMOD
DO ADDFIELD WITH 'MODEL','RTODBLCUST','N(9,2)' 	  						&& DT 06/03/11  BY PRAMOD
DO ADDFIELD WITH 'MODEL','RTOSELENO','N(9,2)' 	  						&& DT 06/03/11  BY PRAMOD
DO ADDFIELD WITH 'MODEL','DCLOCKDAYS','N(3)' 	  						&& DT 06/03/11  BY PRAMOD

USE (path_nam) + 'TMP_PUR' IN 0 EXCLUSIVE 							
DO ADDFIELD WITH 'TMP_PUR','CYLINDERNO','C(15)'	  		  	        && DT 23/03/11 BY Pramod
DO ADDFIELD WITH 'TMP_PUR','KITNO','C(15)'	  		  	            && DT 23/03/11 BY Pramod
USE IN TMP_PUR


DO ADDFIELD WITH 'INSRENUALEXCEL','CHASISNO','C(20)'				&& By Pramod 23/05/2011

DO ADDFIELD WITH 'SALEMAST','DELIORDRNO','C(30)'				  	&& By Pramod 08/01/2011
DO ADDFIELD WITH 'SALEMAST','DELIORDRDT','D(8)'				  		&& By Pramod 08/01/2011


DO ADDFIELD WITH 'clientInfo','nOpfinCom','n(10,2)'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'clientInfo','nfinComAmt','n(10,2)'	  		  	&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'clientInfo','nfincomdue','n(10,2)'	  		  	&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'saleMast','iFinEntryNo','i'	  		  			&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'saleMast','nFinCommRt','n(10,2)'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'saleMast','nFinComAmt','n(10,2)'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','iEntryNo','i'	  		  			&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','comm_rt1','n(5,2)'	  		  	&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','comm_rt2','n(5,2)'	  		  	&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','comm_rt3','n(5,2)'	  		  	&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','comm_rt4','n(5,2)'	  		  	&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','comm_rt5','n(5,2)'	  		  	&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','frmMonth1','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','frmMonth2','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','frmMonth3','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','frmMonth4','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','frmMonth5','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','toMonth1','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','toMonth2','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','toMonth3','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','toMonth4','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'finCommission','toMonth5','i'	  		  		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'para','dcSeries','C(1)'	  		  	    		&& DT 26/04/11 BY Priten
DO ADDFIELD WITH 'PUR_BODY','CYLINDERNO','C(15)'	  		  	    && DT 17/03/11 BY SAGAR
DO ADDFIELD WITH 'PUR_BODY','KITNO','C(15)'	  		  	            && DT 17/03/11 BY SAGAR
DO ADDFIELD WITH 'VEHICLE','CYLINDERNO','C(15)'	  		  	        && DT 17/03/11 BY SAGAR
DO ADDFIELD WITH 'VEHICLE','KITNO','C(15)'	  		  	            && DT 17/03/11 BY SAGAR
DO ADDFIELD WITH 'SALEMAST','CYLINDERNO','C(15)'	  		  	    && DT 17/03/11 BY SAGAR
DO ADDFIELD WITH 'SALEMAST','KITNO','C(15)'	  		  	            && DT 17/03/11 BY SAGAR
DO ADDFIELD WITH 'BOOKING','OTHERADD','C(250)'	  		  			&& DT 16/03/11 BY pramod
DO ADDFIELD WITH 'CLIENT','OTHERADD','C(250)'	  		  			&& DT 16/03/11 BY pramod
DO ADDFIELD WITH 'BOOKING','GIFTINFO','C(50)'	 		  			&& DT 16/03/11 BY pramod

DO ADDFIELD WITH 'SALEMAST','SELE_FLG','C(1)'	  		  			&& DT 10/03/11 BY priten
DO ADDFIELD WITH 'outPutBreakUp','jobCard_No','c(7)'	  		  	&& DT 16/03/11 BY priten
DO ADDFIELD WITH 'outPutBreakUp','totLabour','N(10,2)'	  		  	&& DT 09/03/11 BY priten
DO ADDFIELD WITH 'outPutBreakUp','labtaxamt','N(10,2)'	  		  	&& DT 09/03/11 BY priten

DO ADDFIELD WITH 'LEDGER','MBALANCE','N(12,2)'	  		  	  	  	&& DT 03/03/11 BY PRAMOD
DO ADDFIELD WITH 'LEDGER','MDBBALANCE','N(12,2)'	 	  	  	  	&& DT 03/03/11 BY PRAMOD
DO ADDFIELD WITH 'LEDGER','MCRBALANCE','N(12,2)'	 	  	  	  	&& DT 03/03/11 BY PRAMOD
DO ADDFIELD WITH 'LEDGER','MOPBALANCE','N(12,2)'	 	  	  	  	&& DT 03/03/11 BY PRAMOD
DO ADDFIELD WITH 'MODEL','NETWCOMITN','N(10,2)'	  		  	  	  	&& DT 03/03/11 BY PRAMOD

IF FSIZE('invType','it_pur') = 0  									&& DT 24/02/2011 BY PRiten
	DO ADDFIELD WITH 'it_pur','invType','C(10)'			
	UPDATE it_pur SET invtype = IIF(st_amt > 0,"TAX","RETAIL") 
ENDIF 

***********************************************************
********** REMOVE LONG FIELD NAME IN PARA TABLE  ********** 
***********************************************************

IF FSIZE('VOUCHRNOTY','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','VOUCHRNOTY','C(12)'			
	SELECT PARA
	REPLACE ALL VOUCHRNOTY WITH VOUCHERNOTYPE IN PARA
	ALTER TABLE PARA DROP COLUMN VOUCHERNOTYPE
ENDIF
IF FSIZE('NEGTIVSTOK','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','NEGTIVSTOK','C(1)'			
	SELECT PARA
	REPLACE ALL NEGTIVSTOK WITH NEGATIVE_STOCK_FLG IN PARA
	ALTER TABLE PARA DROP COLUMN NEGATIVE_STOCK_FLG
ENDIF
IF FSIZE('POSTSRVTAX','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','POSTSRVTAX','C(1)'			
	SELECT PARA
	REPLACE ALL POSTSRVTAX WITH POSTINGSERVETAXFLG IN PARA
	ALTER TABLE PARA DROP COLUMN POSTINGSERVETAXFLG
ENDIF
IF FSIZE('DELIGATPAS','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','DELIGATPAS','C(1)'			
	SELECT PARA
	REPLACE ALL DELIGATPAS WITH DELIVERYBYGATEPASS IN PARA
	ALTER TABLE PARA DROP COLUMN DELIVERYBYGATEPASS
ENDIF
IF FSIZE('ITSEPRATOR','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','ITSEPRATOR','C(3)'			
	SELECT PARA
	REPLACE ALL ITSEPRATOR WITH ITEMSEPERATOR IN PARA
	ALTER TABLE PARA DROP COLUMN ITEMSEPERATOR
ENDIF
IF FSIZE('BRKCOMMSP','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','BRKCOMMSP','C(10)'			
	SELECT PARA
	REPLACE ALL BRKCOMMSP WITH BRKCOMM_S_P IN PARA
	ALTER TABLE PARA DROP COLUMN BRKCOMM_S_P
ENDIF
IF FSIZE('WARINJBBIL','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','WARINJBBIL','C(1)'			
	SELECT PARA
	REPLACE ALL WARINJBBIL WITH WARRANTYINJOBBILL IN PARA
	ALTER TABLE PARA DROP COLUMN WARRANTYINJOBBILL
ENDIF
IF FSIZE('PRINTERNAM','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','PRINTERNAM','C(30)'			
	SELECT PARA
	REPLACE ALL PRINTERNAM WITH PRINTERNAME IN PARA
	ALTER TABLE PARA DROP COLUMN PRINTERNAME
ENDIF
IF FSIZE('POSTSOURCE','PARA') = 0  									&& DT  24/01/2011  BY PRAMOD
	DO ADDFIELD WITH 'PARA','POSTSOURCE','C(10)'			
	SELECT PARA
	REPLACE ALL POSTSOURCE WITH POSTINGSOURCE IN PARA
	ALTER TABLE PARA DROP COLUMN POSTINGSOURCE
ENDIF
***********************************************************

DO ADDFIELD WITH 'ITEMMAST','LASTISUEDT','D(8)'		  	  	  	  	&& DT 27/12/10  BY PRAMOD
DO ADDFIELD WITH 'PARA','JBILLNOTYP','C(10)'		  	  	  	  	&& DT 19/02/10  BY PRITEN

IF FSIZE('PrevDc','booking') = 0
	DO ADDFIELD WITH 'booking','PrevDc','C(1)'		  	  	  	  	&& DT 19/02/10  BY PRiten
	SELECT booking
	REPLACE ALL booking.PrevDc WITH 'Y' FOR prevBill = 'Y'
ENDIF

ALTER TABLE PARA ALTER COLUMN SRNAME C(50)                          && DT. 11/11/2010  Pramod 

IF FSIZE("taxableCst","it_pur") = 0										&& By Priten 13/12/10
	DO ADDFIELD WITH 'it_Pur','taxableCst','N(10,2)'					
	UPDATE it_pur set taxableCst = cst_amt*100/cst_rt ;
		WHERE ! EMPTY(cst_rt)
ENDIF 
IF FSIZE("taxable4","it_pur") = 0										&& By Priten 13/12/10
	DO ADDFIELD WITH 'it_Pur','taxable4','N(10,2)'					
	UPDATE it_pur set taxable4 = st_amt*100/st_rt ;
		WHERE st_rt = 4.00
ENDIF 
IF FSIZE("taxable125","it_pur") = 0										&& By Priten 13/12/10
	DO ADDFIELD WITH 'it_Pur','taxable125','N(10,2)'					
	UPDATE it_pur set taxable125 = st_amt*100/st_rt ;
		WHERE st_rt = 12.50
ENDIF 
IF FSIZE("taxable15","it_pur") = 0										&& By Priten 13/12/10
	DO ADDFIELD WITH 'it_Pur','taxable15','N(10,2)'					
	UPDATE it_pur set taxable15 = st_amt*100/st_rt ;
		WHERE st_rt = 15.00
ENDIF 
DO ADDFIELD WITH 'itPurBod','itVatRt','N(5,2)'					  		&& By Priten 9/12/10
DO ADDFIELD WITH 'itPurBod','itAVatRt','N(5,2)'					  		&& By Priten 9/12/10
DO ADDFIELD WITH 'itPurBod','itVatAmt','N(10,2)'					  	&& By Priten 9/12/10
DO ADDFIELD WITH 'itPurBod','itAVatAmt','N(10,2)'					  	&& By Priten 9/12/10

IF FSIZE('taxOn','it_pur') = 0		&& DT 26/09/10  BY PRiten
	DO ADDFIELD WITH 'it_pur','taxOn','c(15)' 	 	        
	UPDATE it_pur set taxOn = "GROSS AMT + VAT" 
ENDIF 
IF FSIZE('vat4amt','it_pur') = 0		&& DT 26/09/10  BY PRiten
	DO ADDFIELD WITH 'it_pur','vat4Amt','n(10,2)' 	 	        
	DO ADDFIELD WITH 'it_pur','aVat4Amt','n(10,2)' 	 	        
	UPDATE it_pur set vat4Amt = st_amt , Avat4Amt = avat_amt ;
		WHERE st_rt = 4 
ENDIF
IF FSIZE('vat125amt','it_pur') = 0		&& DT 26/09/10  BY PRiten
	DO ADDFIELD WITH 'it_pur','vat125Amt','n(10,2)' 	 	        
	DO ADDFIELD WITH 'it_pur','avat125Amt','n(10,2)' 	 	        
	UPDATE it_pur set vat125Amt = st_amt , Avat125Amt = avat_amt ;
		WHERE st_rt = 12.5
ENDIF
IF FSIZE('vat15amt','it_pur') = 0		&& DT 26/09/10  BY PRiten
	DO ADDFIELD WITH 'it_pur','vat15Amt','n(10,2)' 	 	        
	DO ADDFIELD WITH 'it_pur','avat15Amt','n(10,2)' 	 	        
	UPDATE it_pur set vat15Amt = st_amt , Avat15Amt = avat_amt ;
		WHERE st_rt = 15
ENDIF
IF FSIZE('vat4amt','it_pur') = 0		&& DT 26/09/10  BY PRiten
	DO ADDFIELD WITH 'it_pur','vat4Amt','n(10,2)' 	 	        
	DO ADDFIELD WITH 'it_pur','vat125Amt','n(10,2)' 	 	        
	UPDATE it_pur set vat4Amt = st_amt , Avat4Amt = avat_amt ;
		WHERE st_rt = 4 
ENDIF
DO ADDFIELD WITH 'BROKERPURCHASE','HEALTHINS','n(8,2)' 	 	        && DT. 11/11/2010  Pramod
DO ADDFIELD WITH 'vehicletrnbody','rate','n(10,2)' 	 	            && DT. 01/11/2010  Printen
DO ADDFIELD WITH 'pur_body','vehFreight','n(9,2)' 	 	            && DT. 01/11/2010  Printen
DO ADDFIELD WITH 'para','recptnotyp','c(10)' 	 	            	&& DT. 01/11/2010  Printen
USE (path_nam) + 'TMP_pur' IN 0 EXCLUSIVE 							&& DT. 01/11/2010  Printen
DO ADDFIELD WITH 'TMP_pur','vehFreight','n(9,2)' 	 	            && DT. 01/11/2010  Printen
USE IN tmp_pur

USE (MPROG_PATH) + "INFO.SYS" IN 0 alia password EXCLUSIVE 
DO ADDFIELD WITH 'PASSWORD','maxDiscRs','n(6)' 	 	            	&& DT. 19/03/2011
DO ADDFIELD WITH 'PASSWORD','VSDCENTRY','C(1)' 	 	            	&& DT. 12/10/2010
DO ADDFIELD WITH 'PASSWORD','sLetrDueFl','C(1)' 	 	            && DT. 12/10/2010

USE IN PASSWORD

ALTER TABLE HISTORY ALTER COLUMN doc_no C(11)	                    && DT 20/11/10  BY PRAMOD

DO ADDFIELD WITH 'PUR_MAST','OTBEFPERC','N(7,3)' 	  	 			&& DT 12/10/10  BY PRAMOD
DO ADDFIELD WITH 'MODEL','SMANCOMITN','N(10,2)' 	  	 			&& DT 12/10/10  BY PRAMOD
DO ADDFIELD WITH 'SALEMAST','SMANCOMITN','N(10,2)' 	  	 			&& DT 12/10/10  BY PRAMOD


IF FSIZE('L_R_NO','PUR_MAST') < 25				        			&& DT 26/09/10  BY PRAMOD
	ALTER TABLE PUR_MAST ALTER COLUMN L_R_NO C(25)			
ENDIF
DO ADDFIELD WITH 'PUR_MAST','FRGHTWOVAT','N(10,2)' 	  	 			&& DT 26/09/10  BY PRAMOD
DO ADDFIELD WITH 'ESTIMATE','ESTI_TYP','C(15)' 	  	 	 			&& DT 26/09/10  BY PRAMOD

DO ADDFIELD WITH 'veh_pr','supplier_n','c(6)'				  		  && By Priten 25/09/10
DO ADDFIELD WITH 'veh_pr','pr_no','c(6)'				  			  && By Priten 25/09/10
DO ADDFIELD WITH 'brokerpurchase','exwaramt','n(10,3)'				  && By Priten 17/07/10
DO ADDFIELD WITH 'itemMast','abcCat','c(1)'					  		  && By Priten 15/07/10
DO ADDFIELD WITH 'area','zoneId','i'					  			  && By Priten 06/07/10
DO ADDFIELD WITH 'ledger','p_l_ac_bal','n(10,2)'					  && By Priten 25/05/10
DO ADDFIELD WITH 'RTOINSURANCE','OP','n(10,2)'						  && By Pramod 29/4/10
DO ADDFIELD WITH 'RTOINSBODY','OR','n(10,2)'						  && By Pramod 29/4/10

IF FSIZE('exwarAmt','clientinfo') = 0								  && By Priten 17/5/10
	DO ADDFIELD WITH 'clientInfo','exWarAmt','n(10,2)'
	SELECT salemast
	SCAN FOR ! empt(exwarAmt)
		IF SEEK(client_no,'clientInfo','client_no')
			REPLACE clientInfo.exWarAmt WITH salemast.exWarAmt ;
				clientInfo.exWarYr WITH salemast.exWarYr
		ELSE 
			INSERT INTO clientInfo ;
				(client_no,exwaryr,exwarAmt) ;
			VALUES ;
				(salemast.client_no,salemast.exWarYr,salemast.exWarAmt)
		ENDIF
	ENDSCAN 
ENDIF

USE (PATH_NAM) + 'TMPISSUE' IN 0 EXCLUSIVE 
DO ADDFIELD WITH 'TMPISSUE','itVatRt','N(5,2)'					  		&& By Priten 9/12/10
DO ADDFIELD WITH 'TMPISSUE','itAVatRt','N(5,2)'					  		&& By Priten 9/12/10
DO ADDFIELD WITH 'TMPISSUE','itVatAmt','N(10,2)'					  	&& By Priten 9/12/10
DO ADDFIELD WITH 'TMPISSUE','itAVatAmt','N(10,2)'					  	&& By Priten 9/12/10
USE IN TMPISSUE

DO ADDFIELD WITH 'SALEMAST','EXFACTORY','N(10,2)'						&& DT 23/09/10  BY Hitesh

DO ADDFIELD WITH 'CSI_INS','POLICY_NO','C(25)'		  	  	  		 	&& DT 16/02/10  BY PRiten
DO ADDFIELD WITH 'CSI_INS','COVRNOTNO','C(25)'		  	  	  		 	&& DT 16/02/10  BY PRiten
DO ADDFIELD WITH 'CSI_INS','INS_AMT','N(7)'			  	  	  		 	&& DT 16/02/10  BY PRiten
DO ADDFIELD WITH 'CSI_INS','INSRECPTDT','D(8)'			  	  	  	  	&& DT 16/02/10  BY PRiten
DO ADDFIELD WITH 'CSI_INS','ENGINE_NO','C(20)'			  	  	  	  	&& DT 16/02/10  BY PRiten


DO ADDFIELD WITH 'RTOINSBODY','WARENTRYNO','c(25)'					  && By Priten 17/5/10
DO ADDFIELD WITH 'RTOINSBODY','exwarcust','N(9,2)'					  && By Priten 17/5/10
DO ADDFIELD WITH 'RTOINSBODY','exwarpay','N(9,2)'					  && By Priten 17/5/10

DO ADDFIELD WITH 'CLIENTINFO','Exwardocno','c(10)'					  && By Priten 17/5/10
DO ADDFIELD WITH 'CLIENTINFO','Exwardocdt','d(8)'					  && By Priten 17/5/10
DO ADDFIELD WITH 'model','ExWar1Cust','n(9,2)'					  	  && By Priten 17/5/10
DO ADDFIELD WITH 'model','ExWar1Cust','n(9,2)'					  	  && By Priten 17/5/10
DO ADDFIELD WITH 'model','ExWar2Cust','n(9,2)'					  	  && By Priten 17/5/10
DO ADDFIELD WITH 'model','ExWar3Cust','n(9,2)'					  	  && By Priten 17/5/10
DO ADDFIELD WITH 'model','ExWar1Pay','n(9,2)'					  	  && By Priten 17/5/10
DO ADDFIELD WITH 'model','ExWar2Pay','n(9,2)'					  	  && By Priten 17/5/10
DO ADDFIELD WITH 'model','ExWar3Pay','n(9,2)'					  	  && By Priten 17/5/10
DO ADDFIELD WITH 'model','roadtaxpay','n(10,2)' 						&& By Hitesh 25/11/2010

DO ADDFIELD WITH 'pmcRecpt','ServTaxAmt','n(9,2)'					  && By Priten 26/4/10
DO ADDFIELD WITH 'pmcRecpt','ServTaxRt','n(5,2)'					  && By Priten 26/4/10
DO ADDFIELD WITH 'para','pmcmrtxble','c(1)'							  && By Priten 26/4/10
DO ADDFIELD WITH 'BROKERPURCHASE','ID_NO','c(8)'		  	  	  	  && DT 12/04/10  BY PRAMOD  
DO ADDFIELD WITH 'job_mast','driverName','c(30)'		  	  	  	  && DT 16/03/10  BY PRiten
DO ADDFIELD WITH 'booking','coatingFlg','c(1)'		  	  	  	  	  && DT 16/03/10  BY PRiten
DO ADDFIELD WITH 'booking','coatingAmt','n(9,2)'		  	  	  	  && DT 16/03/10  BY PRiten
DO ADDFIELD WITH 'saleMast','coatingFlg','c(1)'		  	  	  	  	  && DT 16/03/10  BY PRiten
DO ADDFIELD WITH 'saleMast','coatingAmt','n(9,2)'		  	  	  	  && DT 16/03/10  BY PRiten
DO ADDFIELD WITH 'clientInfo','ExWarYr','I(1)'		  	  	  	  	  && DT 19/02/10  BY PRiten
DO ADDFIELD WITH 'salemast','ExWarAmt','N(9,2)'		  	  	  	  	  && DT 19/02/10  BY PRiten
DO ADDFIELD WITH 'salemast','ExWarYr','I(1)'		  	  	  	  	  && DT 19/02/10  BY PRiten
DO ADDFIELD WITH 'clientInfo','pmcOpDepo','N(9,2)'		  	  	  	  && DT 01/03/10  BY PRiten
DO ADDFIELD WITH 'booking','ExWarAmt','N(9,2)'		  	  	  	  	  && DT 19/02/10  BY PRiten
DO ADDFIELD WITH 'booking','ExWarYr','I(1)'		  	  	  	  	  	  && DT 19/02/10  BY PRiten

IF FSIZE('pmcDue','clientinfo') = 0
	DO ADDFIELD WITH 'clientinfo','pmcDue','N(9,2)'		  		  	  && DT 16/02/10  BY PRiten
	SELECT client
	SCAN FOR ! EMPTY(amt_remain) AND client.status = 'P'
		IF SEEK(client_no,'clientinfo','client_no')
			REPLACE clientinfo.pmcDue WITH client.amt_remain
		ELSE 
			INSERT INTO clientinfo ;
				(client_no,pmcdue) ;
			VALUES ;
				(client.client_no,client.amt_remain)
		ENDIF 
	ENDSCAN 
ENDIF
IF FSIZE('PmcDeposit','clientinfo') = 0
	DO ADDFIELD WITH 'clientinfo','PmcDeposit','N(9,2)'		  	  	  	  && DT 16/02/10  BY PRiten
	SELECT client
	PRIVATE lnPmcDepo
	SCAN FOR ! EMPTY(pmc_ac)
		lnPmcDepo = 0.00
		IF SEEK(client.pmc_ac,'ledger','account_no')
			lnPmcDepo = IIF(ledger.a_l_flg = 'A',-1,1)*ledger.balance
		ENDIF
		IF SEEK(client_no,'clientinfo','client_no')
			REPLACE clientinfo.PmcDeposit WITH lnPmcDepo
		ELSE
			INSERT INTO clientinfo ;
				(client_no,PmcDeposit) ;
			VALUES ;
				(client.client_no,lnPmcDepo)
		ENDIF 
	ENDSCAN 
ENDIF

IF FSIZE('TOT_ADJUSTED','HPARECPT') > 0				    && DT 19/03/2010  BY PRAMOD
	do ADDFIELD WITH 'HPARECPT','TOT_ADJUST','N(9,2)'   && DT 19/03/2010  BY PRAMOD
	REPLACE ALL TOT_ADJUST WITH TOT_ADJUSTED IN HPARECPT
	ALTER TABLE HPARECPT DROP COLUMN TOT_ADJUSTED
ENDIF

DO ADDFIELD WITH 'clientinfo','pmcOpDue','N(9,2)'	  		  	  	  && DT 16/02/10  BY PRiten
DO ADDFIELD WITH 'pmc_tran','source','C(10)' 		  		  	  	  && DT 16/02/10  BY PRiten
DO ADDFIELD WITH 'PARA','PMCAUTONUM','C(1)' 		  		  	  	  && DT 12/02/10  BY PRAMOD
DO ADDFIELD WITH 'JOB_MAST','ADVPMCSEQ','C(2)' 		  		  	  	  && DT 31/12/09  BY PRAMOD
DO ADDFIELD WITH 'CLIENTINFO','LSTADVPMC','N(2)' 	  		  		  && DT 31/12/09  BY PRAMOD
DO ADDFIELD WITH 'CLIENTINFO','TOTADVPMC','N(2)' 	  		  		  && DT 31/12/09  BY PRAMOD

DO ADDFIELD WITH 'PARA','VPTR_POST','c(1)' 	  		  		  	  	  && DT 21/12/09  BY Pramod
DO ADDFIELD WITH 'HPAMAST','SELE_FLG','c(1)' 	  		  		  	  && DT 12/12/09  BY Pramod
DO ADDFIELD WITH 'RTOINSBODY','RTO_REGID','c(10)' 	  		  		  && DT 03/12/09  BY Pramod

DO ADDFIELD WITH 'clientinfo','rtoRemark','c(20)' 	  		  		  && DT 01/12/09  BY PRiten
DO ADDFIELD WITH 'clientinfo','rcIssuedTo','c(20)' 	  		  		  && DT 01/12/09  BY PRiten
DO ADDFIELD WITH 'clientinfo','rcIsuProof','c(20)' 	  		  		  && DT 01/12/09  BY PRiten
DO ADDFIELD WITH 'clientinfo','rcIsuEntry','c(10)' 	  		  		  && DT 01/12/09  BY PRiten
DO ADDFIELD WITH 'MODEL','freemonths','n(2)' 	  		  			  && DT 07/11/09  BY PRiten
DO ADDFIELD WITH 'CLIENT','category','C(10)' 	  		  			  && DT 07/11/09  BY PRiten
DO ADDFIELD WITH 'BROKERPURCHASE','ServebookNo','C(10)' 	  		  && DT 07/11/09  BY PRiten
DO ADDFIELD WITH 'BROKERPURCHASE','key_No','C(10)' 	  		  		  && DT 07/11/09  BY PRiten
DO ADDFIELD WITH 'BROKERPURCHASE','passportRs','n(10,2)' 	  		  && DT 07/11/09  BY PRiten

DO upgrade_II			&& By Priten on 01/03/10  as program too long

CLOSE DATABASES ALL
DO auto_cdx
IF ! OPENFILE(.F.)
	DO ERR_MSG WITH 'THERE WAS PROBLEM IN OPENING DATA FILES' + CHR(13) + 'TRY AGAIN' + CHR(13) + 'IF PROBLEM PERSIST CONTACT YOUR DATABASE ADMINISTRATOR OR VENDOR'
	QUIT
ENDIF
gcUpgradeFlg = 'N'
DO OK_MSG WITH 'DATA STRUCTURE UPDATION COMPLETED'
DO CLS_MENU 

PROCEDURE updItemGodownBal

PARAMETERS pcGodownNo

PRIVATE lcFieldName,lcFldExpression
lcFieldName = 'g' + pcGodownNo + 'bal'
lcFldExpression = 'itemMast.g' + pcGodownNo + 'bal'
IF FSIZE((lcFieldName),'itemMast') = 0
	DO addField WITH 'itemMast',lcFieldName,'n(10,3)'
	IF SEEK(pcGodownNo,'godown','godown_no')
		SELECT godown_i
		SCAN FOR godown_no = pcGodownNo
			IF SEEK(item_no,'itemMast','item_no')
				DO CASE 
					CASE pcGodownNo = '01'
						REPLACE itemMast.g01Bal WITH balance
					CASE pcGodownNo = '02'
						REPLACE itemMast.g02Bal WITH balance
					CASE pcGodownNo = '03'
						REPLACE itemMast.g03Bal WITH balance
					CASE pcGodownNo = '04'
						REPLACE itemMast.g04Bal WITH balance
					CASE pcGodownNo = '05'
						REPLACE itemMast.g05Bal WITH balance
					CASE pcGodownNo = '06'
						REPLACE itemMast.g06Bal WITH balance
					CASE pcGodownNo = '07'
						REPLACE itemMast.g07Bal WITH balance
					CASE pcGodownNo = '08'
						REPLACE itemMast.g08Bal WITH balance
					CASE pcGodownNo = '09'
						REPLACE itemMast.g09Bal WITH balance
					CASE pcGodownNo = '10'
						REPLACE itemMast.g10Bal WITH balance
				ENDCASE
			ENDIF
		ENDSCAN
	ENDIF
ENDIF