Add flag_activated to the Warranty entity. Add Status field to Warranty results of search. #227

This commit is contained in:
Korina Cordero 2019-07-01 07:46:54 +00:00
parent 3083db9dc5
commit baf7b51f14
2 changed files with 26 additions and 0 deletions

View file

@ -121,12 +121,19 @@ class Warranty
*/ */
protected $claim_from; protected $claim_from;
// warranty activated
/**
* @ORM\Column(type="boolean")
*/
protected $flag_activated;
public function __construct() public function __construct()
{ {
$this->date_create = new DateTime(); $this->date_create = new DateTime();
$this->warranty_class = WarrantyClass::WTY_PRIVATE; $this->warranty_class = WarrantyClass::WTY_PRIVATE;
$this->status = WarrantyStatus::ACTIVE; $this->status = WarrantyStatus::ACTIVE;
$this->date_claim = null; $this->date_claim = null;
$this->flag_activated = false;
} }
public function getID() public function getID()
@ -348,4 +355,15 @@ class Warranty
{ {
return $this->claim_from; return $this->claim_from;
} }
public function setActivated($flag_activated = true)
{
$this->flag_activated = $flag_activated;
return this;
}
public function isActivated()
{
return $this->flag_activated;
}
} }

View file

@ -197,6 +197,7 @@
<th>Expiry Date</th> <th>Expiry Date</th>
<th>Serial</th> <th>Serial</th>
<th>Battery</th> <th>Battery</th>
<th>Status</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -210,6 +211,13 @@
<td>{{ result.getDateExpire|default("")|date('d M Y') }}</td> <td>{{ result.getDateExpire|default("")|date('d M Y') }}</td>
<td>{{ result.getSerial|default("") }}</td> <td>{{ result.getSerial|default("") }}</td>
<td>{{ result.getSAPBattery.getID|default("") }}</td> <td>{{ result.getSAPBattery.getID|default("") }}</td>
<td>
{% if result.isActivated == true %}
Activated
{% else %}
Not Activated
{% endif %}
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>