diff --git a/src/Entity/Warranty.php b/src/Entity/Warranty.php index c1e16d32..a0e71a99 100644 --- a/src/Entity/Warranty.php +++ b/src/Entity/Warranty.php @@ -121,12 +121,19 @@ class Warranty */ protected $claim_from; + // warranty activated + /** + * @ORM\Column(type="boolean") + */ + protected $flag_activated; + public function __construct() { $this->date_create = new DateTime(); $this->warranty_class = WarrantyClass::WTY_PRIVATE; $this->status = WarrantyStatus::ACTIVE; $this->date_claim = null; + $this->flag_activated = false; } public function getID() @@ -348,4 +355,15 @@ class Warranty { return $this->claim_from; } + + public function setActivated($flag_activated = true) + { + $this->flag_activated = $flag_activated; + return this; + } + + public function isActivated() + { + return $this->flag_activated; + } } diff --git a/templates/search/form.html.twig b/templates/search/form.html.twig index 892ca1ed..e1231721 100644 --- a/templates/search/form.html.twig +++ b/templates/search/form.html.twig @@ -197,6 +197,7 @@ Expiry Date Serial Battery + Status @@ -210,6 +211,13 @@ {{ result.getDateExpire|default("")|date('d M Y') }} {{ result.getSerial|default("") }} {{ result.getSAPBattery.getID|default("") }} + + {% if result.isActivated == true %} + Activated + {% else %} + Not Activated + {% endif %} + {% endfor %}