set rates via batch update (#1326)

This commit is contained in:
Kevin Papst
2019-12-29 16:52:43 +01:00
committed by GitHub
parent 8aa8f452d5
commit baac4eb698
12 changed files with 258 additions and 49 deletions

View File

@@ -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,
]);