adding sql and orm for x-out report.
some tests added