688fdd49ee
add webdav client change pdf viewer
74 lines
2.5 KiB
PHP
74 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Form;
|
|
|
|
use App\Entity\Bill;
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
|
use Symfony\Component\Validator\Constraints\File;
|
|
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
use App\Entity\BillPeer;
|
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
use App\Entity\BillVendor;
|
|
use Doctrine\ORM\EntityRepository;
|
|
use App\Entity\BillCategory;
|
|
|
|
class BillFilterType extends AbstractType
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
|
{
|
|
$builder
|
|
->add('reference', null, [
|
|
'label' => 'Numéro de facture',
|
|
'required' => false,
|
|
])
|
|
->add('vendor', null, [
|
|
'label' => 'Fournisseur',
|
|
'required' => false,
|
|
])
|
|
->add('vendor', EntityType::class, [
|
|
'label' => 'Fournisseur',
|
|
'required' => false,
|
|
'class' => BillVendor::class,
|
|
'query_builder' => function (EntityRepository $er) {
|
|
return $er->createQueryBuilder('v')
|
|
->orderBy('v.label', 'ASC')
|
|
;
|
|
},
|
|
'attr' => [
|
|
'data-jschoice' => '',
|
|
],
|
|
])
|
|
->add('category', EntityType::class, [
|
|
'label' => 'Catégorie',
|
|
'required' => false,
|
|
'class' => BillCategory::class,
|
|
'query_builder' => function (EntityRepository $er) {
|
|
return $er->createQueryBuilder('v')
|
|
->orderBy('v.label', 'ASC')
|
|
;
|
|
},
|
|
'attr' => [
|
|
'data-jschoice' => '',
|
|
],
|
|
])
|
|
->add('status', ChoiceType::class, [
|
|
'choices' => BillPeer::choices(),
|
|
'required' => false,
|
|
])
|
|
;
|
|
}
|
|
|
|
public function configureOptions(OptionsResolver $resolver): void
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => null,
|
|
'csrf_protection' => false,
|
|
]);
|
|
}
|
|
}
|