Commit 8ecd4381 authored by ornanovitch's avatar ornanovitch 🐃

nettoyage rate (tarif)

parent 7003e2ad
......@@ -4,7 +4,6 @@ namespace App\Controller;
use App\Entity\ShowDate;
use App\Entity\Spectacle;
use App\Entity\ShowRate;
use App\Form\ShowDateType;
use App\Repository\ShowDateRepository;
use App\Repository\SpectacleRepository;
......
......@@ -49,14 +49,6 @@ class Spectacle
*/
private $photoCredits;
/**
* Base rate of the show to make calculations
* @Assert\Regex( "/^[0-9]{1,}(\.|)[0-9]{0,2}$/", message =" tarif non valide")
* @ORM\Column(type="float", nullable=true)
*/
private $baseRate;
/**
* Many to one relation with the theater the show is linked to
......@@ -160,18 +152,6 @@ class Spectacle
return $this;
}
public function getBaseRate(): ?float
{
return $this->baseRate;
}
public function setBaseRate(?float $baseRate): self
{
$this->baseRate = $baseRate;
return $this;
}
public function getTheater(): ?Theater
{
return $this->theater;
......
......@@ -86,15 +86,6 @@ class Theater
*/
private $website;
// /^[0-9]{1,}[.]{0,1}[0-9]{0,2}$/ /^[0-9]{1,}(\.|)[0-9]{0,2}$/g /^[1-9][0-9]*\.[0-9]{2}$/
/**
*
* @Assert\Regex( "/^[0-9]{1,}(\.|)[0-9]{0,2}$/", message =" tarif non valide")
* @ORM\Column(type="float", nullable=true)
*/
private $baseRate;
/**
* @ORM\OneToOne(targetEntity="User", inversedBy="theater", cascade={"persist", "remove"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
......@@ -256,18 +247,6 @@ class Theater
return $this;
}
public function getBaseRate(): ?float
{
return $this->baseRate;
}
public function setBaseRate(?float $baseRate): self
{
$this->baseRate = $baseRate;
return $this;
}
public function getUser(): ?User
{
return $this->user;
......
......@@ -29,7 +29,6 @@ class RegistrationType extends AbstractType
->remove('logo')
->remove('picture')
->remove('website')
->remove('baseRate')
->remove('lat')
->remove('longitude')
->remove('toclient_infos')
......
......@@ -3,7 +3,6 @@
namespace App\Form;
use App\Entity\ShowDate;
use App\Entity\ShowRate;
use Doctrine\DBAL\Types\IntegerType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
......
<?php
namespace App\Form;
use App\Entity\ShowRate;
use DateTimeInterface;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ShowRateType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('freePlacesNumber', NumberType::class)
->add('discountedRate', MoneyType::class)
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => ShowRate::class,
]);
}
}
......@@ -64,8 +64,7 @@ class SpectacleType extends AbstractType
'label' => 'Spectacle Balises',
'required' => false,
]
)
->add('baseRate', MoneyType::class, ['required'=>false]);
);
}
public function configureOptions(OptionsResolver $resolver)
......
......@@ -2,19 +2,12 @@
<div class="row">
<div class="col-sm-6">
{{ form_label(form.isBalise, 'Offre Balises') }}
<label class="h6 mt-3 font-weight-bold text-uppercase m-0"
data-toggle="collapse"
data-target="#tarifSiBalises"
aria-expanded="false"
aria-controls="tarifSiBalises">
{{ form_widget(form.isBalise) }}</label>
<div class="collapse" id="tarifSiBalises" aria-expanded="false">
<h6 class="mt-3 font-weight-bold text-uppercase m-0">{{ form_label(form.baseRate, 'Plein Tarif') }}</h6>
{{ form_widget(form.baseRate, {'attr': {'class': 'hold','placeholder': '0.00'}}) }}
</div>
<h6 class="mt-3 font-weight-bold text-uppercase m-0">{{ form_widget(form.isBalise) }}</h6>
</div>
<div class="col-sm-6">
<h6 class="mt-3 font-weight-bold text-uppercase m-0">{{ form_label(form.baseRate, 'Durée (H m)') }}</h6>
</div>
<div class="row">
<div class="col-sm-3">
<h6 class="mt-3 font-weight-bold text-uppercase m-0">{{ form_label(form.duration, 'Durée (H m)') }}</h6>
{{ form_widget(form.duration, {'attr': {'class': 'hold'}}) }}
</div>
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment