Fix SQL errors when searching sales log page
Merge pull request #762 from leewillis77/issue_510

Fix SQL errors when searching sales log page