public function getVatValue(Document $document = null, DefaultSettings $defaultSettings = null) { $vat = 0; if ($document && $document->getVat() !== null) { $vat = $document->getVat()->getValue(); } elseif ($defaultSettings && $defaultSettings->getVat() !== null) { $vat = $defaultSettings->getVat()->getValue(); } return $vat; }
public function setDefaultValues(DefaultSettings $defaultSettings = null) { if ($defaultSettings) { if ($defaultSettings->getCompany()) { $this->get('company')->setValue($defaultSettings->getCompany()->getId()); } if ($defaultSettings->getVat()) { $this->get('vat')->setValue($defaultSettings->getVat()->getId()); } } }