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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user