Fixed column name spelling in DB
This commit is contained in:
@@ -117,7 +117,7 @@ class AssetsController extends AdminController {
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->status_id = e(Input::get('status_id'));
|
||||
$asset->warrantee_months = e(Input::get('warrantee_months'));
|
||||
$asset->warranty_months = e(Input::get('warranty_months'));
|
||||
$asset->user_id = Sentry::getId();
|
||||
$asset->physical = '1';
|
||||
|
||||
@@ -192,7 +192,7 @@ class AssetsController extends AdminController {
|
||||
'asset_tag' => 'required|min:3',
|
||||
'model_id' => 'required',
|
||||
'serial' => 'required|min:3',
|
||||
'warrantee_months' => 'integer|min:1',
|
||||
'warranty_months' => 'integer|min:1',
|
||||
);
|
||||
|
||||
// Create a new validator instance from our validation rules
|
||||
@@ -215,7 +215,7 @@ class AssetsController extends AdminController {
|
||||
$asset->order_number = e(Input::get('order_number'));
|
||||
$asset->asset_tag = e(Input::get('asset_tag'));
|
||||
$asset->status_id = e(Input::get('status_id'));
|
||||
$asset->warrantee_months = e(Input::get('warrantee_months'));
|
||||
$asset->warranty_months = e(Input::get('warranty_months'));
|
||||
$asset->notes = e(Input::get('notes'));
|
||||
$asset->physical = '1';
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AlterWarrantyColumnOnAssets extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement('ALTER TABLE assets CHANGE warrantee_months warranty_months int (3)');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ class Asset extends Elegant {
|
||||
'asset_tag' => 'required|min:3|unique:assets',
|
||||
'model_id' => 'required',
|
||||
'serial' => 'required|min:3',
|
||||
'warrantee_months' => 'integer|min:1',
|
||||
'warranty_months' => 'integer|min:1',
|
||||
);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class Asset extends Elegant {
|
||||
|
||||
|
||||
$date = date_create($this->purchase_date);
|
||||
date_add($date, date_interval_create_from_date_string($this->warrantee_months.' months'));
|
||||
date_add($date, date_interval_create_from_date_string($this->warranty_months.' months'));
|
||||
return date_format($date, 'Y-m-d');
|
||||
|
||||
}
|
||||
|
||||
@@ -106,11 +106,11 @@
|
||||
</div>
|
||||
|
||||
<!-- Warrantee -->
|
||||
<div class="control-group {{ $errors->has('warrantee_months') ? 'error' : '' }}">
|
||||
<div class="control-group {{ $errors->has('warranty_months') ? 'error' : '' }}">
|
||||
<label class="control-label" for="serial">Warranty</label>
|
||||
<div class="controls">
|
||||
<input class="span1" type="text" name="warrantee_months" id="warrantee_months" value="{{ Input::old('warrantee_months', $asset->warrantee_months) }}" /> months
|
||||
{{ $errors->first('warrantee_months', '<span class="help-inline">:message</span>') }}
|
||||
<input class="span1" type="text" name="warranty_months" id="warranty_months" value="{{ Input::old('warranty_months', $asset->warranty_months) }}" /> months
|
||||
{{ $errors->first('warranty_months', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -110,8 +110,8 @@ View Asset {{ $asset->asset_tag }} ::
|
||||
@if ($asset->order_number)
|
||||
<li>Order #: {{ $asset->order_number }} </li>
|
||||
@endif
|
||||
@if ($asset->warrantee_months)
|
||||
<li>Warranty: {{ $asset->warrantee_months }} months</li>
|
||||
@if ($asset->warranty_months)
|
||||
<li>Warranty: {{ $asset->warranty_months }} months</li>
|
||||
<li>Expires: {{ $asset->warrantee_expires() }}</li>
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user