Added Address Invoice view

This commit is contained in:
Frank Schubert
2024-07-10 19:10:51 +02:00
parent bf4b294ca6
commit 2094fd66a2
5 changed files with 164 additions and 11 deletions

View File

@@ -140,6 +140,29 @@ class AddressController extends mfBaseController {
$this->redirect("Address");
}
}
protected function invoiceAction() {
$this->layout()->setTemplate("Address/invoice");
$address_id = $this->request->address_id;
if(!is_numeric($address_id) || $address_id < 1) {
$this->layout()->setFlash("Addresse nicht gefunden", "error");
$this->redirect("Address");
}
$address = new Address($address_id);
if(!$address->id) {
$this->layout()->setFlash("Addresse nicht gefunden", "error");
$this->redirect("Address");
}
$invoices = InvoiceModel::search(["owner_or_billingaddress_id" => $address->id], false, "invoice_date DESC");
$this->layout()->set("invoices", $invoices);
$this->layout()->set("address", $address);
}
protected function editAction() {