private lnsalregi,lnsaltran,lnsalbal,lnsalcli
private lnrecregi,lnrectran,lnreccli
private lncanrregi,lncanrtran,lncanrcli
private lnchqrregi,lnchqrtran,lnchqrcli
private lnpurregi,lnpurtran,lnpurbal
private lnsparregi,lnspartran,lnsparbal
private lnoilregi,lnoiltran,lnoilbal
private lnlabrregi,lnlabrtran,lnlabrbal
private lnspoiregi,lnspoitran,lnspoibal

=get_pupto('Check Transaction info','UPTO DATE : ',.F.)

******Vehicle sales

sele salemast
sum(bill_amt) to lnsalregi

lnsalbal= get_opbal(mvsales_ac,upto_date+1)

sele transect
sum(amount) to lnsaltran for source = 'VS'

sele transect
sum(amount) to lnsalcli for source = 'VS' AND account1 = mclient_ac

******Showroom Receipts

sele receipt
sum(amount) to lnrecregi

sele transect
sum(amount) to lnrectran for source = 'SR'

sele transect
sum(amount) to lnreccli for source = 'SR' AND account2 = mclient_ac

******Cancled Receipts

sele receipt
sum(amount) to lncanrregi for return_flg = 'C'

sele transect
sum(amount) to lncanrtran for source = 'RC'

sele transect
sum(amount) to lncanrcli for source = 'RC' AND account1 = mclient_ac


******Cheque Returned

sele receipt
sum(amount) to lnchqrregi for return_flg = 'Y'

sele transect
sum(amount) to lnchqrtran for source = 'CR'

sele transect
sum(amount) to lnchqrcli for source = 'CR' AND account1 = mclient_ac



******Vehicle Purchase

sele pur_mast
sum(bill_amt) to lnpurregi

lnpurbal= get_opbal(mvpur_ac,upto_date+1)

sele transect
sum(amount) to lnpurtran for source = 'VP'


**********WORKSHOP***********
**********Spares Sales

sele job_mast
sum(tot_spares-sparedisc) to lnsparregi

lnsparbal= get_opbal(gcspare_ac,upto_date+1)

sele transect
sum(amount) to lnspartran for source = 'JDL' AND account2= gcspare_ac

**********Oil Sales

sele job_mast
sum(tot_oil) to lnoilregi

lnoilbal= get_opbal(gcoil_ac,upto_date+1)

sele transect
sum(amount) to lnoiltran for source = 'JBL' AND account2= gcoil_ac

**********Spares+oil purchase

sele it_pur
sum(bill_amt) to lnspoiregi for pur_typ = 'LOCAL'

lnspoibal= get_opbal(mspur_ac,upto_date+1)

sele transect
sum(amount) to lnspoitran for source = 'SP' AND account1= mspur_ac


**********Labour income

sele job_mast
sum(tot_labour-labourdisc+labtaxamt) to lnlabrregi

lnlabrbal= get_opbal(gclabour_ac,upto_date+1)

sele transect
sum(amount) to lnlabrtran for source = 'JBL' AND account2= gclabour_ac

*do prinrepo with 'WCHECK','CHECK','','',1,.F.
do prinrepo with 'WCHECK','CHECK','',''
