A free open source IT asset/license management system
Temp removed purchase price and order number from bulk assets editing
snipe040168f94604
diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.phpindex 1d5f189af0..40ccc09ae3 100644--- a/app/Http/Controllers/Assets/BulkAssetsController.php+++ b/app/Http/Controllers/Assets/BulkAssetsController.php@@ -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')diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.phpindex 52bd40a2a1..95191571e0 100755--- a/resources/views/hardware/bulk.blade.php+++ b/resources/views/hardware/bulk.blade.php@@ -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"