Merge pull request #14949 from snipe/fixes/depreciation_format

Check that there is a depreciation date before formatting
This commit is contained in:
snipe 2024-06-24 11:11:43 +01:00 committed by GitHub
commit 3d32fe662b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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')) {