-
-
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.
Merge pull request #1033 from vsposato/feature/865_fixIssuesFromSnipe
Feature/865 fix issues from snipe
- Loading branch information
Showing
10 changed files
with
702 additions
and
669 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -576,20 +576,30 @@ public function exportAssetMaintenancesReport() | |
return $response; | ||
} | ||
|
||
/** | ||
* getAssetAcceptanceReport | ||
* | ||
* @return mixed | ||
* @author Vincent Sposato <[email protected]> | ||
* @version v1.0 | ||
*/ | ||
public function getAssetAcceptanceReport() | ||
{ | ||
|
||
if (count($this->getAssetsNotAcceptedYet()) > 0) { | ||
$assetsForReport = Actionlog::whereIn( 'id', $this->getAssetsNotAcceptedYet())->get(); | ||
} else { | ||
$assetsForReport = null; | ||
} | ||
|
||
$assetsForReport = Asset::notYetAccepted() | ||
->get(); | ||
|
||
return View::make( 'backend/reports/unaccepted_assets', compact( 'assetsForReport' ) ); | ||
|
||
} | ||
|
||
/** | ||
* exportAssetAcceptanceReport | ||
* | ||
* @return \Illuminate\Http\Response | ||
* @author Vincent Sposato <[email protected]> | ||
* @version v1.0 | ||
*/ | ||
public function exportAssetAcceptanceReport() | ||
{ | ||
|
||
|
@@ -604,9 +614,7 @@ public function exportAssetAcceptanceReport() | |
Lang::get( 'admin/hardware/form.model' ), | ||
Lang::get( 'admin/hardware/form.name' ), | ||
Lang::get( 'admin/hardware/table.asset_tag' ), | ||
Lang::get( 'admin/hardware/table.checkout_date' ), | ||
Lang::get( 'admin/hardware/table.checkoutto' ), | ||
Lang::get( 'admin/hardware/table.days_without_acceptance' ), | ||
]; | ||
|
||
$header = array_map( 'trim', $header ); | ||
|
@@ -618,9 +626,7 @@ public function exportAssetAcceptanceReport() | |
$row[] = str_replace( ',', '', $assetItem->assetlog->model->name ); | ||
$row[] = str_replace( ',', '', $assetItem->assetlog->showAssetName() ); | ||
$row[] = str_replace( ',', '', $assetItem->assetlog->asset_tag ); | ||
$row[] = $assetItem->created_at->format( 'Y-m-d' ); | ||
$row[] = str_replace( ',', '', $assetItem->assetlog->assigneduser->fullName() ); | ||
$row[] = $assetItem->created_at->diffInDays( Carbon::now() ); | ||
$rows[] = implode( $row, ',' ); | ||
} | ||
|
||
|
@@ -712,13 +718,6 @@ protected function getAssetsCheckedOutRequiringAcceptance() | |
protected function getAssetsNotAcceptedYet() | ||
{ | ||
|
||
if (count($this->getAssetsCheckedOutRequiringAcceptance()) > 0) { | ||
return array_pluck( | ||
Actionlog::getUnacceptedAssets( $this->getAssetsCheckedOutRequiringAcceptance() ), | ||
'id' ); | ||
} else { | ||
return null; | ||
} | ||
|
||
return Asset::unaccepted(); | ||
} | ||
} |
Oops, something went wrong.