From 91e824c5b03995adbbde481eb004787be28f98bf Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 11 Aug 2022 18:25:07 -0700 Subject: [PATCH] Check for nullifying checkboxes Signed-off-by: snipe --- app/Http/Controllers/Assets/BulkAssetsController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index 418b70473e..52f3588e9a 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -103,6 +103,8 @@ class BulkAssetsController extends Controller || ($request->filled('company_id')) || ($request->filled('status_id')) || ($request->filled('model_id')) + || ($request->filled('null_purchase_date')) + || ($request->filled('null_expected_checkin_date')) ) { foreach ($assets as $assetId) { @@ -117,6 +119,14 @@ class BulkAssetsController extends Controller ->conditionallyAddItem('supplier_id') ->conditionallyAddItem('warranty_months'); + if ($request->input('null_purchase_date')=='1') { + $this->update_array['purchase_date'] = null; + } + + if ($request->input('null_expected_checkin_date')=='1') { + $this->update_array['expected_checkin'] = null; + } + if ($request->filled('purchase_cost')) { $this->update_array['purchase_cost'] = Helper::ParseCurrency($request->input('purchase_cost')); }