Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/erp
1 Ergebnis
Änderungen anzeigen
Commits auf Quelle (2)
  • Henning Leutz's avatar
    fix: allow null user type in setuser methods and improve type hinting · eefbf9a0
    verfasst von Henning Leutz
    This commit includes changes made to both the Article.php and ArticleList.php classes in the
    QUI\ERP\Accounting directory. The setUser methods now accept a null type for the 'User' parameter,
    giving more flexibility when calculating user details.
    
    Type hinting was also improved in the ArticleList class. The variable type indicators were changed
    from 'int|float' to 'int | float', and from 'Factor|QUI\\ERP\\Products\\Utils\\PriceFactor' to
    'Factor | QUI\\ERP\\Products\\Utils\\PriceFactor', improving readability and clarity of code.
    
    Lastly, the 'template' and 'articleTemplate' parameters in the 'toHTMLWithCSS' method now support
    both 'bool' and 'string' types, adding flexibility to template usage.
    eefbf9a0
  • Henning Leutz's avatar
    Merge branch 'next-3.x' into 'main' · fcf8f609
    verfasst von Henning Leutz
    fix: allow null user type in setuser methods and improve type hinting
    
    See merge request !173
    fcf8f609
......@@ -499,9 +499,9 @@ public function getUser(): ?QUI\Interfaces\Users\User
/**
* Set the user to the product, this user will be used for the calculation
*
* @param QUI\Interfaces\Users\User $User
* @param null|QUI\Interfaces\Users\User $User
*/
public function setUser(QUI\Interfaces\Users\User $User): void
public function setUser(null | QUI\Interfaces\Users\User $User): void
{
$this->calculated = false;
$this->User = $User;
......
......@@ -34,17 +34,17 @@ class ArticleList extends ArticleListUnique implements IteratorAggregate
/**
* @var int|float
*/
protected int|float $sum;
protected int | float $sum;
/**
* @var int|float
*/
protected int|float $grandSubSum;
protected int | float $grandSubSum;
/**
* @var ?QUI\Interfaces\Users\User
*/
protected QUI\Interfaces\Users\User|null $User = null;
protected QUI\Interfaces\Users\User | null $User = null;
/**
* @var ?QUI\ERP\Order\AbstractOrder
......@@ -59,17 +59,17 @@ class ArticleList extends ArticleListUnique implements IteratorAggregate
/**
* @var int|float
*/
protected int|float $subSum;
protected int | float $subSum;
/**
* @var int|float
*/
protected int|float $nettoSum;
protected int | float $nettoSum;
/**
* @var int|float
*/
protected int|float $nettoSubSum;
protected int | float $nettoSubSum;
/**
* key 19% value[sum] = sum value[text] = text value[display_sum] formatted
......@@ -140,9 +140,9 @@ public function __construct(array $attributes = [])
* Set the user for the list
* User for calculation
*
* @param QUI\Interfaces\Users\User $User
* @param null|QUI\Interfaces\Users\User $User
*/
public function setUser(QUI\Interfaces\Users\User $User): void
public function setUser(null | QUI\Interfaces\Users\User $User): void
{
if ($this->User === $User) {
return;
......@@ -486,7 +486,7 @@ public function importPriceFactors(QUI\ERP\Accounting\PriceFactors\FactorList $P
*
* @throws Exception
*/
public function addPriceFactor(Factor|QUI\ERP\Products\Utils\PriceFactor $PriceFactor): void
public function addPriceFactor(Factor | QUI\ERP\Products\Utils\PriceFactor $PriceFactor): void
{
if ($PriceFactor instanceof QUI\ERP\Products\Utils\PriceFactor) {
$isNetto = $this->isNetto;
......@@ -550,8 +550,8 @@ public function renderForMail(): string
}
public function toHTMLWithCSS(
bool|string $template = false,
bool|string $articleTemplate = false,
bool | string $template = false,
bool | string $articleTemplate = false,
?QUI\Interfaces\Template\EngineInterface $Engine = null,
): string {
return $this->toUniqueList()->toHTMLWithCSS($template, $articleTemplate, $Engine);
......