diff --git a/core/navigation.py b/core/navigation.py index 438a304..e7af189 100644 --- a/core/navigation.py +++ b/core/navigation.py @@ -31,8 +31,8 @@ navigations["backend_main"].add_section(clients_section) quotes_section = NavSection("Quotes") -quote_list_item = NavItem("List Quotes", "fa-file-invoice-dollar", "backendni") -quote_create_item = NavItem("Create Quote", "fa-plus-square", "backendni") +quote_list_item = NavItem("List Quotes", "fa-file-invoice-dollar", "quotes") +quote_create_item = NavItem("Create Quote", "fa-plus-square", "quotes_create") quotes_section.add_item(quote_list_item) quotes_section.add_item(quote_create_item) diff --git a/core/urls/backend/__init__.py b/core/urls/backend/__init__.py index f9452ef..27d8563 100644 --- a/core/urls/backend/__init__.py +++ b/core/urls/backend/__init__.py @@ -9,8 +9,9 @@ from core.urls.backend.firewall import urlpatterns as firewallpatterns from core.urls.backend.invoices import urlpatterns as invoicepatterns from core.urls.backend.clientgroups import urlpatterns as clientgrouppatterns from core.urls.backend.currencies import urlpatterns as currencypatterns +from core.urls.backend.quotes import urlpatterns as quotepatterns -urlpatterns = adminpatterns + clientpatterns + dbsettingspatterns + brandpatterns + firewallpatterns + invoicepatterns + clientgrouppatterns + currencypatterns +urlpatterns = adminpatterns + clientpatterns + dbsettingspatterns + brandpatterns + firewallpatterns + invoicepatterns + clientgrouppatterns + currencypatterns + quotepatterns urlpatterns.append(path('admin/', DashboardView.as_view(), name="dashboard")) urlpatterns.append(path('admin/oops/', BackendNotImplementedView.as_view(), name="backendni")) \ No newline at end of file diff --git a/core/urls/backend/quotes.py b/core/urls/backend/quotes.py new file mode 100644 index 0000000..93c40f6 --- /dev/null +++ b/core/urls/backend/quotes.py @@ -0,0 +1,10 @@ +from django.urls import path + +from core.views.backend.quotes import QuoteCreateView, QuoteDeleteView, QuoteEditView, QuoteListView + +urlpatterns = [] + +urlpatterns.append(path('admin/quotes/', QuoteListView.as_view(), name="quotes")) +urlpatterns.append(path("admin/quotes//delete/", QuoteDeleteView.as_view(), name="quotes_delete")) +urlpatterns.append(path("admin/quotes//edit/", QuoteEditView.as_view(), name="quotes_edit")) +urlpatterns.append(path("admin/quotes/create/", QuoteCreateView.as_view(), name="quotes_create")) \ No newline at end of file diff --git a/core/views/backend/invoices.py b/core/views/backend/invoices.py index b986b31..82588d5 100644 --- a/core/views/backend/invoices.py +++ b/core/views/backend/invoices.py @@ -13,7 +13,7 @@ class InvoiceEditView(BackendUpdateView): template_name = f"{settings.EXPEPHALON_BACKEND}/invoices/update.html" model = Invoice success_url = reverse_lazy("invoices") - fields = ["name", "logo", "address1", "address2", "zip", "city", "state", "country", "vat_id", "company_id"] + fields = ["client", "brand", "number", "created", "due", "payment_method", "currency"] title = "Edit Invoice" class InvoiceDeleteView(BackendDeleteView): diff --git a/core/views/backend/quotes.py b/core/views/backend/quotes.py new file mode 100644 index 0000000..ebaa2dd --- /dev/null +++ b/core/views/backend/quotes.py @@ -0,0 +1,30 @@ +from django.conf import settings +from django.urls import reverse_lazy + +from core.models.quotes import QuoteItem, Quote +from core.views.backend.generic import BackendListView, BackendUpdateView, BackendDeleteView, BackendCreateView + +class QuoteListView(BackendListView): + template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/index.html" + model = Quote + title = "Quotes" + +class QuoteEditView(BackendUpdateView): + template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/update.html" + model = Quote + success_url = reverse_lazy("quotes") + fields = ["client", "brand", "number", "created", "expiry", "currency"] + title = "Edit Quote" + +class QuoteDeleteView(BackendDeleteView): + template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/delete.html" + model = Quote + success_url = reverse_lazy("quotes") + title = "Delete Quote" + +class QuoteCreateView(BackendCreateView): + template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/create.html" + model = Quote + success_url = reverse_lazy("quotes") + fields = ["client", "brand", "number", "created", "expiry", "currency"] + title = "Create Quote" diff --git a/templates/backend/invoices/delete.html b/templates/backend/invoices/delete.html index b44b2f3..424bfb5 100644 --- a/templates/backend/invoices/delete.html +++ b/templates/backend/invoices/delete.html @@ -40,7 +40,7 @@ - + Cancel {% endbuttons %} diff --git a/templates/backend/invoices/update.html b/templates/backend/invoices/update.html index e85a5fa..4c71397 100644 --- a/templates/backend/invoices/update.html +++ b/templates/backend/invoices/update.html @@ -8,7 +8,7 @@ -
Invoice - Edit Invoice +
Invoices - Edit Invoice
Edit invoice
@@ -40,7 +40,7 @@ - + Cancel {% endbuttons %} diff --git a/templates/backend/quotes/create.html b/templates/backend/quotes/create.html new file mode 100644 index 0000000..f572430 --- /dev/null +++ b/templates/backend/quotes/create.html @@ -0,0 +1,57 @@ +{% extends "backend/base.html" %} +{% load bootstrap4 %} +{% block content %} +
+
+
+
+ + +
+
Quotes - Create Quote +
Create a new quote +
+
+
+
+ + +
+
+
+
+
+
+
+
+ + Create Quote +
+
+
+
+
+
+ {% csrf_token %} + {% bootstrap_form form %} + {% buttons %} + + + Cancel + + {% endbuttons %} +
+
+
+
+
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/backend/quotes/delete.html b/templates/backend/quotes/delete.html new file mode 100644 index 0000000..4db53dd --- /dev/null +++ b/templates/backend/quotes/delete.html @@ -0,0 +1,57 @@ +{% extends "backend/base.html" %} +{% load bootstrap4 %} +{% block content %} +
+
+
+
+ + +
+
Quotes - Delete Quote +
Delete an quote from the system +
+
+
+
+ + +
+
+
+
+
+
+
+
+ + Deleting invoice {{ object.number or object.id }} +
+
+
+
+
+
+ {% csrf_token %} + Are you sure you wish to delete quote {{ object.number or object.id }}? + {% buttons %} + + + Cancel + + {% endbuttons %} +
+
+
+
+
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/backend/quotes/index.html b/templates/backend/quotes/index.html new file mode 100644 index 0000000..efa5130 --- /dev/null +++ b/templates/backend/quotes/index.html @@ -0,0 +1,69 @@ +{% extends "backend/base.html" %} +{% block content %} +
+
+
+
+ + +
+
Quotes +
Create, edit and delete quotes +
+
+
+ +
+
+
+
+
+
+
+ + Active Quotes +
+
+
+
+
+
+ + + + + + + + + + + + + + {% for quote in object_list %} + + + + + + + + + + {% endfor %} + +
IDQuote NumberRecipientTotal (net)Total (gross)StatusOptions
{{ quote.id }}{{ quote.number }}{{ quote.client.user.get_full_name }}{{ quote.total_net }}{{ quote.total_gross }}{{ quote.status }}
+
+
+
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/backend/quotes/update.html b/templates/backend/quotes/update.html new file mode 100644 index 0000000..e2ce821 --- /dev/null +++ b/templates/backend/quotes/update.html @@ -0,0 +1,57 @@ +{% extends "backend/base.html" %} +{% load bootstrap4 %} +{% block content %} +
+
+
+
+ + +
+
Quotes - Edit Quote +
Edit quote +
+
+
+
+ + +
+
+
+
+
+
+
+
+ + Editing {{ object.number or object.id }} +
+
+
+
+
+
+ {% csrf_token %} + {% bootstrap_form form %} + {% buttons %} + + + Cancel + + {% endbuttons %} +
+
+
+
+
+
+
+ + + +{% endblock %} \ No newline at end of file