mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 13:14:07 -08:00
parent
c9d1274edc
commit
3271c9dc9f
|
@ -77,7 +77,7 @@ class AccessoriesController extends Controller
|
||||||
$accessory->manufacturer_id = request('manufacturer_id');
|
$accessory->manufacturer_id = request('manufacturer_id');
|
||||||
$accessory->model_number = request('model_number');
|
$accessory->model_number = request('model_number');
|
||||||
$accessory->purchase_date = request('purchase_date');
|
$accessory->purchase_date = request('purchase_date');
|
||||||
$accessory->purchase_cost = Helper::ParseCurrency(request('purchase_cost'));
|
$accessory->purchase_cost = request('purchase_cost');
|
||||||
$accessory->qty = request('qty');
|
$accessory->qty = request('qty');
|
||||||
$accessory->user_id = Auth::user()->id;
|
$accessory->user_id = Auth::user()->id;
|
||||||
$accessory->supplier_id = request('supplier_id');
|
$accessory->supplier_id = request('supplier_id');
|
||||||
|
@ -180,7 +180,7 @@ class AccessoriesController extends Controller
|
||||||
$accessory->order_number = request('order_number');
|
$accessory->order_number = request('order_number');
|
||||||
$accessory->model_number = request('model_number');
|
$accessory->model_number = request('model_number');
|
||||||
$accessory->purchase_date = request('purchase_date');
|
$accessory->purchase_date = request('purchase_date');
|
||||||
$accessory->purchase_cost = Helper::ParseCurrency(request('purchase_cost'));
|
$accessory->purchase_cost = request('purchase_cost');
|
||||||
$accessory->qty = request('qty');
|
$accessory->qty = request('qty');
|
||||||
$accessory->supplier_id = request('supplier_id');
|
$accessory->supplier_id = request('supplier_id');
|
||||||
$accessory->notes = request('notes');
|
$accessory->notes = request('notes');
|
||||||
|
|
|
@ -121,7 +121,7 @@ class AssetMaintenancesController extends Controller
|
||||||
$assetMaintenance = new AssetMaintenance();
|
$assetMaintenance = new AssetMaintenance();
|
||||||
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
||||||
$assetMaintenance->is_warranty = $request->input('is_warranty');
|
$assetMaintenance->is_warranty = $request->input('is_warranty');
|
||||||
$assetMaintenance->cost = Helper::ParseCurrency($request->input('cost'));
|
$assetMaintenance->cost = $request->input('cost');
|
||||||
$assetMaintenance->notes = e($request->input('notes'));
|
$assetMaintenance->notes = e($request->input('notes'));
|
||||||
$asset = Asset::find(e($request->input('asset_id')));
|
$asset = Asset::find(e($request->input('asset_id')));
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ class AssetMaintenancesController extends Controller
|
||||||
|
|
||||||
$assetMaintenance->supplier_id = e($request->input('supplier_id'));
|
$assetMaintenance->supplier_id = e($request->input('supplier_id'));
|
||||||
$assetMaintenance->is_warranty = e($request->input('is_warranty'));
|
$assetMaintenance->is_warranty = e($request->input('is_warranty'));
|
||||||
$assetMaintenance->cost = Helper::ParseCurrency($request->input('cost'));
|
$assetMaintenance->cost = $request->input('cost');
|
||||||
$assetMaintenance->notes = e($request->input('notes'));
|
$assetMaintenance->notes = e($request->input('notes'));
|
||||||
|
|
||||||
$asset = Asset::find(request('asset_id'));
|
$asset = Asset::find(request('asset_id'));
|
||||||
|
|
|
@ -554,7 +554,7 @@ class AssetsController extends Controller
|
||||||
$asset->depreciate = '0';
|
$asset->depreciate = '0';
|
||||||
$asset->status_id = $request->get('status_id', 0);
|
$asset->status_id = $request->get('status_id', 0);
|
||||||
$asset->warranty_months = $request->get('warranty_months', null);
|
$asset->warranty_months = $request->get('warranty_months', null);
|
||||||
$asset->purchase_cost = Helper::ParseCurrency($request->get('purchase_cost')); // this is the API's store method, so I don't know that I want to do this? Confusing. FIXME (or not?!)
|
$asset->purchase_cost = $request->get('purchase_cost'); // this is the API's store method, so I don't know that I want to do this? Confusing. FIXME (or not?!)
|
||||||
$asset->purchase_date = $request->get('purchase_date', null);
|
$asset->purchase_date = $request->get('purchase_date', null);
|
||||||
$asset->assigned_to = $request->get('assigned_to', null);
|
$asset->assigned_to = $request->get('assigned_to', null);
|
||||||
$asset->supplier_id = $request->get('supplier_id');
|
$asset->supplier_id = $request->get('supplier_id');
|
||||||
|
|
|
@ -101,7 +101,7 @@ class AssetMaintenancesController extends Controller
|
||||||
$assetMaintenance = new AssetMaintenance();
|
$assetMaintenance = new AssetMaintenance();
|
||||||
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
||||||
$assetMaintenance->is_warranty = $request->input('is_warranty');
|
$assetMaintenance->is_warranty = $request->input('is_warranty');
|
||||||
$assetMaintenance->cost = Helper::ParseCurrency($request->input('cost'));
|
$assetMaintenance->cost = $request->input('cost');
|
||||||
$assetMaintenance->notes = $request->input('notes');
|
$assetMaintenance->notes = $request->input('notes');
|
||||||
$asset = Asset::find($request->input('asset_id'));
|
$asset = Asset::find($request->input('asset_id'));
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ class AssetMaintenancesController extends Controller
|
||||||
|
|
||||||
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
||||||
$assetMaintenance->is_warranty = $request->input('is_warranty');
|
$assetMaintenance->is_warranty = $request->input('is_warranty');
|
||||||
$assetMaintenance->cost = Helper::ParseCurrency($request->input('cost'));
|
$assetMaintenance->cost = $request->input('cost');
|
||||||
$assetMaintenance->notes = $request->input('notes');
|
$assetMaintenance->notes = $request->input('notes');
|
||||||
|
|
||||||
$asset = Asset::find(request('asset_id'));
|
$asset = Asset::find(request('asset_id'));
|
||||||
|
|
|
@ -140,7 +140,7 @@ class AssetsController extends Controller
|
||||||
$asset->depreciate = '0';
|
$asset->depreciate = '0';
|
||||||
$asset->status_id = request('status_id');
|
$asset->status_id = request('status_id');
|
||||||
$asset->warranty_months = request('warranty_months', null);
|
$asset->warranty_months = request('warranty_months', null);
|
||||||
$asset->purchase_cost = Helper::ParseCurrency($request->get('purchase_cost'));
|
$asset->purchase_cost = $request->get('purchase_cost');
|
||||||
$asset->purchase_date = request('purchase_date', null);
|
$asset->purchase_date = request('purchase_date', null);
|
||||||
$asset->asset_eol_date = request('asset_eol_date', null);
|
$asset->asset_eol_date = request('asset_eol_date', null);
|
||||||
$asset->assigned_to = request('assigned_to', null);
|
$asset->assigned_to = request('assigned_to', null);
|
||||||
|
@ -312,7 +312,7 @@ class AssetsController extends Controller
|
||||||
|
|
||||||
$asset->status_id = $request->input('status_id', null);
|
$asset->status_id = $request->input('status_id', null);
|
||||||
$asset->warranty_months = $request->input('warranty_months', null);
|
$asset->warranty_months = $request->input('warranty_months', null);
|
||||||
$asset->purchase_cost = Helper::ParseCurrency($request->input('purchase_cost', null));
|
$asset->purchase_cost = $request->input('purchase_cost', null);
|
||||||
$asset->asset_eol_date = request('asset_eol_date', null);
|
$asset->asset_eol_date = request('asset_eol_date', null);
|
||||||
|
|
||||||
$asset->purchase_date = $request->input('purchase_date', null);
|
$asset->purchase_date = $request->input('purchase_date', null);
|
||||||
|
|
|
@ -135,7 +135,7 @@ class BulkAssetsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->filled('purchase_cost')) {
|
if ($request->filled('purchase_cost')) {
|
||||||
$this->update_array['purchase_cost'] = Helper::ParseCurrency($request->input('purchase_cost'));
|
$this->update_array['purchase_cost'] = $request->input('purchase_cost');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->filled('company_id')) {
|
if ($request->filled('company_id')) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ class ComponentsController extends Controller
|
||||||
$component->min_amt = $request->input('min_amt', null);
|
$component->min_amt = $request->input('min_amt', null);
|
||||||
$component->serial = $request->input('serial', null);
|
$component->serial = $request->input('serial', null);
|
||||||
$component->purchase_date = $request->input('purchase_date', null);
|
$component->purchase_date = $request->input('purchase_date', null);
|
||||||
$component->purchase_cost = Helper::ParseCurrency($request->input('purchase_cost', null));
|
$component->purchase_cost = $request->input('purchase_cost', null);
|
||||||
$component->qty = $request->input('qty');
|
$component->qty = $request->input('qty');
|
||||||
$component->user_id = Auth::id();
|
$component->user_id = Auth::id();
|
||||||
$component->notes = $request->input('notes');
|
$component->notes = $request->input('notes');
|
||||||
|
@ -151,7 +151,7 @@ class ComponentsController extends Controller
|
||||||
$component->min_amt = $request->input('min_amt');
|
$component->min_amt = $request->input('min_amt');
|
||||||
$component->serial = $request->input('serial');
|
$component->serial = $request->input('serial');
|
||||||
$component->purchase_date = $request->input('purchase_date');
|
$component->purchase_date = $request->input('purchase_date');
|
||||||
$component->purchase_cost = Helper::ParseCurrency(request('purchase_cost'));
|
$component->purchase_cost = request('purchase_cost');
|
||||||
$component->qty = $request->input('qty');
|
$component->qty = $request->input('qty');
|
||||||
$component->notes = $request->input('notes');
|
$component->notes = $request->input('notes');
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class ConsumablesController extends Controller
|
||||||
$consumable->model_number = $request->input('model_number');
|
$consumable->model_number = $request->input('model_number');
|
||||||
$consumable->item_no = $request->input('item_no');
|
$consumable->item_no = $request->input('item_no');
|
||||||
$consumable->purchase_date = $request->input('purchase_date');
|
$consumable->purchase_date = $request->input('purchase_date');
|
||||||
$consumable->purchase_cost = Helper::ParseCurrency($request->input('purchase_cost'));
|
$consumable->purchase_cost = $request->input('purchase_cost');
|
||||||
$consumable->qty = $request->input('qty');
|
$consumable->qty = $request->input('qty');
|
||||||
$consumable->user_id = Auth::id();
|
$consumable->user_id = Auth::id();
|
||||||
$consumable->notes = $request->input('notes');
|
$consumable->notes = $request->input('notes');
|
||||||
|
@ -152,7 +152,7 @@ class ConsumablesController extends Controller
|
||||||
$consumable->model_number = $request->input('model_number');
|
$consumable->model_number = $request->input('model_number');
|
||||||
$consumable->item_no = $request->input('item_no');
|
$consumable->item_no = $request->input('item_no');
|
||||||
$consumable->purchase_date = $request->input('purchase_date');
|
$consumable->purchase_date = $request->input('purchase_date');
|
||||||
$consumable->purchase_cost = Helper::ParseCurrency($request->input('purchase_cost'));
|
$consumable->purchase_cost = $request->input('purchase_cost');
|
||||||
$consumable->qty = Helper::ParseFloat($request->input('qty'));
|
$consumable->qty = Helper::ParseFloat($request->input('qty'));
|
||||||
$consumable->notes = $request->input('notes');
|
$consumable->notes = $request->input('notes');
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ class LicensesController extends Controller
|
||||||
$license->name = $request->input('name');
|
$license->name = $request->input('name');
|
||||||
$license->notes = $request->input('notes');
|
$license->notes = $request->input('notes');
|
||||||
$license->order_number = $request->input('order_number');
|
$license->order_number = $request->input('order_number');
|
||||||
$license->purchase_cost = Helper::ParseCurrency($request->input('purchase_cost'));
|
$license->purchase_cost = $request->input('purchase_cost');
|
||||||
$license->purchase_date = $request->input('purchase_date');
|
$license->purchase_date = $request->input('purchase_date');
|
||||||
$license->purchase_order = $request->input('purchase_order');
|
$license->purchase_order = $request->input('purchase_order');
|
||||||
$license->purchase_order = $request->input('purchase_order');
|
$license->purchase_order = $request->input('purchase_order');
|
||||||
|
@ -164,7 +164,7 @@ class LicensesController extends Controller
|
||||||
$license->name = $request->input('name');
|
$license->name = $request->input('name');
|
||||||
$license->notes = $request->input('notes');
|
$license->notes = $request->input('notes');
|
||||||
$license->order_number = $request->input('order_number');
|
$license->order_number = $request->input('order_number');
|
||||||
$license->purchase_cost = Helper::ParseCurrency($request->input('purchase_cost'));
|
$license->purchase_cost = $request->input('purchase_cost');
|
||||||
$license->purchase_date = $request->input('purchase_date');
|
$license->purchase_date = $request->input('purchase_date');
|
||||||
$license->purchase_order = $request->input('purchase_order');
|
$license->purchase_order = $request->input('purchase_order');
|
||||||
$license->reassignable = $request->input('reassignable', 0);
|
$license->reassignable = $request->input('reassignable', 0);
|
||||||
|
|
|
@ -95,8 +95,8 @@ class AssetMaintenance extends Model implements ICompanyableChild
|
||||||
*/
|
*/
|
||||||
public function setCostAttribute($value)
|
public function setCostAttribute($value)
|
||||||
{
|
{
|
||||||
$value = Helper::ParseFloat($value);
|
$value = Helper::ParseCurrency($value);
|
||||||
if ($value == '0.0') {
|
if ($value == 0) {
|
||||||
$value = null;
|
$value = null;
|
||||||
}
|
}
|
||||||
$this->attributes['cost'] = $value;
|
$this->attributes['cost'] = $value;
|
||||||
|
|
|
@ -21,9 +21,9 @@ class SnipeModel extends Model
|
||||||
*/
|
*/
|
||||||
public function setPurchaseCostAttribute($value)
|
public function setPurchaseCostAttribute($value)
|
||||||
{
|
{
|
||||||
$value = Helper::ParseFloat($value);
|
$value = Helper::ParseCurrency($value);
|
||||||
|
|
||||||
if ($value == '0.0') {
|
if ($value == 0) {
|
||||||
$value = null;
|
$value = null;
|
||||||
}
|
}
|
||||||
$this->attributes['purchase_cost'] = $value;
|
$this->attributes['purchase_cost'] = $value;
|
||||||
|
|
Loading…
Reference in a new issue