As stated by php docs, the bccomp function takes two strings to perform the comparison.
The code is using numeric values directly, which causes some values to fail the comparison and therefore, some line items will be missing.
to fix that, the bccomp functions need to have the operands converted to strings:
As stated by php docs, the bccomp function takes two strings to perform the comparison. The code is using numeric values directly, which causes some values to fail the comparison and therefore, some line items will be missing.
to fix that, the bccomp functions need to have the operands converted to strings: