| 1 | <?php |
||
| 21 | class RackUnitQuantity extends MonthlyQuantity |
||
| 22 | { |
||
| 23 | /** @var Charge */ |
||
| 24 | protected $model; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * {@inheritdoc} |
||
| 28 | */ |
||
| 29 | public function format(): string |
||
| 30 | { |
||
| 31 | $text = Yii::t('hipanel:finance', '{units, plural, one{# unit} other{# units}} × {quantity, plural, one{# day} other{# days}}', [ |
||
| 32 | 'units' => $this->model->quantity / ($this->model->bill->quantity ?: 1), |
||
| 33 | 'quantity' => round($this->model->bill->quantity * $this->getNumberOfDays()), |
||
| 34 | ]); |
||
| 35 | |||
| 36 | return $text; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getValue(): string |
||
| 43 | |||
| 44 | public function getClientValue(): string |
||
| 48 | } |
||
| 49 |