diff --git a/erpnext/hooks.py b/erpnext/hooks.py index fc8d39b7ba..4df83afa10 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -50,7 +50,8 @@ calendars = ["Task", "Production Order", "Leave Application", "Sales Order", "Ho fixtures = ["Web Form"] -website_generators = ["Item Group", "Item", "BOM", "Sales Partner", "Job Opening", "Student Admission"] +website_generators = ["Item Group", "Item", "BOM", "Sales Partner", + "Job Opening", "Student Admission"] website_context = { "favicon": "/assets/erpnext/images/favicon.png", @@ -83,7 +84,7 @@ website_route_rules = [ {"from_route": "/quotations/", "to_route": "order", "defaults": { "doctype": "Quotation", - "parents": [{"label": _("Quotations"), "route": "quotation"}] + "parents": [{"label": _("Quotations"), "route": "quotations"}] } }, {"from_route": "/shipments", "to_route": "Delivery Note"}, diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css index 0245675225..733194a10d 100644 --- a/erpnext/public/css/website.css +++ b/erpnext/public/css/website.css @@ -62,11 +62,6 @@ .featured-products { border-top: 1px solid #EBEFF2; } -.transaction-list-item:hover, -.transaction-list-item:active, -.transaction-list-item:focus { - background-color: #fafbfc; -} .transaction-list-item .indicator { font-weight: inherit; color: #8D99A6; diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less index 79a89a050a..25172a1ffb 100644 --- a/erpnext/public/less/website.less +++ b/erpnext/public/less/website.less @@ -76,12 +76,6 @@ } .transaction-list-item { - &:hover, - &:active, - &:focus { - background-color: @light-bg; - } - .indicator { font-weight: inherit; color: @text-muted; diff --git a/erpnext/schools/doctype/student_group/test_student_group.js b/erpnext/schools/doctype/student_group/test_student_group.js index df72ae9598..634ad18254 100644 --- a/erpnext/schools/doctype/student_group/test_student_group.js +++ b/erpnext/schools/doctype/student_group/test_student_group.js @@ -57,7 +57,7 @@ QUnit.test('Test: Student Group', function(assert){ () => frappe.set_route("Form", ('Student Group/' + index)), () => frappe.timeout(0.5), () => frappe.tests.click_button('Get Students'), - () => frappe.timeout(0.5), + () => frappe.timeout(1), () => { assert.equal(cur_frm.doc.students.length, 5, 'Successfully fetched list of students'); }, diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index c149742fe3..3e5e52fe2a 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -38,10 +38,6 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ var me = this; - if (doc.valid_till && frappe.datetime.get_diff(doc.valid_till, frappe.datetime.get_today()) < 0) { - this.frm.set_intro(__("Validity period of this quotation has ended")); - } - if (doc.__islocal) { this.frm.set_value('valid_till', frappe.datetime.add_months(doc.transaction_date, 1)) } diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 5eb8b06ed8..1e6dbca04b 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -14,6 +14,14 @@ form_grid_templates = { } class Quotation(SellingController): + def set_indicator(self): + if self.docstatus==1: + self.indicator_color = 'blue' + self.indicator_title = 'Submitted' + if self.valid_till and getdate(self.valid_till) < getdate(nowdate()): + self.indicator_color = 'darkgrey' + self.indicator_title = 'Expired' + def validate(self): super(Quotation, self).validate() self.set_status() diff --git a/erpnext/selling/doctype/quotation/quotation_list.js b/erpnext/selling/doctype/quotation/quotation_list.js index 204ace13f4..8baf9b2518 100644 --- a/erpnext/selling/doctype/quotation/quotation_list.js +++ b/erpnext/selling/doctype/quotation/quotation_list.js @@ -1,9 +1,13 @@ frappe.listview_settings['Quotation'] = { add_fields: ["customer_name", "base_grand_total", "status", - "company", "currency"], + "company", "currency", 'valid_till'], get_indicator: function(doc) { if(doc.status==="Submitted") { - return [__("Submitted"), "blue", "status,=,Submitted"]; + if (doc.valid_till && doc.valid_till < frappe.datetime.nowdate()) { + return [__("Expired"), "darkgrey", "valid_till,<," + frappe.datetime.nowdate()]; + } else { + return [__("Submitted"), "blue", "status,=,Submitted"]; + } } else if(doc.status==="Ordered") { return [__("Ordered"), "green", "status,=,Ordered"]; } else if(doc.status==="Lost") { diff --git a/erpnext/templates/includes/order/order_taxes.html b/erpnext/templates/includes/order/order_taxes.html index 471576f4f5..462d77db61 100644 --- a/erpnext/templates/includes/order/order_taxes.html +++ b/erpnext/templates/includes/order/order_taxes.html @@ -1,22 +1,22 @@ {% if doc.taxes %}
-
{{ _("Net Total") }}
-
+
{{ _("Net Total") }}
+
{{ doc.get_formatted("net_total") }}
{% endif %} {% for d in doc.taxes %} {% if d.base_tax_amount > 0 %}
-
{{ d.description }}
-
+
{{ d.description }}
+
{{ d.get_formatted("base_tax_amount") }}
{% endif %} {% endfor %}
-
{{ _("Grand Total") }}
-
+
{{ _("Grand Total") }}
+
{{ doc.get_formatted("grand_total") }} diff --git a/erpnext/templates/includes/transaction_row.html b/erpnext/templates/includes/transaction_row.html index 10d76057d2..0e47f7d399 100644 --- a/erpnext/templates/includes/transaction_row.html +++ b/erpnext/templates/includes/transaction_row.html @@ -1,23 +1,22 @@
- diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 2481808b4f..8a495b19ef 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -7,21 +7,44 @@ {% block title %}{{ doc.name }}{% endblock %} -{% block header %}

{{ doc.name }}

{% endblock %} +{% block header %} +

{{ doc.name }}

+{% endblock %} + +{% block header_actions %} +{{ _("Print") }} +{% endblock %} {% block page_content %}
- + {{ doc.indicator_title or doc.status or "Submitted" }}
{{ frappe.utils.formatdate(doc.transaction_date, 'medium') }} + {% if doc.valid_till %} +

+ {{ _("Valid Till") }}: {{ frappe.utils.formatdate(doc.valid_till, 'medium') }} +

+ {% endif %}
+

+{% if doc.doctype == 'Supplier Quotation' %} + {{ doc.supplier_name}} +{% else %} + {{ doc.customer_name}} +{% endif %} +{% if doc.contact_display %} +
+ {{ doc.contact_display }} +{% endif %} +

+ {% if doc._header %} {{ doc._header }} {% endif %} @@ -31,29 +54,29 @@
-
+
{{ _("Item") }}
-
+
{{ _("Quantity") }}
-
+
{{ _("Amount") }}
{% for d in doc.items %}
-
+
{{ item_name_and_description(d) }}
-
+
{{ d.qty }} {% if d.delivered_qty is defined and d.delivered_qty != None %}

{{ _("Delivered: {0}").format(d.delivered_qty) }}

{% endif %}
-
+
{{ d.get_formatted("amount") }}

{{ _("@ {0}").format(d.get_formatted("rate")) }}

@@ -72,8 +95,8 @@
-
-
+
+
{% if enabled_checkout %} {% if (doc.doctype=="Sales Order" and doc.per_billed <= 0) or (doc.doctype=="Sales Invoice" and doc.outstanding_amount > 0) %} @@ -86,7 +109,7 @@ {% endif %} {% endif %}
- + {% if attachments %}
@@ -106,4 +129,9 @@
{% endif %}
+{% if doc.terms %} +
+

{{ doc.terms }}

+
+{% endif %} {% endblock %} diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index 7551a0f9bb..110eb57504 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -15,7 +15,7 @@ def get_context(context): context.doc.set_indicator() if show_attachments(): - context.attachments = get_attachments(frappe.form_dict.doctype, frappe.form_dict.name) + context.attachments = get_attachments(frappe.form_dict.doctype, frappe.form_dict.name) context.parents = frappe.form_dict.parents context.title = frappe.form_dict.name @@ -28,5 +28,6 @@ def get_context(context): frappe.throw(_("Not Permitted"), frappe.PermissionError) def get_attachments(dt, dn): - return frappe.get_all("File", fields=["name", "file_name", "file_url", "is_private"], - filters = {"attached_to_name": dn, "attached_to_doctype": dt, "is_private":0}) + return frappe.get_all("File", + fields=["name", "file_name", "file_url", "is_private"], + filters = {"attached_to_name": dn, "attached_to_doctype": dt, "is_private":0})