Fixed depreciation bug
This commit is contained in:
@@ -21,7 +21,7 @@ class Asset extends Elegant {
|
||||
public function depreciate()
|
||||
{
|
||||
$depreciation_id = Model::find($this->model_id)->depreciation_id;
|
||||
if (isset($depreciation_id)) {
|
||||
if ($depreciation_id) {
|
||||
$depreciation_term = Depreciation::find($depreciation_id)->months;
|
||||
if($depreciation_term>0) {
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Depreciation Report
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ route('reports/export') }}">Download as CSV</a></li>
|
||||
<li><a href="#">Download as CSV</a></li>
|
||||
<li><a href="#">Download as PDF</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -66,9 +66,17 @@ Depreciation Report
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $asset->purchase_date }}</td>
|
||||
|
||||
@if ($asset->purchase_cost > 0)
|
||||
<td class="align-right">${{ number_format($asset->purchase_cost) }}</td>
|
||||
<td class="align-right">${{ number_format($asset->depreciate()) }}</td>
|
||||
<td class="align-right">-${{ number_format(($asset->purchase_cost - $asset->depreciate())) }}</td>
|
||||
@else
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user