added basic invoice rendering #97 #93 (#99)

This commit is contained in:
Kevin Papst
2018-01-21 22:50:46 +01:00
committed by GitHub
parent 9a161b8fd9
commit 4cbc5391c0
73 changed files with 2986 additions and 918 deletions

View File

@@ -19,7 +19,7 @@ use App\Entity\Project;
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class ActivityQuery extends VisibilityQuery
class ActivityQuery extends ProjectQuery
{
/**
@@ -27,29 +27,6 @@ class ActivityQuery extends VisibilityQuery
*/
protected $project;
/**
* @var Customer
*/
protected $customer;
/**
* @return Customer
*/
public function getCustomer()
{
return $this->customer;
}
/**
* @param Customer $customer
* @return $this
*/
public function setCustomer(Customer $customer = null)
{
$this->customer = $customer;
return $this;
}
/**
* @return Project
*/

View File

@@ -0,0 +1,69 @@
<?php
/*
* This file is part of the Kimai package.
*
* (c) Kevin Papst <kevin@kevinpapst.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository\Query;
use App\Entity\InvoiceTemplate;
/**
* Can be used for invoice queries.
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class InvoiceQuery extends TimesheetQuery
{
/**
* @var InvoiceTemplate
*/
protected $template;
/**
* @var InvoiceTemplate[]
*/
protected $templates = [];
/**
* @return InvoiceTemplate
*/
public function getTemplate()
{
return $this->template;
}
/**
* @param InvoiceTemplate $template
* @return InvoiceQuery
*/
public function setTemplate($template)
{
$this->template = $template;
return $this;
}
/**
* @return InvoiceTemplate[]
*/
public function getTemplates(): array
{
return $this->templates;
}
/**
* @param InvoiceTemplate[] $templates
* @return InvoiceQuery
*/
public function setTemplates(array $templates)
{
$this->templates = $templates;
return $this;
}
}

View File

@@ -22,7 +22,7 @@ use App\Entity\Project;
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class TimesheetQuery extends BaseQuery
class TimesheetQuery extends ActivityQuery
{
const STATE_ALL = 1;
@@ -47,18 +47,18 @@ class TimesheetQuery extends BaseQuery
* @var Activity
*/
protected $activity;
/**
* @var Project
*/
protected $project;
/**
* @var Customer
*/
protected $customer;
/**
* @var int
*/
protected $state = self::STATE_ALL;
/**
* @var \DateTime
*/
protected $begin;
/**
* @var \DateTime
*/
protected $end;
/**
* @return User
@@ -98,48 +98,6 @@ class TimesheetQuery extends BaseQuery
return $this;
}
/**
* @return Project
*/
public function getProject()
{
return $this->project;
}
/**
* Project overwrites: setCustomer()
* Is overwritten by: setActivity()
*
* @param Project $project
* @return TimesheetQuery
*/
public function setProject(Project $project = null)
{
$this->project = $project;
return $this;
}
/**
* @return Customer
*/
public function getCustomer()
{
return $this->customer;
}
/**
* Project overwrites: none
* Is overwritten by: setActivity() and setProject()
*
* @param Customer $customer
* @return TimesheetQuery
*/
public function setCustomer(Customer $customer = null)
{
$this->customer = $customer;
return $this;
}
/**
* @return int
*/
@@ -165,4 +123,40 @@ class TimesheetQuery extends BaseQuery
return $this;
}
/**
* @return \DateTime
*/
public function getBegin()
{
return $this->begin;
}
/**
* @param \DateTime $begin
* @return TimesheetQuery
*/
public function setBegin($begin)
{
$this->begin = $begin;
return $this;
}
/**
* @return \DateTime
*/
public function getEnd()
{
return $this->end;
}
/**
* @param \DateTime $end
* @return TimesheetQuery
*/
public function setEnd($end)
{
$this->end = $end;
return $this;
}
}