Fixed wrongly detected changes of prices caused by not identical objects.

This commit is contained in:
Jan Böhmer 2020-05-20 22:45:41 +02:00
parent f92802a3c7
commit c60f27ef86
3 changed files with 23 additions and 3 deletions

View file

@ -159,7 +159,15 @@ class Supplier extends AbstractCompany
*/
public function setShippingCosts(?BigDecimal $shipping_costs): self
{
$this->shipping_costs = $shipping_costs;
if ($shipping_costs === null) {
$this->shipping_costs = null;
}
//Only change the object, if the value changes, so that doctrine does not detect it as changed.
if ((string) $shipping_costs !== (string) $this->shipping_costs) {
$this->shipping_costs = $shipping_costs;
}
return $this;
}
}