Release 2.0.5 (#3888)

- Fixed: mandatory fields / form validation for invoice template
- Added: Duration as calendar title replacer (open: running records)
- Fixed: HTML injection in Calendar
- Fixed: Doctrine Proxies are not initialized (leads to empty customer/project)
- Fixed: tag creation
- Fixed: validation errors do not need to be logged in prod
- Removed: Customer VCard download, as used library is outdated and not maintained
- Added: supporting translations domains in many new places (menu, help_text, page_setup, report, exporter, calendar)
This commit is contained in:
Kevin Papst
2023-03-05 03:08:43 +01:00
committed by GitHub
parent 3b93afabc8
commit 0cbf0053d2
77 changed files with 1306 additions and 874 deletions

View File

@@ -42,7 +42,7 @@ trait CommentTableTypeTrait
return $this->message;
}
public function setMessage(string $message)
public function setMessage(string $message): void
{
$this->message = $message;
}
@@ -52,7 +52,7 @@ trait CommentTableTypeTrait
return $this->createdBy;
}
public function setCreatedBy(User $createdBy)
public function setCreatedBy(User $createdBy): void
{
$this->createdBy = $createdBy;
}
@@ -62,7 +62,7 @@ trait CommentTableTypeTrait
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt)
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
@@ -72,7 +72,7 @@ trait CommentTableTypeTrait
return $this->pinned;
}
public function setPinned(bool $pinned)
public function setPinned(bool $pinned): void
{
$this->pinned = $pinned;
}

View File

@@ -190,6 +190,16 @@ class Invoice implements EntityWithMetaFields
public function setModel(InvoiceModel $model): Invoice
{
$template = $model->getTemplate();
if ($template === null) {
throw new \InvalidArgumentException('Missing invoice template');
}
if ($template->getDueDays() === null || $template->getVat() === null) {
throw new \InvalidArgumentException('Missing due-days or vat setting');
}
$this->customer = $model->getCustomer();
$this->user = $model->getUser();
$this->total = $model->getCalculator()->getTotal();
@@ -201,7 +211,6 @@ class Invoice implements EntityWithMetaFields
$this->createdAt = $createdAt;
$this->timezone = $createdAt->getTimezone()->getName();
$template = $model->getTemplate();
$this->dueDays = $template->getDueDays();
$this->vat = $template->getVat();

View File

@@ -42,11 +42,13 @@ class InvoiceTemplate
#[ORM\Column(name: 'contact', type: 'text', nullable: true)]
private ?string $contact = null;
#[ORM\Column(name: 'due_days', type: 'integer', length: 3, nullable: false)]
#[Assert\NotNull]
#[Assert\Range(min: 0, max: 999)]
private int $dueDays = 30;
private ?int $dueDays = 30;
#[ORM\Column(name: 'vat', type: 'float', nullable: false)]
#[Assert\NotNull]
#[Assert\Range(min: 0.0, max: 99.99)]
private float $vat = 0.00;
private ?float $vat = 0.00;
#[ORM\Column(name: 'calculator', type: 'string', length: 20, nullable: false)]
#[Assert\NotBlank]
#[Assert\Length(max: 20)]
@@ -94,7 +96,7 @@ class InvoiceTemplate
return $this->title;
}
public function setTitle(string $title): InvoiceTemplate
public function setTitle(?string $title): InvoiceTemplate
{
$this->title = $title;
@@ -125,24 +127,24 @@ class InvoiceTemplate
return $this;
}
public function getDueDays(): int
public function getDueDays(): ?int
{
return $this->dueDays;
}
public function setDueDays(int $dueDays): InvoiceTemplate
public function setDueDays(?int $dueDays): InvoiceTemplate
{
$this->dueDays = $dueDays;
return $this;
}
public function getVat(): float
public function getVat(): ?float
{
return $this->vat;
}
public function setVat(float $vat): InvoiceTemplate
public function setVat(?float $vat): InvoiceTemplate
{
$this->vat = $vat;
@@ -154,7 +156,7 @@ class InvoiceTemplate
return $this->company;
}
public function setCompany(string $company): InvoiceTemplate
public function setCompany(?string $company): InvoiceTemplate
{
$this->company = $company;