Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added employee profitability list #3525

Merged
merged 26 commits into from
Apr 16, 2024
Merged

Conversation

shubtiwari
Copy link

@shubtiwari shubtiwari commented Apr 7, 2024

Targets #3534

Description of the changes

  • Added Employee list on the Finance -> Report -> Employee
    • Add a new column named Employee earning
  • Add a Field to add threshold value
  • Show a table on Dashboard of Employee profitability list

Query need to be hit to add the permission value

INSERT INTO `permissions` (`name`, `guard_name`, `created_at`, `updated_at`, `label`, `category`, `description`) VALUES
('employee_profitability_list.view', 'web', NOW(), NOW(), NULL, NULL, NULL);

Breakdown & Estimates

Expected Time Range:

Actual Time:

Feedback Cycle

Cycle Count: 0

Checklist:

  • The PR title follows this syntax: <#IssueID> <PR Title>
  • I have linked the issue id in the PR description.
  • I have performed a self-review of my own code.
  • I have added comments on my code changes where required.

Copy link
Contributor

github-actions bot commented Apr 7, 2024

Coverage report for commit: e59722a
File: coverage.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ███████████████████████ │ 82.6%
  10% │ █░░░░░░░░░░░░░░░░░░░░░░ │  1.7%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ █░░░░░░░░░░░░░░░░░░░░░░ │  0.9%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
 100% │ █████░░░░░░░░░░░░░░░░░░ │ 14.8%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 2.93% | Methods: 5.14%
FilesLinesMethodsBranches
app/Casts
   Decrypted.php--100.00%
app/Console/Commands
   CheckCommand.php--100.00%
   FakeProdDataCommand.php2.00%11.11%100.00%
   Setup.php--100.00%
app/Console
   Kernel.php12.50%50.00%100.00%
app/Exceptions
   Handler.php--100.00%
app/Helpers
   ContentHelper.php--100.00%
   DateHelper.php--100.00%
   DecimalToWordsHelper.php--100.00%
   FileHelper.php--100.00%
app/Http/Controllers/Auth
   ForgotPasswordController.php--100.00%
   LoginController.php--100.00%
   RegisterController.php--100.00%
   ResetPasswordController.php--100.00%
app/Http/Controllers/CRM
   CRMController.php--100.00%
app/Http/Controllers
   ClientController.php--100.00%
   CommentController.php--100.00%
   Controller.php100.00%100.00%100.00%
   HomeController.php26.47%50.00%100.00%
   ProjectController.php--100.00%
   ProjectStageController.php--100.00%
   UserBookController.php--100.00%
   UserController.php--100.00%
app/Http/Controllers/Finance
   InvoiceController.php--100.00%
   PaymentController.php--100.00%
   ReportsController.php--100.00%
app/Http/Controllers/HR/Applications
   VolunteerApplicationController.php--100.00%
app/Http/Controllers/HR/Volunteers
   CampaignsController.php--100.00%
   ReportsController.php--100.00%
   VolunteerOpportunityController.php--100.00%
app/Http/Controllers/KnowledgeCafe
   KnowledgeCafeController.php--100.00%
   WeeklyDoseController.php--100.00%
app/Http/Controllers/KnowledgeCafe/Library
   BookCategoryController.php--100.00%
   BookCommentController.php--100.00%
   BookController.php--100.00%
app/Http/Controllers/Settings
   BankDetailController.php--100.00%
   HRController.php--100.00%
   NDAAgreementController.php--100.00%
   PermissionController.php--100.00%
   ProfitabilityController.php--100.00%
   SettingController.php--100.00%
app/Http
   Kernel.php100.00%100.00%100.00%
app/Http/Middleware
   EncryptCookies.php100.00%100.00%100.00%
   RedirectIfAuthenticated.php--100.00%
   TrimStrings.php100.00%100.00%100.00%
   TrustProxies.php100.00%100.00%100.00%
   VerifyCsrfToken.php100.00%100.00%100.00%
app/Http/Requests
   ClientRequest.php--100.00%
   ProjectRequest.php--100.00%
   ProjectStageRequest.php--100.00%
app/Http/Requests/Finance
   InvoiceRequest.php--100.00%
   PaymentRequest.php--100.00%
app/Http/Requests/KnowledgeCafe/Library
   BookCategoryRequest.php--100.00%
   BookRequest.php--100.00%
app/Http/Requests/KnowledgeCafe
   WeeklyDoseRequest.php--100.00%
app/Http/Requests/Setting
   SettingRequest.php--100.00%
   UpdateRolePermissionsRequest.php--100.00%
   UpdateUserRolesRequest.php--100.00%
app/Http/View/Composers
   CodeTrekApplicantsComposer.php100.00%100.00%100.00%
app/Imports
   ApplicationImport.php--100.00%
app/Listeners
   RemoveUserFromWebsite.php--100.00%
app/Mail
   DailyEffortSummary.php--100.00%
   ErrorReport.php--100.00%
   sendEmail.php--100.00%
app/Models
   BankDetails.php100.00%100.00%100.00%
   Category.php--100.00%
   Client.php--100.00%
   ClientCrmDetails.php--100.00%
   Comment.php--100.00%
   Country.php100.00%100.00%100.00%
   Project.php--100.00%
   ProjectStage.php--100.00%
   ProjectStageBilling.php--100.00%
   Resource.php--100.00%
   Setting.php--100.00%
   SkillSet.php100.00%100.00%100.00%
   Tag.php--100.00%
app/Models/Finance
   Invoice.php--100.00%
   Payment.php--100.00%
app/Models/Finance/PaymentModes
   Cash.php--100.00%
   Cheque.php--100.00%
   WireTransfer.php--100.00%
