Issue #20845 - fixed the update query (haxTuple)

- fixed the update query to use the NEW value in the WHERE clause.  The OLD value was causing data integrity issues with UOM values.
The OLD value was driving the join with the item table.  This resulted in the wrong uom_id.
EXAMPLE: The OLD value is HOTEL, and has EA for a UOM.  The NEW value is PROFSVCS and has a UOM of HRS.  
The OLD value was driving EA to the uom.
-- AND (teitem_item_id=item_id))
#20367 - scope issue with qry

Blank page was happening on view/edit from Time/Expense History report
Merge pull request #7 from szuke/master

Issue #20845 - fixed the update query (haxTuple)