diff --git a/app/Jobs/Entity/CreateRawPdf.php b/app/Jobs/Entity/CreateRawPdf.php index 921879021c61..593566577b9b 100644 --- a/app/Jobs/Entity/CreateRawPdf.php +++ b/app/Jobs/Entity/CreateRawPdf.php @@ -220,7 +220,7 @@ class CreateRawPdf implements ShouldQueue */ private function checkEInvoice(string $pdf): string { - if(!$this->entity instanceof Invoice) + if(!$this->entity instanceof Invoice || !$this->company->getSetting('enable_e_invoice')) return $pdf; $e_invoice_type = $this->entity->client->getSetting('e_invoice_type'); diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index eb4c1772236a..20f119b0c94f 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -105,22 +105,22 @@ class BaseModel extends Model return $value; } - public function __call($method, $params) - { - $entity = strtolower(class_basename($this)); + // public function __call($method, $params) + // { + // $entity = strtolower(class_basename($this)); - if ($entity) { - $configPath = "modules.relations.$entity.$method"; + // if ($entity) { + // $configPath = "modules.relations.$entity.$method"; - if (config()->has($configPath)) { - $function = config()->get($configPath); + // if (config()->has($configPath)) { + // $function = config()->get($configPath); - return call_user_func_array([$this, $function[0]], $function[1]); - } - } + // return call_user_func_array([$this, $function[0]], $function[1]); + // } + // } - return parent::__call($method, $params); - } + // return parent::__call($method, $params); + // } /** * @param \Illuminate\Database\Eloquent\Builder $query