app/Models/KnowledgeCafe/Library
   Book.php13.79%13.64%100.00%
   BookAMonth.php--100.00%
   BookCategory.php--100.00%
app/Models/KnowledgeCafe
   WeeklyDose.php100.00%100.00%100.00%
app/Notifications
   ReviewNDA.php--100.00%
app/Policies
   ClientPolicy.php--100.00%
   ProjectPolicy.php--100.00%
   SettingPolicy.php--100.00%
   UserPolicy.php--100.00%
app/Policies/Finance
   InvoicePolicy.php--100.00%
   ReportPolicy.php--100.00%
app/Policies/Infrastructure
   BillingsPolicy.php--100.00%
app/Policies/KnowledgeCafe/Library
   BookCategoryPolicy.php--100.00%
   BookPolicy.php--100.00%
app/Policies/KnowledgeCafe
   WeeklyDosePolicy.php--100.00%
app/Providers
   AppServiceProvider.php100.00%100.00%100.00%
   ApplicantsComposerServiceProvider.php100.00%100.00%100.00%
   AuthServiceProvider.php100.00%100.00%100.00%
   BroadcastServiceProvider.php--100.00%
   DatabaseServiceProvider.php100.00%100.00%100.00%
   EventServiceProvider.php100.00%100.00%100.00%
   RouteServiceProvider.php100.00%100.00%100.00%
app/Rules
   TeamMemberDesignationRule.php--100.00%
   TeamMemberRule.php--100.00%
app/Services
   BookServices.php--100.00%
   CRMServices.php--100.00%
   CalendarEventService.php--100.00%
   EmployeeService.php--100.00%
   GSuiteUserService.php--100.00%
   WebsiteUserService.php--100.00%
app/Traits
   Encryptable.php--100.00%
   Filters.php--100.00%
   HasTags.php--100.00%

🤖 comment via lucassabreu/comment-coverage-clover

Copy link

cypress bot commented Apr 7, 2024

Passing run #8306 ↗︎

0 4 0 0 Flakiness 0

Details:

Merge e59722a into 40dfef8...
Project: Employee portal Commit: cd15f4b5e4 ℹ️
Status: Passed Duration: 00:30 💡
Started: Apr 16, 2024 11:15 AM Ended: Apr 16, 2024 11:15 AM

Review all test suite changes for PR #3525 ↗︎

@shubtiwari shubtiwari self-assigned this Apr 8, 2024
@shubtiwari shubtiwari changed the title Add employee profitability list Added employee profitability list Apr 9, 2024
Copy link
Member

@P4NK4J P4NK4J left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, @shubtiwari Please take a look

Comment on lines 18 to 23
Auth::user()->meta()->updateOrCreate(
['meta_key' => 'profitability_threshold_value'],
['meta_value' => $request->profitability_threshold_value]
);

return redirect()->back()->with('status', 'Saved Successfully!');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values should go in settings table rather than user_meta, since it's a system variable

@section('content')

@php
$route_name = Route::getCurrentRoute()->getName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use camelCasing for variables here, let's replace it with $routeName all across

@@ -30,6 +34,7 @@
<thead class="thead-dark">
<tr class="sticky-top">
<th>Name</th>
@if($route_name==="employee")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@if($route_name==="employee")
@if($routeName === "employee")

<th>
Employee Earning
<span class="tooltip-wrapper" data-html="true" data-toggle="tooltip" title="In Hours">
<i class="fa fa-info-circle" aria-hidden="true"></i>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than tooltip we need to use alert symbol here

<div class="col" id="user-settings-content">
<div class="card-body">
<h5 class="max-interview-heading fz-20"> Threshold value
<input type="number" class="col-xs text-center outline-none h-40 w-100 rounded-12 quantity" id="quantity" name="profitability_threshold_value" min="1" max="1000000" value="{{ old ('profitability_threshold_value', Auth::user()->metaValue('profitability_threshold_value')) }}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not put a limit here, it can increase and decrease as per the organizations steam

routes/web.php Outdated
Comment on lines 102 to 103
Route::get('/profitability-threshold-value', 'profitabilityController@index')->name('settings.profitability-threshold-value');
Route::post('/profitability-threshold-value', 'profitabilityController@update')->name('settings.update-profitability-threshold-value');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's minimum earning threshold to make an employee profitable, instead of a profitability threshold. Let's update the name, as profitability is not what is defined by this route variable. It can be employee-earning-threshold

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 3.31%. Comparing base (a7261f7) to head (131f258).
Report is 20 commits behind head on master.

❗ Current head 131f258 differs from pull request most recent head e59722a. Consider uploading reports for the commit e59722a to get more accurate results

Files Patch % Lines
...p/Controllers/Settings/ProfitabilityController.php 0.00% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             master   #3525      +/-   ##
===========================================
- Coverage      3.32%   3.31%   -0.02%     
- Complexity      588     590       +2     
===========================================
  Files           103     104       +1     
  Lines          2103    2112       +9     
===========================================
  Hits             70      70              
- Misses         2033    2042       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 29 to 30
Permission::updateOrCreate(['name' => 'employee_profitability_list.view']);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be in this seeder file. Please check if there are any seeder for employee. Add it there.

@shubtiwari shubtiwari force-pushed the feat/profitability-employee-list branch from c90f363 to 882f99e Compare April 16, 2024 10:56
@P4NK4J P4NK4J self-requested a review April 16, 2024 11:21
@P4NK4J P4NK4J merged commit 35a2f91 into master Apr 16, 2024
6 checks passed
@P4NK4J P4NK4J deleted the feat/profitability-employee-list branch April 16, 2024 11:21
@shubtiwari shubtiwari added the status : ready for review Items that are ready for code review label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status : ready for review Items that are ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants