Skip to content

A free open source IT asset/license management system

Merge branch 'fix-double-format' of https://github.com/dmeltzer/snipe-it into dmeltzer-fix-double-format

snipe4419dc7434ba
diff --cc app/Http/Controllers/AccessoriesController.php
index d5e8dd7e79,4aab46efb4..7f8c6debea
--- a/app/Http/Controllers/AccessoriesController.php
+++ b/app/Http/Controllers/AccessoriesController.php
@@@ -614,12 -617,10 +614,12 @@@ class AccessoriesController extends Con
'min_amt' => e($accessory->min_amt),
'location' => ($accessory->location) ? e($accessory->location->name): '',
'purchase_date' => e($accessory->purchase_date),
- 'purchase_cost' => number_format($accessory->purchase_cost, 2),
+ 'purchase_cost' => Helper::formatCurrencyOutput($accessory->purchase_cost),
'numRemaining' => $accessory->numRemaining(),
'actions' => $actions,
- 'companyName' => is_null($company) ? '' : e($company->name)
+ 'companyName' => is_null($company) ? '' : e($company->name),
+ 'manufacturer' => $accessory->manufacturer ? (string) link_to('/admin/settings/manufacturers/'.$accessory->manufacturer_id.'/view', $accessory->manufacturer->name) : ''
+
);
}
diff --cc app/Http/Controllers/ConsumablesController.php
index 1c9609d196,f4f8be380e..821c388fda
--- a/app/Http/Controllers/ConsumablesController.php
+++ b/app/Http/Controllers/ConsumablesController.php
@@@ -467,16 -467,16 +467,16 @@@ class ConsumablesController extends Con
$rows[] = array(
'id' => $consumable->id,
'name' => (string)link_to('admin/consumables/'.$consumable->id.'/view', e($consumable->name)),
- 'location' => ($consumable->location) ? e($consumable->location->name) : '',
- 'min_amt' => e($consumable->min_amt),
+ 'location' => ($consumable->location) ? e($consumable->location->name) : '',
+ 'min_amt' => e($consumable->min_amt),
'qty' => e($consumable->qty),
- 'manufacturer' => ($consumable->manufacturer) ? e($consumable->manufacturer->name) : '',
- 'model_no' => e($consumable->model_no),
- 'item_no' => e($consumable->item_no),
- 'category' => ($consumable->category) ? e($consumable->category->name) : 'Missing category',
+ 'manufacturer' => ($consumable->manufacturer) ? (string) link_to('/admin/settings/manufacturers/'.$consumable->manufacturer_id.'/view', $consumable->manufacturer->name): '',
+ 'model_no' => e($consumable->model_no),
+ 'item_no' => e($consumable->item_no),
+ 'category' => ($consumable->category) ? (string) link_to('/admin/settings/categories/'.$consumable->category_id.'/view', $consumable->category->name) : 'Missing category',
'order_number' => e($consumable->order_number),
- 'purchase_date' => e($consumable->purchase_date),
- 'purchase_cost' => ($consumable->purchase_cost!='') ? number_format($consumable->purchase_cost, 2): '' ,
+ 'purchase_date' => e($consumable->purchase_date),
+ 'purchase_cost' => Helper::formatCurrencyOutput($consumable->purchase_cost),
'numRemaining' => $consumable->numRemaining(),
'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name),
diff --cc app/Http/Controllers/LicensesController.php
index 671ac1e91f,fe668c7601..e03d17bce1
--- a/app/Http/Controllers/LicensesController.php
+++ b/app/Http/Controllers/LicensesController.php
@@@ -1023,16 -1012,15 +1023,16 @@@ class LicensesController extends Contro
'totalSeats' => $license->totalSeatsByLicenseID(),
'remaining' => $license->remaincount(),
'license_name' => e($license->license_name),
- 'license_email' => e($license->license_email),
+ 'license_email' => e($license->license_email),
'purchase_date' => ($license->purchase_date) ? $license->purchase_date : '',
- 'expiration_date' => ($license->expiration_date) ? $license->expiration_date : '',
- 'purchase_cost' => ($license->purchase_cost) ? number_format($license->purchase_cost, 2) : '',
- 'purchase_order' => ($license->purchase_order) ? e($license->purchase_order) : '',
- 'order_number' => ($license->order_number) ? e($license->order_number) : '',
- 'notes' => ($license->notes) ? e($license->notes) : '',
+ 'expiration_date' => ($license->expiration_date) ? $license->expiration_date : '',
+ 'purchase_cost' => Helper::formatCurrencyOutput($license->purchase_cost),
+ 'purchase_order' => ($license->purchase_order) ? e($license->purchase_order) : '',
+ 'order_number' => ($license->order_number) ? e($license->order_number) : '',
+ 'notes' => ($license->notes) ? e($license->notes) : '',
'actions' => $actions,
- 'companyName' => is_null($license->company) ? '' : e($license->company->name)
+ 'companyName' => is_null($license->company) ? '' : e($license->company->name),
+ 'manufacturer' => $license->manufacturer ? (string) link_to('/admin/settings/manufacturers/'.$license->manufacturer_id.'/view', $license->manufacturer->name) : ''
);
}