Skip to content

Commit

Permalink
require correct kimai version, fix float conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst authored Dec 30, 2022
2 parents de343e2 + 04548e3 commit 3f9c04d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0']
php: ['7.4', '8.0', '8.1']

name: Linting - PHP ${{ matrix.php }}
steps:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.2

Compatible with Kimai 1.22.0

- Fixed: import of float values for "rate", "hourly rate", "fixed rate" and "internal rate"

## 1.0

Compatible with Kimai 1.21.0
Expand Down
8 changes: 4 additions & 4 deletions Importer/TimesheetImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,16 @@ public function import(array $rows, bool $dryRun): ImportData
}

if (!empty($record['Rate'])) {
$timesheet->setRate($record['Rate']);
$timesheet->setRate((float) $record['Rate']);
}
if (!empty($record['HourlyRate'])) {
$timesheet->setHourlyRate($record['HourlyRate']);
$timesheet->setHourlyRate((float) $record['HourlyRate']);
}
if (!empty($record['FixedRate'])) {
$timesheet->setFixedRate($record['FixedRate']);
$timesheet->setFixedRate((float) $record['FixedRate']);
}
if (!empty($record['InternalRate'])) {
$timesheet->setInternalRate($record['InternalRate']);
$timesheet->setInternalRate((float) $record['InternalRate']);
}

if (!$dryRun) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This plugin is compatible with the following Kimai releases:

| Bundle version | Minimum Kimai version |
|----------------|-----------------------|
| 1.0 | 1.22.0 |
| 1.0 - 1.2 | 1.22.0 |

You find the most notable changes between the versions in the file [CHANGELOG.md](CHANGELOG.md).

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A Kimai plugin to import data from CSV files via Web UI",
"homepage": "https://www.kimai.org/store/import-bundle.html",
"type": "kimai-plugin",
"version": "1.0",
"version": "1.2",
"keywords": [
"kimai",
"kimai-plugin"
Expand Down Expand Up @@ -53,7 +53,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"kevinpapst/kimai2": "^1.21.0",
"kevinpapst/kimai2": "^1.22.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"symfony/console": "^4.0",
Expand Down

0 comments on commit 3f9c04d

Please sign in to comment.