mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 18:34:32 +02:00
Fixed code style.
This commit is contained in:
parent
2853e471c4
commit
d0b1024d80
212 changed files with 495 additions and 1005 deletions
|
@ -51,7 +51,6 @@ use Brick\Math\RoundingMode;
|
|||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use DoctrineExtensions\Query\Mysql\Round;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
@ -68,7 +67,7 @@ class Currency extends AbstractStructuralDBElement
|
|||
|
||||
/**
|
||||
* @var BigDecimal|null The exchange rate between this currency and the base currency
|
||||
* (how many base units the current currency is worth)
|
||||
* (how many base units the current currency is worth)
|
||||
* @ORM\Column(type="big_decimal", precision=11, scale=5, nullable=true)
|
||||
* @BigDecimalPositive()
|
||||
*/
|
||||
|
@ -119,9 +118,6 @@ class Currency extends AbstractStructuralDBElement
|
|||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getPricedetails(): Collection
|
||||
{
|
||||
return $this->pricedetails;
|
||||
|
@ -176,13 +172,13 @@ class Currency extends AbstractStructuralDBElement
|
|||
* Sets the exchange rate of the currency.
|
||||
*
|
||||
* @param BigDecimal|null $exchange_rate The new exchange rate of the currency.
|
||||
* Set to null, if the exchange rate is unknown.
|
||||
* Set to null, if the exchange rate is unknown.
|
||||
*
|
||||
* @return Currency
|
||||
*/
|
||||
public function setExchangeRate(?BigDecimal $exchange_rate): self
|
||||
{
|
||||
if ($exchange_rate === null) {
|
||||
if (null === $exchange_rate) {
|
||||
$this->exchange_rate = null;
|
||||
}
|
||||
$tmp = $exchange_rate->toScale(self::PRICE_SCALE, RoundingMode::HALF_UP);
|
||||
|
|
|
@ -209,7 +209,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
|
|||
*/
|
||||
public function getPriceRelatedQuantity(): float
|
||||
{
|
||||
if ($this->orderdetail && $this->orderdetail->getPart() && ! $this->orderdetail->getPart()->useFloatAmount()) {
|
||||
if ($this->orderdetail && $this->orderdetail->getPart() && !$this->orderdetail->getPart()->useFloatAmount()) {
|
||||
$tmp = round($this->price_related_quantity);
|
||||
|
||||
return $tmp < 1 ? 1 : $tmp;
|
||||
|
@ -232,7 +232,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
|
|||
*/
|
||||
public function getMinDiscountQuantity(): float
|
||||
{
|
||||
if ($this->orderdetail && $this->orderdetail->getPart() && ! $this->orderdetail->getPart()->useFloatAmount()) {
|
||||
if ($this->orderdetail && $this->orderdetail->getPart() && !$this->orderdetail->getPart()->useFloatAmount()) {
|
||||
$tmp = round($this->min_discount_quantity);
|
||||
|
||||
return $tmp < 1 ? 1 : $tmp;
|
||||
|
@ -299,6 +299,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
|
|||
if ((string) $tmp !== (string) $this->price) {
|
||||
$this->price = $tmp;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue