diff --git a/migrations/Version20260402203631.php b/migrations/Version20260402203631.php new file mode 100644 index 0000000..3e66306 --- /dev/null +++ b/migrations/Version20260402203631.php @@ -0,0 +1,35 @@ +addSql('ALTER TABLE devis ADD total_ht NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL'); + $this->addSql('ALTER TABLE devis ADD total_tva NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL'); + $this->addSql('ALTER TABLE devis ADD total_ttc NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE devis DROP total_ht'); + $this->addSql('ALTER TABLE devis DROP total_tva'); + $this->addSql('ALTER TABLE devis DROP total_ttc'); + } +} diff --git a/src/Entity/Devis.php b/src/Entity/Devis.php index 56ba2bf..624f23b 100644 --- a/src/Entity/Devis.php +++ b/src/Entity/Devis.php @@ -25,6 +25,15 @@ class Devis #[ORM\Column(length: 128)] private string $hmac; + #[ORM\Column(type: 'decimal', precision: 10, scale: 2, options: ['default' => '0.00'])] + private string $totalHt = '0.00'; + + #[ORM\Column(type: 'decimal', precision: 10, scale: 2, options: ['default' => '0.00'])] + private string $totalTva = '0.00'; + + #[ORM\Column(type: 'decimal', precision: 10, scale: 2, options: ['default' => '0.00'])] + private string $totalTtc = '0.00'; + #[ORM\Column(nullable: true)] private ?int $submitterSiteconseilId = null; @@ -82,6 +91,36 @@ class Devis return $this->hmac; } + public function getTotalHt(): string + { + return $this->totalHt; + } + + public function setTotalHt(string $totalHt): void + { + $this->totalHt = $totalHt; + } + + public function getTotalTva(): string + { + return $this->totalTva; + } + + public function setTotalTva(string $totalTva): void + { + $this->totalTva = $totalTva; + } + + public function getTotalTtc(): string + { + return $this->totalTtc; + } + + public function setTotalTtc(string $totalTtc): void + { + $this->totalTtc = $totalTtc; + } + public function getSubmitterSiteconseilId(): ?int { return $this->submitterSiteconseilId;