Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/Http/Controllers/BulkAssetModelsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,28 @@ public function update(Request $request): View | RedirectResponse
if (($request->filled('manufacturer_id') && ($request->input('manufacturer_id') != 'NC'))) {
$update_array['manufacturer_id'] = $request->input('manufacturer_id');
}

if (($request->filled('category_id') && ($request->input('category_id') != 'NC'))) {
$update_array['category_id'] = $request->input('category_id');
}

if ($request->input('fieldset_id') != 'NC') {
$update_array['fieldset_id'] = $request->input('fieldset_id');
}

if ($request->input('depreciation_id') != 'NC') {
$update_array['depreciation_id'] = $request->input('depreciation_id');
}

if ($request->filled('requestable') != '') {
if ($request->input('requestable') != '') {
$update_array['requestable'] = $request->input('requestable');
}

if ($request->filled('min_amt')) {
$update_array['min_amt'] = $request->input('min_amt');
}



if (count($update_array) > 0) {
AssetModel::whereIn('id', $models_raw_array)->update($update_array);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Transformers/AssetModelsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function transformAssetModel(AssetModel $assetmodel)
] : null,
'image' => ($assetmodel->image != '') ? Storage::disk('public')->url('models/'.e($assetmodel->image)) : null,
'model_number' => e($assetmodel->model_number),
'min_amt' => ($assetmodel->min_amt) ? (int) $assetmodel->min_amt : null,
'min_amt' => ($assetmodel->min_amt!='') ? (int) $assetmodel->min_amt : null,
'depreciation' => ($assetmodel->depreciation) ? [
'id' => (int) $assetmodel->depreciation->id,
'name'=> e($assetmodel->depreciation->name),
Expand Down
3 changes: 3 additions & 0 deletions resources/views/models/bulk-edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class="js-fieldset-field"
</div>
</div>

@include ('partials.forms.edit.minimum_quantity')


<!-- requestable -->
<div class="form-group{{ $errors->has('requestable') ? ' has-error' : '' }}">
<div class="col-md-7 col-md-offset-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<label for="min_amt" class="col-md-3 control-label">{{ trans('general.min_amt') }}</label>
<div class="col-md-9">
<div class="col-md-2" style="padding-left:0px">
<input class="form-control col-md-3" maxlength="5" type="text" name="min_amt" id="min_amt" aria-label="min_amt" value="{{ old('min_amt', $item->min_amt) }}"{{ (Helper::checkIfRequired($item, 'min_amt')) ? ' required' : '' }}/>
<input class="form-control col-md-3" maxlength="5" type="text" name="min_amt" id="min_amt" aria-label="min_amt" value="{{ old('min_amt', ($item->min_amt ?? '')) }}"{{ (isset($item) ?? (Helper::checkIfRequired($item, 'min_amt')) ? ' required' : '') }}/>
</div>
<div class="col-md-7" style="margin-left: -15px;">

Expand Down
Loading