Fixed link bugs in sales order entry and optimized a couple of functions in ui_contro...