Skip to content

Commit 6846c7d

Browse files
authored
Merge pull request grokability#16536 from akemidx/moving_warranty_info
Moving warranty/depreciation to be with the other cost/eol values
2 parents 1d3069f + 5944034 commit 6846c7d

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

app/Http/Controllers/ReportsController.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,17 @@ public function postCustom(CustomAssetReportRequest $request) : StreamedResponse
493493
$header[] = trans('admin/hardware/table.eol');
494494
}
495495

496+
if ($request->filled('warranty')) {
497+
$header[] = trans('admin/hardware/form.warranty');
498+
$header[] = trans('admin/hardware/form.warranty_expires');
499+
}
500+
501+
if ($request->filled('depreciation')) {
502+
$header[] = trans('admin/hardware/table.book_value');
503+
$header[] = trans('admin/hardware/table.diff');
504+
$header[] = trans('admin/hardware/form.fully_depreciated');
505+
}
506+
496507
if ($request->filled('order')) {
497508
$header[] = trans('admin/hardware/form.order');
498509
}
@@ -579,17 +590,6 @@ public function postCustom(CustomAssetReportRequest $request) : StreamedResponse
579590
$header[] = trans('general.status');
580591
}
581592

582-
if ($request->filled('warranty')) {
583-
$header[] = trans('admin/hardware/form.warranty');
584-
$header[] = trans('admin/hardware/form.warranty_expires');
585-
}
586-
587-
if ($request->filled('depreciation')) {
588-
$header[] = trans('admin/hardware/table.book_value');
589-
$header[] = trans('admin/hardware/table.diff');
590-
$header[] = trans('admin/hardware/form.fully_depreciated');
591-
}
592-
593593
if ($request->filled('checkout_date')) {
594594
$header[] = trans('admin/hardware/table.checkout_date');
595595
}
@@ -805,6 +805,19 @@ public function postCustom(CustomAssetReportRequest $request) : StreamedResponse
805805
$row[] = ($asset->purchase_date != '') ? $asset->asset_eol_date : '';
806806
}
807807

808+
if ($request->filled('warranty')) {
809+
$row[] = ($asset->warranty_months) ? $asset->warranty_months : '';
810+
$row[] = $asset->present()->warranty_expires();
811+
}
812+
813+
if ($request->filled('depreciation')) {
814+
$depreciation = $asset->getDepreciatedValue();
815+
$diff = ($asset->purchase_cost - $depreciation);
816+
$row[] = Helper::formatCurrencyOutput($depreciation);
817+
$row[] = Helper::formatCurrencyOutput($diff);
818+
$row[] = (($asset->depreciation) && ($asset->depreciated_date())) ? $asset->depreciated_date()->format('Y-m-d') : '';
819+
}
820+
808821
if ($request->filled('order')) {
809822
$row[] = ($asset->order_number) ? $asset->order_number : '';
810823
}
@@ -938,19 +951,6 @@ public function postCustom(CustomAssetReportRequest $request) : StreamedResponse
938951
$row[] = ($asset->assetstatus) ? $asset->assetstatus->name.' ('.$asset->present()->statusMeta.')' : '';
939952
}
940953

941-
if ($request->filled('warranty')) {
942-
$row[] = ($asset->warranty_months) ? $asset->warranty_months : '';
943-
$row[] = $asset->present()->warranty_expires();
944-
}
945-
946-
if ($request->filled('depreciation')) {
947-
$depreciation = $asset->getDepreciatedValue();
948-
$diff = ($asset->purchase_cost - $depreciation);
949-
$row[] = Helper::formatCurrencyOutput($depreciation);
950-
$row[] = Helper::formatCurrencyOutput($diff);
951-
$row[] = (($asset->depreciation) && ($asset->depreciated_date())) ? $asset->depreciated_date()->format('Y-m-d') : '';
952-
}
953-
954954
if ($request->filled('checkout_date')) {
955955
$row[] = ($asset->last_checkout) ? $asset->last_checkout : '';
956956
}

resources/views/reports/custom.blade.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ class="form-control"
147147
{{ trans('admin/hardware/form.eol_date') }}
148148
</label>
149149

150+
<label class="form-control">
151+
<input type="checkbox" name="warranty" value="1" @checked($template->checkmarkValue('warranty')) />
152+
{{ trans('admin/hardware/form.warranty') }}
153+
</label>
154+
155+
<label class="form-control">
156+
<input type="checkbox" name="depreciation" value="1" @checked($template->checkmarkValue('depreciation')) />
157+
{{ trans('general.depreciation') }}
158+
</label>
159+
150160
<label class="form-control">
151161
<input type="checkbox" name="order" value="1" @checked($template->checkmarkValue('order')) />
152162
{{ trans('admin/hardware/form.order') }}
@@ -182,16 +192,6 @@ class="form-control"
182192
{{ trans('general.status') }}
183193
</label>
184194

185-
<label class="form-control">
186-
<input type="checkbox" name="warranty" value="1" @checked($template->checkmarkValue('warranty')) />
187-
{{ trans('admin/hardware/form.warranty') }}
188-
</label>
189-
190-
<label class="form-control">
191-
<input type="checkbox" name="depreciation" value="1" @checked($template->checkmarkValue('depreciation')) />
192-
{{ trans('general.depreciation') }}
193-
</label>
194-
195195
<label class="form-control">
196196
<input type="checkbox" name="checkout_date" value="1" @checked($template->checkmarkValue('checkout_date')) />
197197
{{ trans('admin/hardware/table.checkout_date') }}

0 commit comments

Comments
 (0)