Add flag_activated to the Warranty entity. Add Status field to Warranty results of search. #227
This commit is contained in:
parent
3083db9dc5
commit
baf7b51f14
2 changed files with 26 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@
|
|||
<th>Expiry Date</th>
|
||||
<th>Serial</th>
|
||||
<th>Battery</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -210,6 +211,13 @@
|
|||
<td>{{ result.getDateExpire|default("")|date('d M Y') }}</td>
|
||||
<td>{{ result.getSerial|default("") }}</td>
|
||||
<td>{{ result.getSAPBattery.getID|default("") }}</td>
|
||||
<td>
|
||||
{% if result.isActivated == true %}
|
||||
Activated
|
||||
{% else %}
|
||||
Not Activated
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Reference in a new issue