When the last line is pop from the debit/credit list, the access to the balance
may invalidate the cache of other records to fill the cache of the last one.
This may become very inefficient on large list of lines.
So by setting the record cache size to the size of the list of lines, we ensure
that no cache is invalidated during the calculation.
Closes#14230
If we round the tax amount already added to the other line, the result may vary
depending on the order of the lines.
This is because round half even is used so the result may depend on the already
summed tax amounts.
Closes#14047
The rounding error must not be distributed between taxable lines having
different taxes otherwise the tax amount is not stable for the same base
amount.
Closes#13673
The combination implementation is replaced by strategy that search the
smallest remaining from the order lines by removing the last debit or credit
depending on the remaining sign.
Closes#13451
When a new parent is added to a tree template like types, taxes or tax codes,
the corresponding record of the new template parent is not yet created.
So we need to use a default value for the parent and update again the tree
after creating the new records.
Closes#12755