HHCOC-47 Improved the sorting by reference functionality. Added new reference_no_ssort field