Just for completeness, the original series of transactions that demonstrated this as a bug to me:
15405196 2015-09-28 13:17:33.537193+01 settled Instant withdrawal from Quick Access Account (5) 5.642510203
15405197 2015-09-28 13:17:33.537193+01 settled Purchase loan part 13416669 (old id 13385532) for 14.7062499894883063445000000000000000000000 GBP with a 1% Discount (14.5591874895934232810550000000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -14.55918749
15405517 2015-09-28 13:25:47.82723+01 settled Instant withdrawal from Quick Access Account (5) 0.289727831
15405518 2015-09-28 13:25:47.82723+01 settled Purchase loan part 13416865 (old id 13416671) for 0.2926543747908172962500000000000000000000 GBP with a 1% Discount (0.2897278310429091232875000000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -0.289727831
15405715 2015-09-28 13:33:29.537822+01 settled Instant withdrawal from Quick Access Account (5) 0.005765584
15405716 2015-09-28 13:33:29.537822+01 settled Purchase loan part 13416974 (old id 13416866) for 0.0058238220583372642500000000000000000000 GBP with a 1% Discount (0.0057655838377538916075000000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -0.005765584
15405959 2015-09-28 13:37:07.31981+01 settled Instant withdrawal from Quick Access Account (5) 0.000114735
15405960 2015-09-28 13:37:07.31981+01 settled Purchase loan part 13417069 (old id 13416975) for 0.0001158940589609114630000000000000000000 GBP with a 1% Discount (0.0001147351183713023483700000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -0.000114735
15405989 2015-09-28 13:46:19.435466+01 settled Instant withdrawal from Quick Access Account (5) 2.28323E-06
15405990 2015-09-28 13:46:19.435466+01 settled Purchase loan part 13417075 (old id 13417070) for 0.0000023062917733221366000000000000000000 GBP with a 1% Discount (0.0000022832288555889152340000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -2.28323E-06
15406004 2015-09-28 13:50:55.011002+01 settled Instant withdrawal from Quick Access Account (5) 4.54363E-08
15406005 2015-09-28 13:50:55.011002+01 settled Purchase loan part 13417078 (old id 13417076) for 0.0000000458952062891058000000000000000000 GBP with a 1% Discount (0.0000000454362542262147420000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -4.54363E-08
15406014 2015-09-28 13:58:43.467619+01 settled Instant withdrawal from Quick Access Account (5) 9.04181E-10
15406015 2015-09-28 13:58:43.467619+01 settled Purchase loan part 13417084 (old id 13417079) for 0.0000000009133146051579000000000000000000 GBP with a 1% Discount (0.0000000009041814591063210000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -9.04181E-10
15406242 2015-09-28 14:02:28.974719+01 settled Instant withdrawal from Quick Access Account (5) 1.79932E-11
15406243 2015-09-28 14:02:28.974719+01 settled Purchase loan part 13417234 (old id 13417085) for 0.0000000000181749606390000000000000000000 GBP with a 1% Discount (0.0000000000179932110326100000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -1.79932E-11
15406327 2015-09-28 14:11:38.710866+01 settled Instant withdrawal from Quick Access Account (5) 3.58065E-13
15406328 2015-09-28 14:11:38.710866+01 settled Purchase loan part 13417262 (old id 13417235) for 0.0000000000003616817193000000000000000000 GBP with a 1% Discount (0.0000000000003580649021070000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -3.58065E-13
15406340 2015-09-28 14:17:17.629231+01 settled Instant withdrawal from Quick Access Account (5) 7.12549E-15
15406341 2015-09-28 14:17:17.629231+01 settled Purchase loan part 13417270 (old id 13417263) for 0.0000000000000071974683000000000000000000 GBP with a 1% Discount (0.0000000000000071254936170000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -7.12549E-15
15406349 2015-09-28 14:23:50.155206+01 settled Instant withdrawal from Quick Access Account (5) 1.418E-16
15406350 2015-09-28 14:23:50.155206+01 settled Purchase loan part 13417273 (old id 13417271) for 0.0000000000000001432332000000000000000000 GBP with a 1% Discount (0.0000000000000001418008680000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -1.418E-16
15406562 2015-09-28 14:26:37.975582+01 settled Instant withdrawal from Quick Access Account (5) 2.82E-18
15406563 2015-09-28 14:26:37.975582+01 settled Purchase loan part 13417401 (old id 13417274) for 0.0000000000000000028512000000000000000000 GBP with a 1% Discount (0.0000000000000000028226880000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -2.82E-18
15406579 2015-09-28 14:36:36.203138+01 settled Instant withdrawal from Quick Access Account (5) 6E-20
15406580 2015-09-28 14:36:36.203138+01 settled Purchase loan part 13417410 (old id 13417402) for 0.0000000000000000000594000000000000000000 GBP with a 1% Discount (0.0000000000000000000588060000000000000000 GBP paid) - annualised rate 10, loan: Midlands Trade Finance Provider Loan Tranche 4 (109) -6E-20
By adding up the purchases, I see that at the start of the sequence I had about £14.8548 of funds available, which would have been enough to have been allocated £15.0048 of the loan at face value (and indeed in this sequence that's the amount I ended up with)
The correct calculation would be to divide my available amount by 0.99 (or multiply by 1.0101010101... if that's easier) in order to determine the amount to allocate me (when multiplied by 0.99 to apply the discount that ends up equal to my available funds). Instead the system has allocated me an amount that was my available funds MULTIPLIED by 0.99. This then gets multiplied by 0.99 again to apply my discount, resulting in me spending exactly 98.01% of my available funds...
... a few minutes later the systems notices the remaining unspent 1.99% of the original funds, does the incorrect calculation on that again, and leaves 1.99% of 1.99% etc.
Why do
chris and his team continue to make such fundamental errors, and release them to us untested? Have they even heard of unit testing?