32 lines
828 B
PHP
32 lines
828 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Reports\Application\DTOs;
|
|
|
|
/**
|
|
* Stock taken out in a period for one item, or a sum for a group, machine
|
|
* or job ($unit null for sums of different items): quantities in
|
|
* thousandths, values in cents, use, write-offs and stock count
|
|
* corrections apart.
|
|
*/
|
|
final readonly class StockUsageRow
|
|
{
|
|
public function __construct(
|
|
public string $label,
|
|
public ?string $group,
|
|
public ?string $unit,
|
|
public int $usedMilli,
|
|
public int $usedCents,
|
|
public int $writtenOffMilli,
|
|
public int $writtenOffCents,
|
|
public int $adjustedMilli,
|
|
public int $adjustedCents,
|
|
) {}
|
|
|
|
public function totalCents(): int
|
|
{
|
|
return $this->usedCents + $this->writtenOffCents + $this->adjustedCents;
|
|
}
|
|
}
|