Allow to recalculate rates via bulk edit (#1768)

This commit is contained in:
Kevin Papst
2020-06-05 12:25:56 +02:00
committed by GitHub
parent da5563960b
commit ae6beff5d8
6 changed files with 45 additions and 10 deletions

View File

@@ -198,12 +198,16 @@ class TimesheetMultiUpdate extends AbstractType
if ($options['include_rate']) {
$builder
->add('recalculateRates', YesNoType::class, [
'label' => 'label.recalculate_rates',
])
->add('fixedRate', FixedRateType::class, [
'currency' => $currency,
])
->add('hourlyRate', HourlyRateType::class, [
'currency' => $currency,
]);
])
;
}
$builder->add('entities', HiddenType::class, [

View File

@@ -29,6 +29,10 @@ class TimesheetMultiUpdateDTO extends MultiUpdateTableDTO
* @var bool
*/
private $replaceTags = false;
/**
* @var bool
*/
private $recalculateRates = false;
/**
* @var Customer|null
*/
@@ -50,13 +54,13 @@ class TimesheetMultiUpdateDTO extends MultiUpdateTableDTO
*/
private $exported = null;
/**
* @var float
* @var float|null
*/
private $fixedRate;
private $fixedRate = null;
/**
* @var float
* @var float|null
*/
private $hourlyRate;
private $hourlyRate = null;
public function getCustomer(): ?Customer
{
@@ -133,6 +137,18 @@ class TimesheetMultiUpdateDTO extends MultiUpdateTableDTO
return $this;
}
public function isRecalculateRates(): bool
{
return $this->recalculateRates;
}
public function setRecalculateRates(bool $recalculateRates): TimesheetMultiUpdateDTO
{
$this->recalculateRates = $recalculateRates;
return $this;
}
public function isReplaceTags(): bool
{
return $this->replaceTags;