mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 23:34:28 -04:00
commit
c4076d8428
@ -449,22 +449,26 @@ class InvoiceService
|
||||
if ($force) {
|
||||
$this->invoice->invitations->each(function ($invitation) {
|
||||
(new CreateEntityPdf($invitation))->handle();
|
||||
if ($invitation instanceof InvoiceInvitation)
|
||||
|
||||
if ($invitation->company->enable_e_invoice && $invitation instanceof InvoiceInvitation)
|
||||
{
|
||||
(new CreateEInvoice($invitation->invoice, true))->handle();
|
||||
(new CreateEInvoice($invitation->invoice, true))->handle();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
$this->invoice->invitations->each(function ($invitation) {
|
||||
CreateEntityPdf::dispatch($invitation);
|
||||
if ($invitation instanceof InvoiceInvitation)
|
||||
{
|
||||
CreateEInvoice::dispatch($invitation->invoice, true);
|
||||
}
|
||||
});
|
||||
if($this->invoice->company->enable_e_invoice) {
|
||||
$this->invoice->invitations->each(function ($invitation) {
|
||||
CreateEntityPdf::dispatch($invitation);
|
||||
if ($invitation instanceof InvoiceInvitation) {
|
||||
CreateEInvoice::dispatch($invitation->invoice, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
nlog('failed creating invoices in Touch PDF');
|
||||
}
|
||||
|
@ -196,6 +196,7 @@ class CompanyTransformer extends EntityTransformer
|
||||
'invoice_task_hours' => (bool) $company->invoice_task_hours,
|
||||
'calculate_taxes' => (bool) $company->calculate_taxes,
|
||||
'tax_data' => $company->tax_data ?: new \stdClass,
|
||||
'enable_e_invoice' => (bool) $company->enable_e_invoice,
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user