various sql views
more work on salesinvoice generation