1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Odiseo\SyliusAvataxPlugin\Form\Type; |
6
|
|
|
|
7
|
|
|
use Sylius\Bundle\AddressingBundle\Form\Type\CountryCodeChoiceType; |
8
|
|
|
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; |
9
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
10
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
11
|
|
|
|
12
|
|
|
final class AvataxConfigurationSenderDataType extends AbstractResourceType |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* {@inheritdoc} |
16
|
|
|
*/ |
17
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void |
18
|
|
|
{ |
19
|
|
|
parent::buildForm($builder, $options); |
20
|
|
|
|
21
|
|
|
$builder |
22
|
|
|
->add('provinceCode', TextType::class, [ |
23
|
|
|
'label' => 'odiseo_sylius_avatax_plugin.form.avatax_configuration_sender_data.province_code', |
24
|
|
|
'required' => false, |
25
|
|
|
]) |
26
|
|
|
->add('countryCode', CountryCodeChoiceType::class, [ |
27
|
|
|
'label' => 'odiseo_sylius_avatax_plugin.form.avatax_configuration_sender_data.country', |
28
|
|
|
'enabled' => true, |
29
|
|
|
'required' => false, |
30
|
|
|
]) |
31
|
|
|
->add('street', TextType::class, [ |
32
|
|
|
'label' => 'odiseo_sylius_avatax_plugin.form.avatax_configuration_sender_data.street', |
33
|
|
|
'required' => false, |
34
|
|
|
]) |
35
|
|
|
->add('city', TextType::class, [ |
36
|
|
|
'label' => 'odiseo_sylius_avatax_plugin.form.avatax_configuration_sender_data.city', |
37
|
|
|
'required' => false, |
38
|
|
|
]) |
39
|
|
|
->add('postcode', TextType::class, [ |
40
|
|
|
'label' => 'odiseo_sylius_avatax_plugin.form.avatax_configuration_sender_data.postcode', |
41
|
|
|
'required' => false, |
42
|
|
|
]) |
43
|
|
|
; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* {@inheritdoc} |
48
|
|
|
*/ |
49
|
|
|
public function getBlockPrefix(): string |
50
|
|
|
{ |
51
|
|
|
return 'odiseo_avatax_configuration_sender_data'; |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|