Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
reset internal rate upon saving (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Dec 9, 2020
1 parent a0c53d4 commit 183e361
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Changelog

## 0.2 (unreleased)
## 0.2

- Added GitHub actions for basic CI
- Code Styles
- Reset "internal rates" in newer Kimai versions

Compatible with Kimai 0.9
Compatible with Kimai > 1.9

## 0.1

Expand Down
4 changes: 4 additions & 0 deletions Timesheet/Calculator/RecalculateRateCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function calculate(Timesheet $record)
$record->setFixedRate(null);
}

if (null !== $record->getInternalRate()) {
$record->setInternalRate(null);
}

// we have to trigger it again, as there is no order defined for the calculator
$this->calculator->calculate($record);
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"kevinpapst/kimai2": "1.11",
"kevinpapst/kimai2": ">1.9",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-symfony": "^0.12",
"symfony/console": "^4.0",
Expand Down

0 comments on commit 183e361

Please sign in to comment.