-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed all issues that were reported by @leobg
Also, renamed and fixed items of concern by @snipe Renamed Improvements to Asset Maintenances
- Loading branch information
Showing
26 changed files
with
1,388 additions
and
1,279 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
use Lang; | ||
use Asset; | ||
use Supplier; | ||
use AssetMaintenance; | ||
use Statuslabel; | ||
use User; | ||
use Setting; | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
use Asset; | ||
use Illuminate\Support\Facades\Lang; | ||
use Illuminate\Support\Facades\Response; | ||
use Improvement; | ||
use AssetMaintenance; | ||
use Input; | ||
use License; | ||
use Location; | ||
|
@@ -490,15 +490,15 @@ public function postCustom() | |
* @author Vincent Sposato <[email protected]> | ||
* @version v1.0 | ||
*/ | ||
public function getImprovementsReport() | ||
public function getAssetMaintenancesReport() | ||
{ | ||
|
||
// Grab all the improvements | ||
$improvements = Improvement::with( 'asset', 'supplier' ) | ||
$assetMaintenances = \AssetMaintenance::with( 'asset', 'supplier' ) | ||
->orderBy( 'created_at', 'DESC' ) | ||
->get(); | ||
|
||
return View::make( 'backend/reports/improvements', compact( 'improvements' ) ); | ||
return View::make( 'backend/reports/asset_maintenances', compact( 'assetMaintenances' ) ); | ||
|
||
} | ||
|
||
|
@@ -509,46 +509,46 @@ public function getImprovementsReport() | |
* @author Vincent Sposato <[email protected]> | ||
* @version v1.0 | ||
*/ | ||
public function exportImprovementsReport() | ||
public function exportAssetMaintenancesReport() | ||
{ | ||
|
||
// Grab all the improvements | ||
$improvements = Improvement::with( 'asset', 'supplier' ) | ||
$assetMaintenances = AssetMaintenance::with( 'asset', 'supplier' ) | ||
->orderBy( 'created_at', 'DESC' ) | ||
->get(); | ||
|
||
$rows = [ ]; | ||
|
||
$header = [ | ||
Lang::get( 'admin/improvements/table.asset_name' ), | ||
Lang::get( 'admin/improvements/table.supplier_name' ), | ||
Lang::get( 'admin/improvements/form.improvement_type' ), | ||
Lang::get( 'admin/improvements/form.title' ), | ||
Lang::get( 'admin/improvements/form.start_date' ), | ||
Lang::get( 'admin/improvements/form.completion_date' ), | ||
Lang::get( 'admin/improvements/form.improvement_time' ), | ||
Lang::get( 'admin/improvements/form.cost' ) | ||
Lang::get( 'admin/asset_maintenances/table.asset_name' ), | ||
Lang::get( 'admin/asset_maintenances/table.supplier_name' ), | ||
Lang::get( 'admin/asset_maintenances/form.asset_maintenance_type' ), | ||
Lang::get( 'admin/asset_maintenances/form.title' ), | ||
Lang::get( 'admin/asset_maintenances/form.start_date' ), | ||
Lang::get( 'admin/asset_maintenances/form.completion_date' ), | ||
Lang::get( 'admin/asset_maintenances/form.asset_maintenance_time' ), | ||
Lang::get( 'admin/asset_maintenances/form.cost' ) | ||
]; | ||
|
||
$header = array_map( 'trim', $header ); | ||
$rows[ ] = implode( $header, ',' ); | ||
|
||
foreach ($improvements as $improvement) { | ||
foreach ($assetMaintenances as $assetMaintenance) { | ||
$row = [ ]; | ||
$row[ ] = str_replace( ',', '', $improvement->asset->name ); | ||
$row[ ] = str_replace( ',', '', $improvement->supplier->name ); | ||
$row[ ] = $improvement->improvement_type; | ||
$row[ ] = $improvement->title; | ||
$row[ ] = $improvement->start_date; | ||
$row[ ] = $improvement->completion_date; | ||
if (is_null( $improvement->improvement_time )) { | ||
$row[ ] = str_replace( ',', '', $assetMaintenance->asset->name ); | ||
$row[ ] = str_replace( ',', '', $assetMaintenance->supplier->name ); | ||
$row[ ] = $assetMaintenance->improvement_type; | ||
$row[ ] = $assetMaintenance->title; | ||
$row[ ] = $assetMaintenance->start_date; | ||
$row[ ] = $assetMaintenance->completion_date; | ||
if (is_null( $assetMaintenance->asset_maintenance_time )) { | ||
$improvementTime = intval( Carbon::now() | ||
->diffInDays( Carbon::parse( $improvement->start_date ) ) ); | ||
->diffInDays( Carbon::parse( $assetMaintenance->start_date ) ) ); | ||
} else { | ||
$improvementTime = intval( $improvement->improvement_time ); | ||
$improvementTime = intval( $assetMaintenance->asset_maintenance_time ); | ||
} | ||
$row[ ] = $improvementTime; | ||
$row[ ] = Lang::get( 'general.currency' ) . number_format( $improvement->cost, 2 ); | ||
$row[ ] = Lang::get( 'general.currency' ) . number_format( $assetMaintenance->cost, 2 ); | ||
$rows[ ] = implode( $row, ',' ); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
use AdminController; | ||
use Image; | ||
use AssetMaintenance; | ||
use Input; | ||
use Lang; | ||
use Supplier; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
return [ | ||
'asset_maintenance_type' => 'Asset Maintenance Type', | ||
'title' => 'Title', | ||
'start_date' => 'Start Date', | ||
'completion_date' => 'Completion Date', | ||
'cost' => 'Cost', | ||
'is_warranty' => 'Warranty Improvement', | ||
'asset_maintenance_time' => 'Asset Maintenance Time (in days)', | ||
'notes' => 'Notes', | ||
'update' => 'Update Asset Maintenance', | ||
'create' => 'Create Asset Maintenance' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
return [ | ||
'asset_maintenances' => 'Asset Maintenances', | ||
'edit' => 'Edit Asset Maintenance', | ||
'delete' => 'Delete Asset Maintenance', | ||
'view' => 'View Asset Maintenance Details', | ||
'repair' => 'Repair', | ||
'maintenance' => 'Maintenance', | ||
'upgrade' => 'Upgrade' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
return [ | ||
'not_found' => 'Asset Maintenance you were looking for was not found!', | ||
'delete' => [ | ||
'confirm' => 'Are you sure you wish to delete this asset maintenance?', | ||
'error' => 'There was an issue deleting the asset maintenance. Please try again.', | ||
'success' => 'The asset maintenance was deleted successfully.' | ||
], | ||
'create' => [ | ||
'error' => 'Asset Maintenance was not created, please try again.', | ||
'success' => 'Asset Maintenance created successfully.' | ||
], | ||
'asset_maintenance_incomplete' => 'Not Completed Yet', | ||
'warranty' => 'Warranty', | ||
'not_warranty' => 'Not Warranty', | ||
]; |
2 changes: 1 addition & 1 deletion
2
app/lang/en/admin/improvements/table.php → ...ang/en/admin/asset_maintenances/table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.