set rates via batch update (#1326)
This commit is contained in:
@@ -11,6 +11,8 @@ namespace App\Form\MultiUpdate;
|
||||
|
||||
use App\Form\Type\ActivityType;
|
||||
use App\Form\Type\CustomerType;
|
||||
use App\Form\Type\FixedRateType;
|
||||
use App\Form\Type\HourlyRateType;
|
||||
use App\Form\Type\ProjectType;
|
||||
use App\Form\Type\TagsInputType;
|
||||
use App\Form\Type\UserType;
|
||||
@@ -57,6 +59,7 @@ class TimesheetMultiUpdate extends AbstractType
|
||||
$activity = null;
|
||||
$project = null;
|
||||
$customer = null;
|
||||
$currency = null;
|
||||
$customerCount = $this->customers->countCustomer(true);
|
||||
|
||||
if (isset($options['data'])) {
|
||||
@@ -70,6 +73,10 @@ class TimesheetMultiUpdate extends AbstractType
|
||||
if (null === $project && null !== $activity) {
|
||||
$project = $activity->getProject();
|
||||
}
|
||||
|
||||
if (null !== $customer) {
|
||||
$currency = $customer->getCurrency();
|
||||
}
|
||||
}
|
||||
|
||||
$builder
|
||||
@@ -189,6 +196,14 @@ class TimesheetMultiUpdate extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
$builder
|
||||
->add('fixedRate', FixedRateType::class, [
|
||||
'currency' => $currency,
|
||||
])
|
||||
->add('hourlyRate', HourlyRateType::class, [
|
||||
'currency' => $currency,
|
||||
]);
|
||||
|
||||
$builder->add('entities', HiddenType::class, [
|
||||
'required' => false,
|
||||
]);
|
||||
|
||||
@@ -49,6 +49,14 @@ class TimesheetMultiUpdateDTO extends MultiUpdateTableDTO
|
||||
* @var bool|null
|
||||
*/
|
||||
private $exported = null;
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
private $fixedRate;
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
private $hourlyRate;
|
||||
|
||||
public function getCustomer(): ?Customer
|
||||
{
|
||||
@@ -136,4 +144,28 @@ class TimesheetMultiUpdateDTO extends MultiUpdateTableDTO
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFixedRate(): ?float
|
||||
{
|
||||
return $this->fixedRate;
|
||||
}
|
||||
|
||||
public function setFixedRate(?float $fixedRate): TimesheetMultiUpdateDTO
|
||||
{
|
||||
$this->fixedRate = $fixedRate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHourlyRate(): ?float
|
||||
{
|
||||
return $this->hourlyRate;
|
||||
}
|
||||
|
||||
public function setHourlyRate(?float $hourlyRate): TimesheetMultiUpdateDTO
|
||||
{
|
||||
$this->hourlyRate = $hourlyRate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user