Skip to content

Commit

Permalink
Release 1.6.1 (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Nov 26, 2019
1 parent 724eb9c commit 5ee0396
Show file tree
Hide file tree
Showing 27 changed files with 240 additions and 112 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# Change Log

## [1.6.1](https://github.com/kevinpapst/kimai2/tree/1.6.1) (2019-11-26)
[Full Changelog](https://github.com/kevinpapst/kimai2/compare/1.6...1.6.1)

## [1.6](https://github.com/kevinpapst/kimai2/tree/1.6) (2019-11-24)
[Full Changelog](https://github.com/kevinpapst/kimai2/compare/1.5...1.6)

Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Expand Up @@ -8,7 +8,7 @@ you can upgrade your Kimai installation to the latest stable release.
Check below if there are more version specific steps required, which need to be executed after the normal update process.
Perform EACH version specific task between your version and the new one, otherwise you risk data inconsistency or a broken installation.

## [1.6](https://github.com/kevinpapst/kimai2/releases/tag/1.6)
## [1.6](https://github.com/kevinpapst/kimai2/releases/tag/1.6) and [1.6.1](https://github.com/kevinpapst/kimai2/releases/tag/1.6.1)

**New database tables and fields were created, don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**

Expand Down
38 changes: 5 additions & 33 deletions assets/sass/invoice.scss
Expand Up @@ -93,7 +93,6 @@ body.invoice_print {
/* table */

table {
table-layout: fixed;
width: 100%;
}

Expand Down Expand Up @@ -124,19 +123,14 @@ body.invoice_print {
article address {
font-size: 1em;
float: left;
margin: 1em 0;
}

article.address {
margin-bottom: 1.5em;
margin:1em 0 1.5em 0;
}

/* article */

article, table.meta, table.inventory {
margin: 1em 0;
}


article:after {
clear: both;
content: "";
Expand Down Expand Up @@ -182,6 +176,7 @@ body.invoice_print {

table.balance {
float: right;
margin-top: 1em;
th {
text-align: right;
font-weight: normal;
Expand Down Expand Up @@ -226,29 +221,6 @@ body.invoice_print {
table.inventory tbody tr:last-child td {
padding-bottom: 15px
}

table.inventory td:nth-child(1),
table.inventory th:nth-child(1) {
text-align: left;
}

table.inventory td:nth-child(2),
table.inventory th:nth-child(2) {
text-align: center;
width: 20%;
}

table.inventory td:nth-child(3),
table.inventory th:nth-child(3) {
text-align: center;
width: 20%;
}

table.inventory td:nth-child(4),
table.inventory th:nth-child(4) {
text-align: right;
width: 20%;
}

.footer {
border-color: #000;
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Expand Up @@ -31,7 +31,7 @@
"mpdf/mpdf": "^7.1",
"nelmio/api-doc-bundle": "^3.2",
"nelmio/cors-bundle": "^1.5",
"ocramius/proxy-manager": "2.1.1",
"ocramius/proxy-manager": "^2.1.1",
"phpoffice/phpspreadsheet": "^1.4",
"phpoffice/phpword": "^0.15.0",
"psr/log": "^1.1",
Expand Down Expand Up @@ -124,11 +124,14 @@
"post-update-cmd": [
"@auto-scripts"
],
"kimai:code-check": [
"kimai:pre-commit": [
"@kimai:codestyle",
"@kimai:phpstan",
"@kimai:code-lint",
"@kimai:tests-unit",
"@kimai:tests-unit"
],
"kimai:code-check": [
"@kimai:pre-commit",
"@kimai:tests-integration"
],
"kimai:code-lint": [
Expand Down
33 changes: 17 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/build/entrypoints.json
Expand Up @@ -8,7 +8,7 @@
"build/app.926c5dcb.js"
],
"css": [
"build/app.fe1cac78.css"
"build/app.b2938041.css"
]
},
"chart": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"build/0.1a6ffb43.js": "sha384-vuVCyLVj2b4h3jpKl+JSANRCacmXeLk+ihK5T5NZBO7+SJ5Y+o6d4qju116hTPSD",
"build/1.16767f92.js": "sha384-JPoKdrVtBemSiVBoAnmSxLML7xXM9zYeuwOPYQv/kLzt/P4cmLY5r9gH8oaGRPFG",
"build/app.926c5dcb.js": "sha384-DENClAG7XobiwMAnu1d/3xKCmR/7jYHN7/WIf5xdO6VUmYoHdm3QW2cOvxh97nnd",
"build/app.fe1cac78.css": "sha384-Z5aYp8LzFi0TRFbEFhM2SJzVMmesVfuSaDD66Z7vCkpuCO7+TJB+0xXrYdQqwsSF",
"build/app.b2938041.css": "sha384-i4bGiyQZqNVMXkq172uvWaq/m9cIzAkao9b1zbOpESXWGPkOmkTPwSGnqiSJVNAp",
"build/2.dad56560.js": "sha384-oKsefSmRq0GL+Qa6f6jExXvFay3cM6YZFHQRKoAHi2p54UOCtjJfjF2eAB1qykoL",
"build/chart.7f4d7f29.js": "sha384-I57c9DtU3AOG2kzKqIZkIu0hi1aGYHRZ5QG4LKC9+9slzJnAMttPGXoL2cQG3m6y",
"build/calendar.bd4fe3ae.js": "sha384-YRVsW05mn+SMT/9LyfRafnVOGV6c6MN6eKjIX0gcq2BWl97HrieuWZgeR0g8hPtU",
Expand Down
2 changes: 1 addition & 1 deletion public/build/manifest.json
Expand Up @@ -2,7 +2,7 @@
"build/0.1a6ffb43.js": "build/0.1a6ffb43.js",
"build/1.16767f92.js": "build/1.16767f92.js",
"build/2.dad56560.js": "build/2.dad56560.js",
"build/app.css": "build/app.fe1cac78.css",
"build/app.css": "build/app.b2938041.css",
"build/app.js": "build/app.926c5dcb.js",
"build/calendar.css": "build/calendar.ade7bcdf.css",
"build/calendar.js": "build/calendar.bd4fe3ae.js",
Expand Down
3 changes: 2 additions & 1 deletion src/Command/ImportTimesheetCommand.php
Expand Up @@ -42,7 +42,8 @@ class ImportTimesheetCommand extends Command
{
protected static $defaultName = 'kimai:import:timesheet';

public const DEFAULT_BEGIN = '00:00';
// if we use 00:00 we might run into summer/winter time problems which happen between 02:00 and 03:00
public const DEFAULT_BEGIN = '04:00';
public const DEFAULT_CUSTOMER = 'Imported customer - %s';

private static $supportedHeader = [
Expand Down
12 changes: 5 additions & 7 deletions src/Command/InstallCommand.php
Expand Up @@ -136,12 +136,6 @@ protected function importMigrations(SymfonyStyle $io, OutputInterface $output)

protected function createDatabase(SymfonyStyle $io, InputInterface $input, OutputInterface $output)
{
if (!$this->connection->isConnected() && !$this->connection->connect()) {
throw new \Exception(
sprintf('Database connection could not be established: %s', $this->connection->getDatabase())
);
}

if ($this->connection->isConnected()) {
$io->note(sprintf('Database is existing and connection could be established'));

Expand All @@ -153,7 +147,11 @@ protected function createDatabase(SymfonyStyle $io, InputInterface $input, Outpu
}

$command = $this->getApplication()->find('doctrine:database:create');
$command->run(new ArrayInput([]), $output);
$result = $command->run(new ArrayInput(['--if-not-exists' => true]), $output);

if (0 !== $result) {
throw new \Exception('Failed creating database. Check your credentials in DATABASE_URL');
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Constants.php
Expand Up @@ -17,7 +17,7 @@ class Constants
/**
* The current release version
*/
public const VERSION = '1.6';
public const VERSION = '1.6.1';
/**
* The current release status, either "stable" or "dev"
*/
Expand Down
3 changes: 3 additions & 0 deletions src/Controller/InvoiceController.php
Expand Up @@ -287,6 +287,9 @@ public function createTemplateAction(Request $request, ?InvoiceTemplate $copyFro
->setPaymentTerms($copyFrom->getPaymentTerms())
->setAddress($copyFrom->getAddress())
->setNumberGenerator($copyFrom->getNumberGenerator())
->setContact($copyFrom->getContact())
->setPaymentDetails($copyFrom->getPaymentDetails())
->setVatId($copyFrom->getVatId())
;
}

Expand Down
7 changes: 6 additions & 1 deletion src/Invoice/Calculator/AbstractMergedCalculator.php
Expand Up @@ -12,6 +12,7 @@
use App\Entity\Timesheet;
use App\Invoice\InvoiceItem;
use App\Invoice\InvoiceItemInterface;
use App\Invoice\InvoiceItemWithAmountInterface;

abstract class AbstractMergedCalculator extends AbstractCalculator
{
Expand All @@ -32,7 +33,11 @@ protected function mergeInvoiceItems(InvoiceItem $invoiceItem, InvoiceItemInterf
$duration += $entry->getDuration();
}

$invoiceItem->setAmount($invoiceItem->getAmount() + 1);
$amount = 1;
if ($entry instanceof InvoiceItemWithAmountInterface) {
$amount = $entry->getAmount();
}
$invoiceItem->setAmount($invoiceItem->getAmount() + $amount);
$invoiceItem->setUser($entry->getUser());
$invoiceItem->setRate($invoiceItem->getRate() + $entry->getRate());
$invoiceItem->setDuration($duration);
Expand Down
2 changes: 1 addition & 1 deletion src/Invoice/Calculator/ShortInvoiceCalculator.php
Expand Up @@ -45,8 +45,8 @@ public function getEntries()
if (count($keys) > 1) {
$invoiceItem->setAmount(1);
$invoiceItem->setFixedRate($invoiceItem->getRate());
$invoiceItem->setHourlyRate($invoiceItem->getRate());
}
$invoiceItem->setHourlyRate($invoiceItem->getRate());

return [$invoiceItem];
}
Expand Down
11 changes: 7 additions & 4 deletions src/Invoice/InvoiceItem.php
Expand Up @@ -13,7 +13,10 @@
use App\Entity\Project;
use App\Entity\User;

class InvoiceItem
/**
* @internal
*/
final class InvoiceItem
{
/**
* @var float
Expand All @@ -28,7 +31,7 @@ class InvoiceItem
*/
private $rate = 0.00;
/**
* @var int
* @var float
*/
private $amount = 0;
/**
Expand Down Expand Up @@ -141,12 +144,12 @@ public function setRate(float $rate): InvoiceItem
return $this;
}

public function getAmount(): int
public function getAmount(): float
{
return $this->amount;
}

public function setAmount(int $amount): InvoiceItem
public function setAmount(float $amount): InvoiceItem
{
$this->amount = $amount;

Expand Down
15 changes: 15 additions & 0 deletions src/Invoice/InvoiceItemWithAmountInterface.php
@@ -0,0 +1,15 @@
<?php

/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace App\Invoice;

interface InvoiceItemWithAmountInterface
{
public function getAmount(): float;
}

0 comments on commit 5ee0396

Please sign in to comment.