** END HEADER -- do not remove this line // // Generated on 07.03.2017 // class salesDATAMODULE of DATAMODULE this.SALES = new ADOQUERY(this) with (this.SALES) database = mcompany.adodb // Select sales.*, rate*qty-misc as amount,inve.full from sales19 sales inner join inve19 inve on sales.mast = inve.recno where invoice_no = 5 AND locat = "0" AND mast <>-1 // sql = 'Select sales.*, rate*qty-misc as amount from sales'+mcompany.fyear + ' sales WHERE invoice_no = :invoice AND locat = :location AND mast <>-1' sql = 'Select sales.*, rate*qty-misc as amount,inve.full full from sales'+mcompany.fyear + ' sales inner join inve'+mcompany.fyear+' inve on sales.mast = inve.recno WHERE invoice_no = :invoice AND locat = :location AND mast <>-1' params["invoice"].value=0 params["location"].value="0" requestLive = false active = true endwith this.disco = new ADOQUERY(this) with (this.disco) database = mcompany.adodb sql = 'Select * from sales'+mcompany.fyear + ' WHERE invoice_no = :invoice AND locat = :location AND mast = -1' params["invoice"].value=0 params["location"].value="0" requestLive = false active = true endwith this.pSALE = new ADOQUERY(this) with (this.pSALE) database = mcompany.adodb sql = 'Select tax , adtax , hsn_code, sum(cgst) as tcgst , sum(sgst) as tsgst , sum(goods) as tgoods from sales'+mcompany.fyear + ' WHERE invoice_no = :invoice AND locat = :location AND mast <>0 group by tax,adtax,hsn_code' params["invoice"].value=0 params["location"].value="0" requestLive = false active = true endwith this.last = new ADOQUERY(this) with (this.last) database = mcompany.adodb sql = 'Select max(invoice_no) as numb from sales'+mcompany.fyear + ' WHERE locat = :location AND mast <>0' params["location"].value="0" requestLive = false active = true endwith this.date_r = new ADOQUERY(this) with (this.date_r) database = mcompany.adodb sql = 'Select distinct invoice_no , ddate from sales'+mcompany.fyear + ' WHERE locat = :location AND invoice_no between :inv_fr and :inv_to order by invoice_no' params["location"].value="0" params["inv_fr"].value=0 params["inv_to"].value=0 requestLive = false active = true endwith endclass