Factorize query to compute purchase party values
The purchase module searches for previous values in order to determine some field values of the party.
The computed fields can not be extended, nor the order and the number of purchases to consider for such value.
It will be great to be able to factorize such values so it can be extended in third party modules.