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

Update RateCalculator.php #4851

Merged
merged 1 commit into from
May 17, 2024
Merged

Update RateCalculator.php #4851

merged 1 commit into from
May 17, 2024

Conversation

habibhaidari1
Copy link
Contributor

Using the interface makes you more flexible, so that you can change the rate service if necessary.

Description

A clear and concise description of what this pull request adds or changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I verified that my code applies to the guidelines (composer code-check)
  • I updated the documentation (see here)
  • I agree that this code is used in Kimai (see license)

Using the interface makes you more flexible, so that you can change the advice service if necessary
@CLAassistant
Copy link

CLAassistant commented May 12, 2024

CLA assistant check
All committers have signed the CLA.

@habibhaidari1
Copy link
Contributor Author

A bit of context:
The current rate calculator calculates the rate with second precision, but the items on the invoices are accurate to the hour with 2 decimal digits. This results in minimal rounding errors. So I made a little change in the Util class that forced me to override the whole service. I made these changes inside a bundle with the help of a compilerpass since I like to keep the core clean.

@kevinpapst
Copy link
Member

Can you share the other changes in a separate PR?

Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.78%. Comparing base (e042ef6) to head (b197d6b).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4851      +/-   ##
============================================
+ Coverage     87.77%   87.78%   +0.01%     
  Complexity     8963     8963              
============================================
  Files           797      797              
  Lines         29414    29414              
============================================
+ Hits          25819    25822       +3     
+ Misses         3595     3592       -3     
Files Coverage Δ
src/Timesheet/Calculator/RateCalculator.php 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@kevinpapst kevinpapst added this to the 2.17 milestone May 17, 2024
@kevinpapst kevinpapst merged commit e2c511c into kimai:main May 17, 2024
6 checks passed
@kevinpapst
Copy link
Member

Thanks @habibhaidari1 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants