issue #23878 - merge bankrec functions

The functions have been merged and a test added. There are a number of commented-out TODO lines in the test which would fail if uncommented. They might represent misunderstandings of the desired gltrans and tax history behavior. @garyhgohoos should review the test before this PR is merged to figure out whether the test or the function should be changed.
cleaner and more maintainable, IMO, is to use array joins. e.g.
```js
var query = [
  'select a,b,c',
  'from x,y,z',
    'where x.foo=1',
    'and y.bar=2'
].join(' ');
```