mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 20:50:06 +02:00
Dont log that shipping costs or price has been changed when just saving a part.
Fixes issue #26
This commit is contained in:
parent
7cf500279e
commit
88580aad79
2 changed files with 8 additions and 2 deletions
|
@ -162,7 +162,10 @@ class Supplier extends AbstractCompany
|
||||||
*/
|
*/
|
||||||
public function setShippingCosts(?string $shipping_costs): self
|
public function setShippingCosts(?string $shipping_costs): self
|
||||||
{
|
{
|
||||||
$this->shipping_costs = $shipping_costs;
|
/* Just a little hack to ensure that price has 5 digits after decimal point,
|
||||||
|
so that DB does not detect changes, when something like 0.4 is passed
|
||||||
|
Third parameter must have the scale value of decimal column. */
|
||||||
|
$this->shipping_costs = bcmul($shipping_costs, '1.0', 5);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,10 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
|
||||||
{
|
{
|
||||||
//Assert::natural($new_price, 'The new price must be positive! Got %s!');
|
//Assert::natural($new_price, 'The new price must be positive! Got %s!');
|
||||||
|
|
||||||
$this->price = $new_price;
|
/* Just a little hack to ensure that price has 5 digits after decimal point,
|
||||||
|
so that DB does not detect changes, when something like 0.4 is passed
|
||||||
|
Third parameter must have the scale value of decimal column. */
|
||||||
|
$this->price = bcmul($new_price, '1.0', static::PRICE_PRECISION);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue