Check for nullifying checkboxes

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-08-11 18:25:07 -07:00
parent 491cdd4de6
commit 91e824c5b0

View file

@ -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'));
}