query; } /** * @param InvoiceQuery $query * @return InvoiceModel */ public function setQuery(InvoiceQuery $query) { $this->query = $query; return $this; } /** * Do not use this method for rendering the invoice, use InvoiceModel::getCalculator()->getEntries() instead. * * @return Timesheet[] */ public function getEntries(): array { return $this->entries; } /** * @param Timesheet[] $entries * @return InvoiceModel */ public function setEntries(array $entries) { $this->entries = $entries; return $this; } /** * @return InvoiceTemplate */ public function getTemplate(): ?InvoiceTemplate { return $this->template; } /** * @param InvoiceTemplate $template * @return InvoiceModel */ public function setTemplate($template) { $this->template = $template; return $this; } /** * @return Customer */ public function getCustomer() { return $this->customer; } /** * @param Customer $customer * @return InvoiceModel */ public function setCustomer($customer) { $this->customer = $customer; return $this; } /** * @return \DateTime */ public function getDueDate(): \DateTime { return new \DateTime('+'.$this->getTemplate()->getDueDays().' days'); } /** * @return \DateTime */ public function getInvoiceDate(): \DateTime { return new \DateTime(); } /** * @param NumberGeneratorInterface $generator * @return InvoiceModel */ public function setNumberGenerator(NumberGeneratorInterface $generator) { $this->generator = $generator; $this->generator->setModel($this); return $this; } /** * @return NumberGeneratorInterface */ public function getNumberGenerator(): NumberGeneratorInterface { return $this->generator; } /** * @param CalculatorInterface $calculator * @return InvoiceModel */ public function setCalculator(CalculatorInterface $calculator) { $this->calculator = $calculator; $this->calculator->setModel($this); return $this; } /** * @return CalculatorInterface */ public function getCalculator(): CalculatorInterface { return $this->calculator; } }