FIX: correctly calculate prices in supplier context + remove warnings from calcul_price_total() #34360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FIX correctly calculate prices in supplier context + remove warnings from calcul_price_total()
In many Dolibarr instances we host, the
dolibarr.log
file is flooded with warnings related to price calculation :To lighten the log file, I searched all instances of
calcul_price_total()
(itself being called byCommonObject::update_price()
), and explicitly passed the$seller
argument.This warning was effective as in most of the supplier part of Dolibarr, it was incorrectly assumed to by
$mysoc
(which can lead to incorrect local tax amounts if I remember correctly), so I passed the supplier instead.For expense reports, I passed a modified version of
$mysoc
as was already done in some places of theExpenseReport
class.A further step in the future would be to make the
$seller
argument mandatory in bothCommonObject::update_price()
andcalcul_price_total()
.