Fixed bug in depreciation display

This commit is contained in:
snipe
2013-12-03 03:02:00 -05:00
parent 9fe8ace39b
commit e49420f62d
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class Model extends Elegant {
public function depreciation()
{
return $this->belongsTo('Depreciation','id');
return $this->belongsTo('Depreciation','depreciation_id');
}
public function adminuser()
+7 -3
View File
@@ -35,9 +35,13 @@ Asset Models ::
<td>{{ $model->modelno }}</td>
<td><a href="{{ route('view/model', $model->id) }}">{{ ($model->assets->count()) }}</a></td>
<td>
@if ($model->depreciation)
{{ $model->depreciation->name }}
({{ $model->depreciation->months }} months)
@if (($model->depreciation) && ($model->depreciation->id > 0))
{{ $model->depreciation->name }}
({{ $model->depreciation->months }} months)
@else
No Depreciation
@endif
</td>