Check that there is a depreciation date before formatting

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-06-24 11:07:41 +01:00
parent 829b560794
commit 468674a517

View file

@ -933,7 +933,7 @@ class ReportsController extends Controller
$diff = ($asset->purchase_cost - $depreciation);
$row[] = Helper::formatCurrencyOutput($depreciation);
$row[] = Helper::formatCurrencyOutput($diff);
$row[] = ($asset->depreciation) ? $asset->depreciated_date()->format('Y-m-d') : '';
$row[] = (($asset->depreciation) && ($asset->depreciated_date())) ? $asset->depreciated_date()->format('Y-m-d') : '';
}
if ($request->filled('checkout_date')) {