1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

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
{
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');

View File

@ -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