** END HEADER -- do not remove this line // // Generated on 25.02.2017 // class a_ledgerDATAMODULE of DATAMODULE this.ledger = new ADOQUERY(this) with (this.ledger) left = 291.0 top = 22.0 database = mcompany.adodb // sql = 'Select *,month(ddate) mmonth from d_ledger where ddate between :fr_date AND :to_date order by ddate,recno' sql = 'select recno , ddate , month(ddate) mmonth,ac_name , dr , cr , if(runn_bal >0, "Cr","Dr") Bal_type , abs(runn_bal) balance,narration , jour_vouch,receipt from (SELECT recno, ddate , Ac_name , dr , cr, sum(cr-dr) over (order by ddate,jour_vouch,recno rows BETWEEN unbounded preceding and current ROW) runn_bal,narration , jour_vouch,receipt FROM d_ledger) as calc_ledger where ddate between :fr_date AND :to_date ' params["fr_date"].value=dtos(mcompany.byear) params["to_date"].value=dtos(mcompany.lyear) requestlive = false active = true endwith this.ledger2 = new ADOQUERY(this) with (this.ledger2) left = 291.0 top = 22.0 database = mcompany.adodb sql = 'Select * from d_ledger order by ddate,recno' requestlive = false active = true endwith this.ldate = new ADOQUERY(this) with (this.ldate) left = 291.0 top = 22.0 database = mcompany.adodb sql = 'SELECT max(ddate) m_ddate from (select ddate from day'+mcompany.fyear +' union select ddate from jour'+mcompany.fyear +') transxx' // SELECT max(ddate) m_ddate from (select ddate from day19 union select ddate from jour19) transxx requestlive = false active = true endwith endclass