From ee2522571cffa62960e7252fd092c42c7e45f29c Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 27 Sep 2016 19:07:30 -0700 Subject: [PATCH] Fixes #2673 --- app/Http/Controllers/AccessoriesController.php | 4 ++-- app/Http/Controllers/AssetMaintenancesController.php | 4 ++-- app/Http/Controllers/AssetsController.php | 6 +++--- app/Http/Controllers/ComponentsController.php | 4 ++-- app/Http/Controllers/ConsumablesController.php | 6 +++--- app/Http/Controllers/LicensesController.php | 11 +++-------- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/AccessoriesController.php b/app/Http/Controllers/AccessoriesController.php index 7f8c6debea..ea20762fcc 100755 --- a/app/Http/Controllers/AccessoriesController.php +++ b/app/Http/Controllers/AccessoriesController.php @@ -92,7 +92,7 @@ class AccessoriesController extends Controller if (e(Input::get('purchase_cost')) == '0.00') { $accessory->purchase_cost = null; } else { - $accessory->purchase_cost = e(Input::get('purchase_cost')); + $accessory->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost')))p; } $accessory->qty = e(Input::get('qty')); @@ -126,7 +126,7 @@ class AccessoriesController extends Controller } return View::make('accessories/edit', compact('accessory')) - ->with('category_list', Helper::categoryList('accessory')) + ->with('category_list', erper::categoryList('accessory')) ->with('company_list', Helper::companyList()) ->with('location_list', Helper::locationsList()) ->with('manufacturer_list', Helper::manufacturerList()); diff --git a/app/Http/Controllers/AssetMaintenancesController.php b/app/Http/Controllers/AssetMaintenancesController.php index b7bdb81bbb..ea2a1bcce7 100644 --- a/app/Http/Controllers/AssetMaintenancesController.php +++ b/app/Http/Controllers/AssetMaintenancesController.php @@ -215,7 +215,7 @@ class AssetMaintenancesController extends Controller if (e(Input::get('cost')) == '') { $assetMaintenance->cost = ''; } else { - $assetMaintenance->cost = e(Input::get('cost')); + $assetMaintenance->cost = Helper::ParseFloat(e(Input::get('cost'))); } if (e(Input::get('notes')) == '') { @@ -363,7 +363,7 @@ class AssetMaintenancesController extends Controller if (e(Input::get('cost')) == '') { $assetMaintenance->cost = ''; } else { - $assetMaintenance->cost = e(Input::get('cost')); + $assetMaintenance->cost = Helper::ParseFloat(e(Input::get('cost'))); } if (e(Input::get('notes')) == '') { diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index c89d9f3d1d..8e9c3ba263 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -178,7 +178,7 @@ class AssetsController extends Controller if (e(Input::get('purchase_cost')) == '') { $asset->purchase_cost = null; } else { - $asset->purchase_cost = (e(Input::get('purchase_cost'))); + $asset->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost'))); } if (e(Input::get('purchase_date')) == '') { @@ -354,7 +354,7 @@ class AssetsController extends Controller } if ($request->has('purchase_cost')) { - $asset->purchase_cost = e(Helper::formatCurrencyOutput($request->input('purchase_cost'))); + $asset->purchase_cost = Helper::ParseFloat(e($request->input('purchase_cost'))); } else { $asset->purchase_cost = null; } @@ -1491,7 +1491,7 @@ class AssetsController extends Controller } if (Input::has('purchase_cost')) { - $update_array['purchase_cost'] = e(Input::get('purchase_cost')); + $update_array['purchase_cost'] = Helper::ParseFloat(e(Input::get('purchase_cost'))); } if (Input::has('supplier_id')) { diff --git a/app/Http/Controllers/ComponentsController.php b/app/Http/Controllers/ComponentsController.php index 5debde18fd..9de9b6733c 100644 --- a/app/Http/Controllers/ComponentsController.php +++ b/app/Http/Controllers/ComponentsController.php @@ -99,7 +99,7 @@ class ComponentsController extends Controller if (e(Input::get('purchase_cost')) == '0.00') { $component->purchase_cost = null; } else { - $component->purchase_cost = e(Input::get('purchase_cost')); + $component->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost'))); } $component->total_qty = e(Input::get('total_qty')); @@ -183,7 +183,7 @@ class ComponentsController extends Controller if (e(Input::get('purchase_cost')) == '0.00') { $component->purchase_cost = null; } else { - $component->purchase_cost = e(Input::get('purchase_cost')); + $component->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost'))); } $component->total_qty = e(Input::get('total_qty')); diff --git a/app/Http/Controllers/ConsumablesController.php b/app/Http/Controllers/ConsumablesController.php index 821c388fda..3743ff0bc5 100644 --- a/app/Http/Controllers/ConsumablesController.php +++ b/app/Http/Controllers/ConsumablesController.php @@ -97,7 +97,7 @@ class ConsumablesController extends Controller if (e(Input::get('purchase_cost')) == '0.00') { $consumable->purchase_cost = null; } else { - $consumable->purchase_cost = e(Input::get('purchase_cost')); + $consumable->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost'))); } $consumable->qty = e(Input::get('qty')); @@ -182,10 +182,10 @@ class ConsumablesController extends Controller if (e(Input::get('purchase_cost')) == '0.00') { $consumable->purchase_cost = null; } else { - $consumable->purchase_cost = e(Input::get('purchase_cost')); + $consumable->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost'))); } - $consumable->qty = e(Input::get('qty')); + $consumable->qty = Helper::ParseFloat(e(Input::get('qty'))); if ($consumable->save()) { return redirect()->to("admin/consumables")->with('success', trans('admin/consumables/message.update.success')); diff --git a/app/Http/Controllers/LicensesController.php b/app/Http/Controllers/LicensesController.php index b92f7a3c44..ec2720df96 100755 --- a/app/Http/Controllers/LicensesController.php +++ b/app/Http/Controllers/LicensesController.php @@ -87,17 +87,13 @@ class LicensesController extends Controller public function postCreate() { - - // get the POST data - $new = Input::all(); - // create a new model instance $license = new License(); if (e(Input::get('purchase_cost')) == '') { $license->purchase_cost = null; } else { - $license->purchase_cost = e(Input::get('purchase_cost')); + $license->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost'))); } if (e(Input::get('supplier_id')) == '') { @@ -289,10 +285,9 @@ class LicensesController extends Controller } if (e(Input::get('purchase_cost')) == '') { - $license->purchase_cost = null; + $license->purchase_cost = null; } else { - $license->purchase_cost = e(Input::get('purchase_cost')); - //$license->purchase_cost = e(Input::get('purchase_cost')); + $license->purchase_cost = Helper::ParseFloat(e(Input::get('purchase_cost'))); } if (e(Input::get('maintained')) == '') {