Skip to content

Commit a14d3ad

Browse files
authored
Merge pull request #16493 from snipe/min_qty_in_bulk_model_edit
Add min_qty to asset model bulk edit
2 parents 90329a2 + fcd0ca3 commit a14d3ad

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

app/Http/Controllers/BulkAssetModelsController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,28 @@ public function update(Request $request): View | RedirectResponse
7171
if (($request->filled('manufacturer_id') && ($request->input('manufacturer_id') != 'NC'))) {
7272
$update_array['manufacturer_id'] = $request->input('manufacturer_id');
7373
}
74+
7475
if (($request->filled('category_id') && ($request->input('category_id') != 'NC'))) {
7576
$update_array['category_id'] = $request->input('category_id');
7677
}
78+
7779
if ($request->input('fieldset_id') != 'NC') {
7880
$update_array['fieldset_id'] = $request->input('fieldset_id');
7981
}
82+
8083
if ($request->input('depreciation_id') != 'NC') {
8184
$update_array['depreciation_id'] = $request->input('depreciation_id');
8285
}
8386

84-
if ($request->filled('requestable') != '') {
87+
if ($request->input('requestable') != '') {
8588
$update_array['requestable'] = $request->input('requestable');
8689
}
8790

91+
if ($request->filled('min_amt')) {
92+
$update_array['min_amt'] = $request->input('min_amt');
93+
}
94+
95+
8896

8997
if (count($update_array) > 0) {
9098
AssetModel::whereIn('id', $models_raw_array)->update($update_array);

resources/views/models/bulk-edit.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ class="js-fieldset-field"
9090
</div>
9191
</div>
9292

93+
@include ('partials.forms.edit.minimum_quantity')
94+
95+
9396
<!-- requestable -->
9497
<div class="form-group{{ $errors->has('requestable') ? ' has-error' : '' }}">
9598
<div class="col-md-7 col-md-offset-3">

resources/views/partials/forms/edit/minimum_quantity.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<label for="min_amt" class="col-md-3 control-label">{{ trans('general.min_amt') }}</label>
44
<div class="col-md-9">
55
<div class="col-md-2" style="padding-left:0px">
6-
<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' : '' }}/>
6+
<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' : '') }}/>
77
</div>
88
<div class="col-md-7" style="margin-left: -15px;">
99

0 commit comments

Comments
 (0)