✨ feat(Devis): Ajoute relation one-to-one avec Contrats et met à jour l'entité.
➕ feat(contrats): Ajoute le formulaire de création de contrats. 📝 feat(Contrats): Crée le type de formulaire ContratsType. ✨ feat(Customer): Ajoute la relation one-to-many avec Contrats. ➕ feat(contrats): Ajoute la vue de création de contrats.
This commit is contained in:
39
migrations/Version20260121135907.php
Normal file
39
migrations/Version20260121135907.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260121135907 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE TABLE contrats (id SERIAL NOT NULL, customer_id INT DEFAULT NULL, devis_id INT DEFAULT NULL, num_reservation VARCHAR(255) NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE INDEX IDX_7268396C9395C3F3 ON contrats (customer_id)');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_7268396C41DEFADA ON contrats (devis_id)');
|
||||||
|
$this->addSql('COMMENT ON COLUMN contrats.create_at IS \'(DC2Type:datetime_immutable)\'');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD CONSTRAINT FK_7268396C9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD CONSTRAINT FK_7268396C41DEFADA FOREIGN KEY (devis_id) REFERENCES devis (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP CONSTRAINT FK_7268396C9395C3F3');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP CONSTRAINT FK_7268396C41DEFADA');
|
||||||
|
$this->addSql('DROP TABLE contrats');
|
||||||
|
}
|
||||||
|
}
|
||||||
40
migrations/Version20260121140314.php
Normal file
40
migrations/Version20260121140314.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260121140314 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD adress_event VARCHAR(255) NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD adress2_event VARCHAR(255) NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD adress3_event VARCHAR(255) DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD zip_code_event VARCHAR(255) NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD town_event VARCHAR(255) NOT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP adress_event');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP adress2_event');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP adress3_event');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP zip_code_event');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP town_event');
|
||||||
|
}
|
||||||
|
}
|
||||||
44
migrations/Version20260121140558.php
Normal file
44
migrations/Version20260121140558.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260121140558 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD type VARCHAR(255) NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD details TEXT NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD type_sol VARCHAR(255) NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD pente VARCHAR(255) NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD access TEXT NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD distance_power DOUBLE PRECISION NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD notes TEXT NOT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP type');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP details');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP type_sol');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP pente');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP access');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP distance_power');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP notes');
|
||||||
|
}
|
||||||
|
}
|
||||||
39
migrations/Version20260121141506.php
Normal file
39
migrations/Version20260121141506.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260121141506 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE TABLE contrats_payments (id SERIAL NOT NULL, contrat_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, payment_id VARCHAR(255) NOT NULL, state VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE INDEX IDX_95744AFC1823061F ON contrats_payments (contrat_id)');
|
||||||
|
$this->addSql('ALTER TABLE contrats_payments ADD CONSTRAINT FK_95744AFC1823061F FOREIGN KEY (contrat_id) REFERENCES contrats (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD is_signed BOOLEAN NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD sign_id VARCHAR(255) DEFAULT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
$this->addSql('ALTER TABLE contrats_payments DROP CONSTRAINT FK_95744AFC1823061F');
|
||||||
|
$this->addSql('DROP TABLE contrats_payments');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP is_signed');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP sign_id');
|
||||||
|
}
|
||||||
|
}
|
||||||
38
migrations/Version20260121143754.php
Normal file
38
migrations/Version20260121143754.php
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260121143754 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE TABLE env_at (id SERIAL NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD date_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE contrats ADD end_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL');
|
||||||
|
$this->addSql('COMMENT ON COLUMN contrats.date_at IS \'(DC2Type:datetime_immutable)\'');
|
||||||
|
$this->addSql('COMMENT ON COLUMN contrats.end_at IS \'(DC2Type:datetime_immutable)\'');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
$this->addSql('DROP TABLE env_at');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP date_at');
|
||||||
|
$this->addSql('ALTER TABLE contrats DROP end_at');
|
||||||
|
}
|
||||||
|
}
|
||||||
34
migrations/Version20260121143811.php
Normal file
34
migrations/Version20260121143811.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260121143811 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('DROP SEQUENCE env_at_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP TABLE env_at');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
$this->addSql('CREATE SEQUENCE env_at_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE TABLE env_at (id SERIAL NOT NULL, PRIMARY KEY(id))');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Controller\Dashboard;
|
namespace App\Controller\Dashboard;
|
||||||
|
|
||||||
|
use App\Entity\Contrats;
|
||||||
|
use App\Entity\Devis;
|
||||||
|
use App\Form\Type\ContratsType;
|
||||||
use App\Logger\AppLogger;
|
use App\Logger\AppLogger;
|
||||||
use App\Repository\AccountRepository;
|
use App\Repository\AccountRepository;
|
||||||
use App\Repository\DevisRepository;
|
use App\Repository\DevisRepository;
|
||||||
@@ -29,9 +32,27 @@ class ContratsController extends AbstractController
|
|||||||
#[Route(path: '/crm/contrats/add', name: 'app_crm_contrats_create', options: ['sitemap' => false], methods: ['GET'])]
|
#[Route(path: '/crm/contrats/add', name: 'app_crm_contrats_create', options: ['sitemap' => false], methods: ['GET'])]
|
||||||
public function contratsAdd(Request $request,DevisRepository $devisRepository, AppLogger $appLogger): Response
|
public function contratsAdd(Request $request,DevisRepository $devisRepository, AppLogger $appLogger): Response
|
||||||
{
|
{
|
||||||
|
$devis = $devisRepository->find($request->get('idDevis',0));
|
||||||
|
|
||||||
|
$c = new Contrats();
|
||||||
|
if($devis instanceof Devis){
|
||||||
|
$c->setCustomer($devis->getCustomer());
|
||||||
|
$c->setDevis($devis);
|
||||||
|
$c->setAddressEvent($devis->getAddressShip()->getAddress());
|
||||||
|
$c->setAddress2Event($devis->getAddressShip()->getAddress2());
|
||||||
|
$c->setAddress3Event($devis->getAddressShip()->getAddress3());
|
||||||
|
$c->setZipCodeEvent($devis->getAddressShip()->getZipcode());
|
||||||
|
$c->setTownEvent($devis->getAddressShip()->getCity());
|
||||||
|
}
|
||||||
|
|
||||||
|
$form = $this->createForm(ContratsType::class,$c);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$appLogger->record('VIEW', 'Consultation création d\'un contract');
|
$appLogger->record('VIEW', 'Consultation création d\'un contract');
|
||||||
return $this->render('dashboard/contrats/add.twig',[
|
return $this->render('dashboard/contrats/add.twig',[
|
||||||
'devis' => $devisRepository->find($request->get('idDevis',0)),
|
'devis' => $devis,
|
||||||
|
'form'=> $form->createView(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
364
src/Entity/Contrats.php
Normal file
364
src/Entity/Contrats.php
Normal file
@@ -0,0 +1,364 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\ContratsRepository;
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: ContratsRepository::class)]
|
||||||
|
class Contrats
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(inversedBy: 'contrats')]
|
||||||
|
private ?Customer $customer = null;
|
||||||
|
|
||||||
|
#[ORM\OneToOne(inversedBy: 'contrats', cascade: ['persist', 'remove'])]
|
||||||
|
private ?Devis $devis = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $numReservation = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?\DateTimeImmutable $createAt = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $adressEvent = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $adress2Event = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
private ?string $adress3Event = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $zipCodeEvent = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $townEvent = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $type = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: Types::TEXT)]
|
||||||
|
private ?string $details = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $typeSol = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $pente = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: Types::TEXT)]
|
||||||
|
private ?string $access = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?float $distancePower = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: Types::TEXT)]
|
||||||
|
private ?string $notes = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?bool $isSigned = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
private ?string $signID = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Collection<int, ContratsPayments>
|
||||||
|
*/
|
||||||
|
#[ORM\OneToMany(targetEntity: ContratsPayments::class, mappedBy: 'contrat')]
|
||||||
|
private Collection $contratsPayments;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?\DateTimeImmutable $dateAt = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?\DateTimeImmutable $endAt = null;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->contratsPayments = new ArrayCollection();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCustomer(): ?Customer
|
||||||
|
{
|
||||||
|
return $this->customer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCustomer(?Customer $customer): static
|
||||||
|
{
|
||||||
|
$this->customer = $customer;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDevis(): ?Devis
|
||||||
|
{
|
||||||
|
return $this->devis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDevis(?Devis $devis): static
|
||||||
|
{
|
||||||
|
$this->devis = $devis;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNumReservation(): ?string
|
||||||
|
{
|
||||||
|
return $this->numReservation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNumReservation(string $numReservation): static
|
||||||
|
{
|
||||||
|
$this->numReservation = $numReservation;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCreateAt(): ?\DateTimeImmutable
|
||||||
|
{
|
||||||
|
return $this->createAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCreateAt(\DateTimeImmutable $createAt): static
|
||||||
|
{
|
||||||
|
$this->createAt = $createAt;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAddressEvent(): ?string
|
||||||
|
{
|
||||||
|
return $this->adressEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAddressEvent(string $adressEvent): static
|
||||||
|
{
|
||||||
|
$this->adressEvent = $adressEvent;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAddress2Event(): ?string
|
||||||
|
{
|
||||||
|
return $this->adress2Event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAddress2Event(string $adress2Event): static
|
||||||
|
{
|
||||||
|
$this->adress2Event = $adress2Event;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAddress3Event(): ?string
|
||||||
|
{
|
||||||
|
return $this->adress3Event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAddress3Event(?string $adress3Event): static
|
||||||
|
{
|
||||||
|
$this->adress3Event = $adress3Event;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getZipCodeEvent(): ?string
|
||||||
|
{
|
||||||
|
return $this->zipCodeEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setZipCodeEvent(string $zipCode): static
|
||||||
|
{
|
||||||
|
$this->zipCodeEvent = $zipCode;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTownEvent(): ?string
|
||||||
|
{
|
||||||
|
return $this->townEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTownEvent(string $town): static
|
||||||
|
{
|
||||||
|
$this->townEvent = $town;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getType(): ?string
|
||||||
|
{
|
||||||
|
return $this->type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setType(string $type): static
|
||||||
|
{
|
||||||
|
$this->type = $type;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDetails(): ?string
|
||||||
|
{
|
||||||
|
return $this->details;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDetails(string $details): static
|
||||||
|
{
|
||||||
|
$this->details = $details;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTypeSol(): ?string
|
||||||
|
{
|
||||||
|
return $this->typeSol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTypeSol(string $typeSol): static
|
||||||
|
{
|
||||||
|
$this->typeSol = $typeSol;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPente(): ?string
|
||||||
|
{
|
||||||
|
return $this->pente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPente(string $pente): static
|
||||||
|
{
|
||||||
|
$this->pente = $pente;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAccess(): ?string
|
||||||
|
{
|
||||||
|
return $this->access;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAccess(string $access): static
|
||||||
|
{
|
||||||
|
$this->access = $access;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDistancePower(): ?float
|
||||||
|
{
|
||||||
|
return $this->distancePower;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDistancePower(float $distancePower): static
|
||||||
|
{
|
||||||
|
$this->distancePower = $distancePower;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNotes(): ?string
|
||||||
|
{
|
||||||
|
return $this->notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNotes(string $notes): static
|
||||||
|
{
|
||||||
|
$this->notes = $notes;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isSigned(): ?bool
|
||||||
|
{
|
||||||
|
return $this->isSigned;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIsSigned(bool $isSigned): static
|
||||||
|
{
|
||||||
|
$this->isSigned = $isSigned;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSignID(): ?string
|
||||||
|
{
|
||||||
|
return $this->signID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSignID(?string $signID): static
|
||||||
|
{
|
||||||
|
$this->signID = $signID;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection<int, ContratsPayments>
|
||||||
|
*/
|
||||||
|
public function getContratsPayments(): Collection
|
||||||
|
{
|
||||||
|
return $this->contratsPayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addContratsPayment(ContratsPayments $contratsPayment): static
|
||||||
|
{
|
||||||
|
if (!$this->contratsPayments->contains($contratsPayment)) {
|
||||||
|
$this->contratsPayments->add($contratsPayment);
|
||||||
|
$contratsPayment->setContrat($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeContratsPayment(ContratsPayments $contratsPayment): static
|
||||||
|
{
|
||||||
|
if ($this->contratsPayments->removeElement($contratsPayment)) {
|
||||||
|
// set the owning side to null (unless already changed)
|
||||||
|
if ($contratsPayment->getContrat() === $this) {
|
||||||
|
$contratsPayment->setContrat(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDateAt(): ?\DateTimeImmutable
|
||||||
|
{
|
||||||
|
return $this->dateAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDateAt(\DateTimeImmutable $dateAt): static
|
||||||
|
{
|
||||||
|
$this->dateAt = $dateAt;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEndAt(): ?\DateTimeImmutable
|
||||||
|
{
|
||||||
|
return $this->endAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEndAt(\DateTimeImmutable $endAt): static
|
||||||
|
{
|
||||||
|
$this->endAt = $endAt;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
80
src/Entity/ContratsPayments.php
Normal file
80
src/Entity/ContratsPayments.php
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\ContratsPaymentsRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: ContratsPaymentsRepository::class)]
|
||||||
|
class ContratsPayments
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(inversedBy: 'contratsPayments')]
|
||||||
|
private ?Contrats $contrat = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $type = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $paymentId = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $state = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getContrat(): ?Contrats
|
||||||
|
{
|
||||||
|
return $this->contrat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setContrat(?Contrats $contrat): static
|
||||||
|
{
|
||||||
|
$this->contrat = $contrat;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getType(): ?string
|
||||||
|
{
|
||||||
|
return $this->type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setType(string $type): static
|
||||||
|
{
|
||||||
|
$this->type = $type;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPaymentId(): ?string
|
||||||
|
{
|
||||||
|
return $this->paymentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPaymentId(string $paymentId): static
|
||||||
|
{
|
||||||
|
$this->paymentId = $paymentId;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getState(): ?string
|
||||||
|
{
|
||||||
|
return $this->state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setState(string $state): static
|
||||||
|
{
|
||||||
|
$this->state = $state;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -57,11 +57,18 @@ class Customer
|
|||||||
#[ORM\OneToMany(targetEntity: ProductReserve::class, mappedBy: 'customer')]
|
#[ORM\OneToMany(targetEntity: ProductReserve::class, mappedBy: 'customer')]
|
||||||
private Collection $productReserves;
|
private Collection $productReserves;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Collection<int, Contrats>
|
||||||
|
*/
|
||||||
|
#[ORM\OneToMany(targetEntity: Contrats::class, mappedBy: 'customer')]
|
||||||
|
private Collection $contrats;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->customerAddresses = new ArrayCollection();
|
$this->customerAddresses = new ArrayCollection();
|
||||||
$this->devis = new ArrayCollection();
|
$this->devis = new ArrayCollection();
|
||||||
$this->productReserves = new ArrayCollection();
|
$this->productReserves = new ArrayCollection();
|
||||||
|
$this->contrats = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
@@ -254,4 +261,34 @@ class Customer
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection<int, Contrats>
|
||||||
|
*/
|
||||||
|
public function getContrats(): Collection
|
||||||
|
{
|
||||||
|
return $this->contrats;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addContrat(Contrats $contrat): static
|
||||||
|
{
|
||||||
|
if (!$this->contrats->contains($contrat)) {
|
||||||
|
$this->contrats->add($contrat);
|
||||||
|
$contrat->setCustomer($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeContrat(Contrats $contrat): static
|
||||||
|
{
|
||||||
|
if ($this->contrats->removeElement($contrat)) {
|
||||||
|
// set the owning side to null (unless already changed)
|
||||||
|
if ($contrat->getCustomer() === $this) {
|
||||||
|
$contrat->setCustomer(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ class Devis
|
|||||||
#[ORM\OneToOne(mappedBy: 'devis', cascade: ['persist', 'remove'])]
|
#[ORM\OneToOne(mappedBy: 'devis', cascade: ['persist', 'remove'])]
|
||||||
private ?ProductReserve $productReserve = null;
|
private ?ProductReserve $productReserve = null;
|
||||||
|
|
||||||
|
#[ORM\OneToOne(mappedBy: 'devis', cascade: ['persist', 'remove'])]
|
||||||
|
private ?Contrats $contrats = null;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->devisLines = new ArrayCollection();
|
$this->devisLines = new ArrayCollection();
|
||||||
@@ -450,4 +453,26 @@ class Devis
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getContrats(): ?Contrats
|
||||||
|
{
|
||||||
|
return $this->contrats;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setContrats(?Contrats $contrats): static
|
||||||
|
{
|
||||||
|
// unset the owning side of the relation if necessary
|
||||||
|
if ($contrats === null && $this->contrats !== null) {
|
||||||
|
$this->contrats->setDevis(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the owning side of the relation if necessary
|
||||||
|
if ($contrats !== null && $contrats->getDevis() !== $this) {
|
||||||
|
$contrats->setDevis($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->contrats = $contrats;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
124
src/Form/Type/ContratsType.php
Normal file
124
src/Form/Type/ContratsType.php
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Form\Type;
|
||||||
|
|
||||||
|
use App\Entity\Contrats;
|
||||||
|
use App\Entity\Customer;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
|
class ContratsType extends AbstractType
|
||||||
|
{
|
||||||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
{
|
||||||
|
$builder
|
||||||
|
->add('addressEvent',TextType::class,[
|
||||||
|
'label' =>'Adresse',
|
||||||
|
'required' => true,
|
||||||
|
])
|
||||||
|
->add('address2Event',TextType::class,[
|
||||||
|
'label' =>'Adresse 2',
|
||||||
|
'required' => true,
|
||||||
|
])
|
||||||
|
->add('address3Event',TextType::class,[
|
||||||
|
'label' =>'Adresse 3',
|
||||||
|
'required' => true,
|
||||||
|
])
|
||||||
|
->add('dateAt',DateTimeType::class,[
|
||||||
|
'label' =>'Date',
|
||||||
|
'widget' => 'single_text',
|
||||||
|
])
|
||||||
|
->add('endAt',DateTimeType::class,[
|
||||||
|
'label' =>'Date de fin',
|
||||||
|
'widget' => 'single_text',
|
||||||
|
])
|
||||||
|
->add('zipCodeEvent',TextType::class,[
|
||||||
|
'label' =>'Code postal',
|
||||||
|
'required' => true,
|
||||||
|
])
|
||||||
|
->add('townEvent',TextType::class,[
|
||||||
|
'label' =>'Ville',
|
||||||
|
'required' => true,
|
||||||
|
])
|
||||||
|
->add('customer',EntityType::class,[
|
||||||
|
'label' => 'Client',
|
||||||
|
'required' => true,
|
||||||
|
'class' => Customer::class,
|
||||||
|
// Utilisation d'une fonction anonyme pour concaténer Nom et Prénom
|
||||||
|
'choice_label' => function (Customer $customer) {
|
||||||
|
return sprintf('%s - %s',
|
||||||
|
strtoupper($customer->getSurname()), // Nom en majuscules
|
||||||
|
$customer->getName() // Prénom
|
||||||
|
);
|
||||||
|
},
|
||||||
|
'placeholder' => 'Sélectionnez un client...',
|
||||||
|
|
||||||
|
])
|
||||||
|
->add('type',ChoiceType::class,[
|
||||||
|
'label' => 'Type',
|
||||||
|
'required' => true,
|
||||||
|
'choices' => [
|
||||||
|
'Anniversaire enfant' => 'Anniversaire enfant',
|
||||||
|
'Kermesse scolaire' => 'Kermesse scolaire',
|
||||||
|
'Fête communale' => 'Fête communale',
|
||||||
|
'Événement d\'entreprise' => 'Événement d\'entreprise',
|
||||||
|
'Mariage' => 'Mariage',
|
||||||
|
'Autre' => 'Autre'
|
||||||
|
]
|
||||||
|
])
|
||||||
|
->add('details',TextareaType::class,[
|
||||||
|
'label' => 'Description',
|
||||||
|
'required' => false,
|
||||||
|
|
||||||
|
])
|
||||||
|
|
||||||
|
->add('typeSol',ChoiceType::class,[
|
||||||
|
'label' => 'Type de sol',
|
||||||
|
'required' => true,
|
||||||
|
'choices' => [
|
||||||
|
'Pelouse' => 'Pelouse',
|
||||||
|
'Béton' => 'Béton',
|
||||||
|
'Sable' => 'Sable',
|
||||||
|
'Gourdon' => 'Gourdon',
|
||||||
|
'Autre' => 'Autre'
|
||||||
|
]
|
||||||
|
])
|
||||||
|
->add('pente',ChoiceType::class,[
|
||||||
|
'label' => 'Pente',
|
||||||
|
'required' => true,
|
||||||
|
'choices' => [
|
||||||
|
'Plat' => 'Plat',
|
||||||
|
'Léger' => 'Léger',
|
||||||
|
'Important' => 'Important',
|
||||||
|
]
|
||||||
|
])
|
||||||
|
->add('access',TextareaType::class,[
|
||||||
|
'label' => 'Contraintes d\'accès',
|
||||||
|
'required' => false,
|
||||||
|
])
|
||||||
|
->add('distancePower',NumberType::class,[
|
||||||
|
'label' => 'Distance prise ↔ structure ',
|
||||||
|
'required' => false,
|
||||||
|
])
|
||||||
|
|
||||||
|
->add('notes',TextareaType::class,[
|
||||||
|
'label' => 'Notes',
|
||||||
|
'required' => false,
|
||||||
|
])
|
||||||
|
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver->setDefault('data_class',Contrats::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/Repository/ContratsPaymentsRepository.php
Normal file
43
src/Repository/ContratsPaymentsRepository.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\ContratsPayments;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<ContratsPayments>
|
||||||
|
*/
|
||||||
|
class ContratsPaymentsRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, ContratsPayments::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return ContratsPayments[] Returns an array of ContratsPayments objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('c')
|
||||||
|
// ->andWhere('c.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('c.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?ContratsPayments
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('c')
|
||||||
|
// ->andWhere('c.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
||||||
43
src/Repository/ContratsRepository.php
Normal file
43
src/Repository/ContratsRepository.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Contrats;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Contrats>
|
||||||
|
*/
|
||||||
|
class ContratsRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Contrats::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Contrats[] Returns an array of Contrats objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('c')
|
||||||
|
// ->andWhere('c.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('c.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Contrats
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('c')
|
||||||
|
// ->andWhere('c.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{% extends 'dashboard/base.twig' %}
|
{% extends 'dashboard/base.twig' %}
|
||||||
|
|
||||||
|
|
||||||
{% block title %}Création Contrat de location{% endblock %}
|
{% block title %}Création Contrat de location{% endblock %}
|
||||||
{% block title_header %}Nouveau <span class="text-blue-500">Contrat de location</span>{% endblock %}
|
{% block title_header %}Nouveau <span class="text-blue-500">Contrat de location</span>{% endblock %}
|
||||||
|
|
||||||
{% block actions %}
|
{% block actions %}
|
||||||
<a href="{{ path('app_crm_contrats') }}" class="flex items-center px-4 py-2 text-[10px] font-black text-slate-400 hover:text-white uppercase tracking-widest transition-all group">
|
<a href="{{ path('app_crm_contrats') }}" class="flex items-center px-4 py-2 text-[10px] font-black text-slate-400 hover:text-white uppercase tracking-widest transition-all group">
|
||||||
<svg class="w-4 h-4 mr-2 transform group-hover:-translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-4 h-4 mr-2 transform group-hover:-translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
@@ -13,4 +13,145 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
<div class="max-w-6xl mx-auto animate-in fade-in slide-in-from-bottom-4 duration-700 pb-20">
|
||||||
|
{{ form_start(form) }}
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-12 gap-8">
|
||||||
|
|
||||||
|
{# --- BLOC 01 : CLIENT & VIGILANCE --- #}
|
||||||
|
<div class="md:col-span-4 flex flex-col gap-8">
|
||||||
|
<div class="backdrop-blur-xl bg-slate-900/40 border border-white/5 rounded-[2.5rem] p-8 shadow-2xl flex-grow">
|
||||||
|
<h3 class="text-sm font-black text-blue-500 uppercase tracking-widest mb-8 flex items-center">
|
||||||
|
<span class="w-6 h-6 bg-blue-600/20 rounded-lg flex items-center justify-center mr-3 text-[10px]">01</span>
|
||||||
|
Client & Type
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="space-y-6">
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.customer, 'Client', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.customer, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.type, 'Type de contrat', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.type, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pt-6 border-t border-white/5">
|
||||||
|
{{ form_label(form.notes, 'Notes de vigilance', {'label_attr': {'class': 'text-[10px] font-black text-rose-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
<div class="relative group">
|
||||||
|
{{ form_widget(form.notes, {
|
||||||
|
'attr': {
|
||||||
|
'class': 'w-full bg-rose-500/5 border border-rose-500/10 rounded-2xl text-rose-100 placeholder:text-rose-500/30 focus:ring-rose-500/20 focus:border-rose-500/40 transition-all py-3.5 px-5 text-xs italic',
|
||||||
|
'placeholder': 'Ex: Client exigeant, chien, accès compliqué...',
|
||||||
|
'rows': '6'
|
||||||
|
}
|
||||||
|
}) }}
|
||||||
|
<div class="absolute top-4 right-4 text-rose-500/30 group-hover:text-rose-500 transition-colors">
|
||||||
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{# --- BLOC 02 & 03 : ADRESSE & TECHNIQUE --- #}
|
||||||
|
<div class="md:col-span-8 flex flex-col gap-8">
|
||||||
|
|
||||||
|
{# LIEU DE L'ÉVÉNEMENT #}
|
||||||
|
<div class="backdrop-blur-xl bg-slate-900/40 border border-white/5 rounded-[2.5rem] p-8 shadow-2xl">
|
||||||
|
<h3 class="text-sm font-black text-emerald-500 uppercase tracking-widest mb-8 flex items-center">
|
||||||
|
<span class="w-6 h-6 bg-emerald-600/20 rounded-lg flex items-center justify-center mr-3 text-[10px]">02</span>
|
||||||
|
Lieu de l'événement
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-5">
|
||||||
|
<div class="md:col-span-2">
|
||||||
|
{{ form_label(form.addressEvent, 'Adresse principale', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.addressEvent, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.address2Event, 'Complément d\'adresse 1', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.address2Event, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.address3Event, 'Complément d\'adresse 2', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.address3Event, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.zipCodeEvent, 'Code Postal', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.zipCodeEvent, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white font-mono focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.townEvent, 'Ville', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.townEvent, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div class="md:col-span-2">
|
||||||
|
{{ form_label(form.details, 'Précisions de livraison', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.details, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-blue-500/20 focus:border-blue-500 transition-all py-3.5 px-5', 'rows': '2'}}) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{# CONTRAINTES TECHNIQUES #}
|
||||||
|
<div class="backdrop-blur-xl bg-slate-900/60 border border-amber-500/10 rounded-[2.5rem] p-8 shadow-2xl">
|
||||||
|
<h3 class="text-sm font-black text-amber-500 uppercase tracking-widest mb-8 flex items-center">
|
||||||
|
<span class="w-6 h-6 bg-amber-600/20 rounded-lg flex items-center justify-center mr-3 text-[10px]">03</span>
|
||||||
|
Contraintes Techniques
|
||||||
|
</h3>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.typeSol, 'Nature du sol', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.typeSol, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-amber-500/20 focus:border-amber-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.pente, 'Pente / Dénivelé', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.pente, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-amber-500/20 focus:border-amber-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.access, 'Accès Camion', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.access, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-amber-500/20 focus:border-amber-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ form_label(form.distancePower, 'Point électrique', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block'}}) }}
|
||||||
|
{{ form_widget(form.distancePower, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-amber-500/20 focus:border-amber-500 transition-all py-3.5 px-5'}}) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{# --- BLOC 04 : PÉRIODE DE LOCATION (Nouveau bloc Bento horizontal) --- #}
|
||||||
|
<div class="mt-8 backdrop-blur-xl bg-blue-600/5 border border-blue-500/10 rounded-[2.5rem] p-8 shadow-2xl">
|
||||||
|
<h3 class="text-sm font-black text-blue-400 uppercase tracking-widest mb-8 flex items-center justify-center">
|
||||||
|
<span class="w-6 h-6 bg-blue-600/20 rounded-lg flex items-center justify-center mr-3 text-[10px]">04</span>
|
||||||
|
Période de location
|
||||||
|
</h3>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 max-w-4xl mx-auto">
|
||||||
|
<div class="group">
|
||||||
|
{{ form_label(form.dateAt, 'Début de l\'événement', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block text-center'}}) }}
|
||||||
|
{{ form_widget(form.dateAt, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white text-center focus:ring-blue-500/40 focus:border-blue-500 transition-all py-5 px-5 text-lg font-black'}}) }}
|
||||||
|
</div>
|
||||||
|
<div class="group">
|
||||||
|
{{ form_label(form.endAt, 'Fin de l\'événement', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-[0.2em] ml-1 mb-2 block text-center'}}) }}
|
||||||
|
{{ form_widget(form.endAt, {'attr': {'class': 'w-full bg-slate-950/50 border-white/5 rounded-2xl text-white text-center focus:ring-blue-500/40 focus:border-blue-500 transition-all py-5 px-5 text-lg font-black'}}) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{# --- BARRE D'ACTIONS --- #}
|
||||||
|
<div class="mt-12 flex items-center justify-end backdrop-blur-xl bg-slate-900/40 p-6 rounded-[3rem] border border-white/5 shadow-xl">
|
||||||
|
<button type="submit" class="group px-16 py-5 bg-blue-600 hover:bg-blue-500 text-white text-[11px] font-black uppercase tracking-[0.3em] rounded-[2rem] transition-all shadow-lg shadow-blue-600/30 flex items-center hover:scale-[1.02] active:scale-95">
|
||||||
|
Valider et Créer le contrat
|
||||||
|
<svg class="w-5 h-5 ml-4 transform group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M14 5l7 7m0 0l-7 7m7-7H3"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ form_end(form) }}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user