Merge branch 'fronkdev' into 'master'

Added button to send copy of Invoice in PreorderBillingInvoice

See merge request fronk/thetool!1256
This commit is contained in:
Frank Schubert
2025-04-24 12:06:59 +00:00
4 changed files with 66 additions and 1 deletions
@@ -666,6 +666,31 @@ class PreorderBillingInvoiceController extends mfBaseController {
$this->redirect("PreorderBillingInvoice");
}
protected function sendCopyAction() {
$id = $this->request->id;
if(!is_numeric($id) || $id < 1) {
$this->layout()->setFlash("Rechnung nicht gefunden", "error");
$this->redirect("PreorderBillingInvoice");
}
$invoice = new PreorderBillingInvoice($id);
if(!$invoice->id) {
$this->layout()->setFlash("Rechnung nicht gefunden", "error");
$this->redirect("PreorderBillingInvoice");
}
$email = trim($this->request->email_to);
if(!$email) {
$this->layout()->setFlash("Ungültige Emailadresse", "error");
$this->redirect("PreorderBillingInvoice");
}
$invoice->sendByEmail($email);
$this->layout()->setFlash("Rechnungskopie erfolgreich versendet", "success");
$this->redirect("PreorderBillingInvoice");
}
public function _sendEmailInvoices($limit = false) {
$sent = 0;
$defer = 0;