mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-09 18:04:33 +02:00
Fixed wrongly detected changes of prices caused by not identical objects.
This commit is contained in:
parent
f92802a3c7
commit
c60f27ef86
3 changed files with 23 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue