diff --git a/backend/api/base/modal.py b/backend/api/base/modal.py index 823ed93d..ed5ff07b 100644 --- a/backend/api/base/modal.py +++ b/backend/api/base/modal.py @@ -44,6 +44,19 @@ def open_modal(request: HttpRequest, modal_name, context_type=None, context_valu # context["to_city"] = invoice.client_city # context["to_county"] = invoice.client_county # context["to_country"] = invoice.client_country + elif context_type == "edit_invoice_from": + invoice = context_value + try: + invoice = Invoice.objects.get(user=request.user, id=invoice) + except Invoice.DoesNotExist: + return render(request, template_name, context) + + context["from_name"] = invoice.self_name + context["from_company"] = invoice.self_company + context["from_address"] = invoice.self_address + context["from_city"] = invoice.self_city + context["from_county"] = invoice.self_county + context["from_country"] = invoice.self_country elif context_type == "invoice": try: invoice = Invoice.objects.get(id=context_value) diff --git a/frontend/templates/modals/invoices_from_destination.html b/frontend/templates/modals/invoices_from_destination.html index cef26905..74e685ca 100644 --- a/frontend/templates/modals/invoices_from_destination.html +++ b/frontend/templates/modals/invoices_from_destination.html @@ -11,7 +11,7 @@
@@ -19,7 +19,7 @@
@@ -27,7 +27,7 @@
@@ -35,7 +35,7 @@
@@ -43,7 +43,7 @@
@@ -51,7 +51,7 @@