added internal rates (#1591)
This commit is contained in:
@@ -11,14 +11,10 @@ namespace App\Form;
|
||||
|
||||
use App\Entity\CustomerRate;
|
||||
use App\Entity\Rate;
|
||||
use App\Form\Type\UserType;
|
||||
use App\Form\Type\YesNoType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CustomerRateForm extends AbstractType
|
||||
class CustomerRateForm extends AbstractRateForm
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
@@ -26,7 +22,8 @@ class CustomerRateForm extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$currency = null;
|
||||
if ($options['data']) {
|
||||
|
||||
if (!empty($options['data'])) {
|
||||
/** @var CustomerRate $rate */
|
||||
$rate = $options['data'];
|
||||
|
||||
@@ -35,21 +32,7 @@ class CustomerRateForm extends AbstractType
|
||||
}
|
||||
}
|
||||
|
||||
$builder
|
||||
->add('user', UserType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('rate', MoneyType::class, [
|
||||
'label' => 'label.rate',
|
||||
'attr' => [
|
||||
'autofocus' => 'autofocus'
|
||||
],
|
||||
'currency' => $currency,
|
||||
])
|
||||
->add('isFixed', YesNoType::class, [
|
||||
'label' => 'label.fixedRate'
|
||||
])
|
||||
;
|
||||
$this->addFields($builder, $currency);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user