Merge branch '203-add-tnv-warranty-to-battery' into 'master'
Resolve "Add TNV Warranty to Battery" Closes #203 See merge request jankstudio/resq!237
This commit is contained in:
commit
680f27316f
4 changed files with 31 additions and 0 deletions
|
|
@ -119,6 +119,7 @@ class BatteryController extends BaseController
|
|||
$row['sell_price'] = $orow[0]->getSellingPrice();
|
||||
$row['warr_private'] = $orow[0]->getWarrantyPrivate();
|
||||
$row['warr_commercial'] = $orow[0]->getWarrantyCommercial();
|
||||
$row['warr_tnv'] = $orow[0]->getWarrantyTnv();
|
||||
$row['res_capacity'] = $orow[0]->getReserveCapacity();
|
||||
$row['length'] = $orow[0]->getLength();
|
||||
$row['width'] = $orow[0]->getWidth();
|
||||
|
|
@ -181,6 +182,7 @@ class BatteryController extends BaseController
|
|||
->setSAPCode($req->request->get('sap_code'))
|
||||
->setWarrantyPrivate($req->request->get('warr_private'))
|
||||
->setWarrantyCommercial($req->request->get('warr_commercial'))
|
||||
->setWarrantyTnv($req->request->get('warr_tnv'))
|
||||
->setReserveCapacity($req->request->get('res_capacity'))
|
||||
->setLength($req->request->get('length'))
|
||||
->setWidth($req->request->get('width'))
|
||||
|
|
@ -303,6 +305,7 @@ class BatteryController extends BaseController
|
|||
->setSAPCode($req->request->get('sap_code'))
|
||||
->setWarrantyPrivate($req->request->get('warr_private'))
|
||||
->setWarrantyCommercial($req->request->get('warr_commercial'))
|
||||
->setWarrantyTnv($req->request->get('warr_tnv'))
|
||||
->setReserveCapacity($req->request->get('res_capacity'))
|
||||
->setLength($req->request->get('length'))
|
||||
->setWidth($req->request->get('width'))
|
||||
|
|
|
|||
|
|
@ -85,6 +85,13 @@ class Battery
|
|||
*/
|
||||
protected $warr_commercial;
|
||||
|
||||
// warranty tnv
|
||||
/**
|
||||
* @ORM\Column(type="smallint")
|
||||
* @Assert\NotBlank()
|
||||
*/
|
||||
protected $warr_tnv;
|
||||
|
||||
// reserve capacity
|
||||
/**
|
||||
* @ORM\Column(type="smallint")
|
||||
|
|
@ -248,6 +255,17 @@ class Battery
|
|||
return $this->warr_commercial;
|
||||
}
|
||||
|
||||
public function setWarrantyTnv($warr_tnv)
|
||||
{
|
||||
$this->warr_tnv = $warr_tnv;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWarrantyTnv()
|
||||
{
|
||||
return $this->warr_tnv;
|
||||
}
|
||||
|
||||
public function setReserveCapacity($res_capacity)
|
||||
{
|
||||
$this->res_capacity = $res_capacity;
|
||||
|
|
|
|||
|
|
@ -157,6 +157,14 @@
|
|||
<div class="form-control-feedback hide" data-field="warr_commercial"></div>
|
||||
<span class="m-form__help">In months</span>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<label data-field="warr_tnv">
|
||||
TNV
|
||||
</label>
|
||||
<input type="number" name="warr_tnv" class="form-control m-input" value="{{ obj.getWarrantyTnv }}">
|
||||
<div class="form-control-feedback hide" data-field="warr_tnv"></div>
|
||||
<span class="m-form__help">In months</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
||||
|
|
|
|||
2
utils/battery_warranty/set_tnv_warranty.sql
Normal file
2
utils/battery_warranty/set_tnv_warranty.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
update battery as batt inner join battery_model as bmodel on batt.model_id = bmodel.id set batt.warr_tnv=12 where bmodel.name='GOLD';
|
||||
|
||||
Loading…
Reference in a new issue