delete invoices (#1652)
* include all meta fields as template variables * support invoice preview via command * support deletion of generated invoices
This commit is contained in:
@@ -396,6 +396,15 @@ final class ServiceInvoice
|
||||
);
|
||||
}
|
||||
|
||||
public function deleteInvoice(Invoice $invoice)
|
||||
{
|
||||
$invoiceDirectory = $this->getInvoicesDirectory();
|
||||
if (is_file($invoiceDirectory . $invoice->getInvoiceFilename())) {
|
||||
$this->fileHelper->removeFile($invoiceDirectory . $invoice->getInvoiceFilename());
|
||||
}
|
||||
$this->invoiceRepository->deleteInvoice($invoice);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param InvoiceQuery $query
|
||||
* @return InvoiceModel
|
||||
|
||||
Reference in New Issue
Block a user