3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 03:06:23 +00:00

Temp removed purchase price and order number from bulk assets editing

This commit is contained in:
snipe
2026-08-11 22:21:06 +01:00
parent e49ac24f19
commit 040168f946
2 changed files with 17 additions and 27 deletions

View File

@ -292,12 +292,18 @@ class BulkAssetsController extends Controller
* make sense (for example, changing the status ID to something incompatible with
* its checkout status.
*/
// purchase_cost and order_number are intentionally not bulk-editable.
// Assets carry no currency column, so bulk-writing purchase_cost on
// rows that trace back to an Order can silently diverge from
// order_items.price and misrepresent the currency of the original
// purchase. Removing them from both the "should we build an update
// array" trigger AND from the conditionallyAddItem chain below
// prevents both UI-form and hand-crafted-POST callers from setting
// them via bulk edit. Single-asset edit still allows both.
if (($request->filled('name'))
|| ($request->filled('purchase_date'))
|| ($request->filled('expected_checkin'))
|| ($request->filled('purchase_cost'))
|| ($request->filled('supplier_id'))
|| ($request->filled('order_number'))
|| ($request->filled('warranty_months'))
|| ($request->filled('rtd_location_id'))
|| ($request->filled('requestable'))
@ -332,7 +338,6 @@ class BulkAssetsController extends Controller
$this->conditionallyAddItem('name')
->conditionallyAddItem('purchase_date')
->conditionallyAddItem('expected_checkin')
->conditionallyAddItem('order_number')
->conditionallyAddItem('requestable')
->conditionallyAddItem('supplier_id')
->conditionallyAddItem('warranty_months')

View File

@ -167,19 +167,13 @@
input_div_class="col-md-9 col-md-offset-3"
/>
{{-- Purchase cost with tenant-currency prefix addon. The
row component's built-in input_group_addon only carries
an icon, not free text, so this stays as slot:input. --}}
<x-form.row
:label="trans('admin/hardware/form.cost')"
name="purchase_cost"
input_div_class="input-group col-md-3"
>
<x-slot:input>
<span class="input-group-addon">{{ $snipeSettings->default_currency }}</span>
<input type="text" class="form-control" pattern="^\d+([.,]\d+)?$" maxlength="10" placeholder="{{ trans('admin/hardware/form.cost') }}" name="purchase_cost" id="purchase_cost" value="{{ old('purchase_cost') }}">
</x-slot:input>
</x-form.row>
{{-- purchase_cost and order_number are intentionally not
bulk-editable here. Assets have no currency column, so
bulk-writing purchase_cost on rows that trace back to an
Order can silently diverge from order_items.price and
misrepresent the currency of the original purchase. The
single-asset edit form still exposes both, and the
controller enforces this omission on the POST side too. --}}
<x-input.supplier-select
:label="trans('general.supplier')"
@ -193,17 +187,8 @@
:selected="old('company_id')"
/>
{{-- Order number --}}
<x-form.row
:label="trans('admin/hardware/form.order')"
name="order_number"
type="text"
:maxlength="200"
input_div_class="col-md-7"
/>
{{-- Warranty months with unit-suffix addon. Same reason as
purchase_cost free-text addon needs slot:input. --}}
{{-- Warranty months with unit-suffix addon. Free-text addon
needs slot:input. --}}
<x-form.row
:label="trans('admin/hardware/form.warranty')"
name="warranty_months"