Fixes for e-invoices

This commit is contained in:
David Bomba 2023-09-06 23:49:19 +10:00
parent 3541324d1a
commit a946cf346d
2 changed files with 13 additions and 13 deletions

View File

@ -220,7 +220,7 @@ class CreateRawPdf implements ShouldQueue
*/ */
private function checkEInvoice(string $pdf): string private function checkEInvoice(string $pdf): string
{ {
if(!$this->entity instanceof Invoice) if(!$this->entity instanceof Invoice || !$this->company->getSetting('enable_e_invoice'))
return $pdf; return $pdf;
$e_invoice_type = $this->entity->client->getSetting('e_invoice_type'); $e_invoice_type = $this->entity->client->getSetting('e_invoice_type');

View File

@ -105,22 +105,22 @@ class BaseModel extends Model
return $value; return $value;
} }
public function __call($method, $params) // public function __call($method, $params)
{ // {
$entity = strtolower(class_basename($this)); // $entity = strtolower(class_basename($this));
if ($entity) { // if ($entity) {
$configPath = "modules.relations.$entity.$method"; // $configPath = "modules.relations.$entity.$method";
if (config()->has($configPath)) { // if (config()->has($configPath)) {
$function = config()->get($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 * @param \Illuminate\Database\Eloquent\Builder $query