From 5901b21e787b2b225b1b3eb81e80fb02b94d5ed9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 20 Apr 2020 19:47:29 +1000 Subject: [PATCH] UI elements - Add a "sales order" menu item to the main navbar - Add a "sales order" tab to customer detail page --- ...ail_purchase_orders.html => purchase_orders.html} | 3 ++- .../company/templates/company/sales_orders.html | 12 ++++++++++++ InvenTree/company/templates/company/tabs.html | 4 +--- InvenTree/company/urls.py | 3 ++- InvenTree/templates/navbar.html | 1 + 5 files changed, 18 insertions(+), 5 deletions(-) rename InvenTree/company/templates/company/{detail_purchase_orders.html => purchase_orders.html} (99%) create mode 100644 InvenTree/company/templates/company/sales_orders.html diff --git a/InvenTree/company/templates/company/detail_purchase_orders.html b/InvenTree/company/templates/company/purchase_orders.html similarity index 99% rename from InvenTree/company/templates/company/detail_purchase_orders.html rename to InvenTree/company/templates/company/purchase_orders.html index c83bb90eb1..3f940a93e7 100644 --- a/InvenTree/company/templates/company/detail_purchase_orders.html +++ b/InvenTree/company/templates/company/purchase_orders.html @@ -1,8 +1,9 @@ {% extends "company/company_base.html" %} {% load static %} -{% block details %} {% load i18n %} +{% block details %} + {% include 'company/tabs.html' with tab='po' %}

{% trans "Purchase Orders" %}

diff --git a/InvenTree/company/templates/company/sales_orders.html b/InvenTree/company/templates/company/sales_orders.html new file mode 100644 index 0000000000..57181b0667 --- /dev/null +++ b/InvenTree/company/templates/company/sales_orders.html @@ -0,0 +1,12 @@ +{% extends "company/company_base.html" %} +{% load static %} +{% load i18n %} + +{% block details %} + +{% include 'company/tabs.html' with tab='co' %} + +

{% trans "Sales Orders" %}

+
+ +{% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/tabs.html b/InvenTree/company/templates/company/tabs.html index ea61c40574..8e01bf30c0 100644 --- a/InvenTree/company/templates/company/tabs.html +++ b/InvenTree/company/templates/company/tabs.html @@ -18,12 +18,10 @@ {% endif %} {% if company.is_customer %} - {% if 0 %} - {% trans "Sales Orders" %} + {% trans "Sales Orders" %} {{ company.sales_orders.count }} {% endif %} - {% endif %} {% trans "Notes" %}{% if company.notes %} {% endif %} diff --git a/InvenTree/company/urls.py b/InvenTree/company/urls.py index 3140b7c2d7..af8e1846e1 100644 --- a/InvenTree/company/urls.py +++ b/InvenTree/company/urls.py @@ -15,7 +15,8 @@ company_detail_urls = [ url(r'parts/', views.CompanyDetail.as_view(template_name='company/detail_part.html'), name='company-detail-parts'), url(r'stock/?', views.CompanyDetail.as_view(template_name='company/detail_stock.html'), name='company-detail-stock'), - url(r'purchase-orders/?', views.CompanyDetail.as_view(template_name='company/detail_purchase_orders.html'), name='company-detail-purchase-orders'), + url(r'purchase-orders/?', views.CompanyDetail.as_view(template_name='company/purchase_orders.html'), name='company-detail-purchase-orders'), + url(r'sales-orders/?', views.CompanyDetail.as_view(template_name='company/sales_orders.html'), name='company-detail-sales-orders'), url(r'notes/?', views.CompanyNotes.as_view(), name='company-notes'), url(r'thumbnail/?', views.CompanyImage.as_view(), name='company-image'), diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html index c41ef3718f..3e87faa869 100644 --- a/InvenTree/templates/navbar.html +++ b/InvenTree/templates/navbar.html @@ -22,6 +22,7 @@ {% trans "Sell" %}