Fixes in Order / Quotation (#10361)
* Additions in Order Page for Sidebar Menu with "Order" page route * Adjust Columns in order_taxes.html to avoid number breaks for more precisions * Fields additions in transaction_row.html * [fix] style for order pages, indicator for quotation etc * [fix] style for order pages, indicator for quotation etc * [test] add timeout
This commit is contained in:
parent
5ae39ae79a
commit
dbb5154f37
@ -50,7 +50,8 @@ calendars = ["Task", "Production Order", "Leave Application", "Sales Order", "Ho
|
|||||||
|
|
||||||
fixtures = ["Web Form"]
|
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 = {
|
website_context = {
|
||||||
"favicon": "/assets/erpnext/images/favicon.png",
|
"favicon": "/assets/erpnext/images/favicon.png",
|
||||||
@ -83,7 +84,7 @@ website_route_rules = [
|
|||||||
{"from_route": "/quotations/<path:name>", "to_route": "order",
|
{"from_route": "/quotations/<path:name>", "to_route": "order",
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"doctype": "Quotation",
|
"doctype": "Quotation",
|
||||||
"parents": [{"label": _("Quotations"), "route": "quotation"}]
|
"parents": [{"label": _("Quotations"), "route": "quotations"}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{"from_route": "/shipments", "to_route": "Delivery Note"},
|
{"from_route": "/shipments", "to_route": "Delivery Note"},
|
||||||
|
@ -62,11 +62,6 @@
|
|||||||
.featured-products {
|
.featured-products {
|
||||||
border-top: 1px solid #EBEFF2;
|
border-top: 1px solid #EBEFF2;
|
||||||
}
|
}
|
||||||
.transaction-list-item:hover,
|
|
||||||
.transaction-list-item:active,
|
|
||||||
.transaction-list-item:focus {
|
|
||||||
background-color: #fafbfc;
|
|
||||||
}
|
|
||||||
.transaction-list-item .indicator {
|
.transaction-list-item .indicator {
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
color: #8D99A6;
|
color: #8D99A6;
|
||||||
|
@ -76,12 +76,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.transaction-list-item {
|
.transaction-list-item {
|
||||||
&:hover,
|
|
||||||
&:active,
|
|
||||||
&:focus {
|
|
||||||
background-color: @light-bg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.indicator {
|
.indicator {
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
color: @text-muted;
|
color: @text-muted;
|
||||||
|
@ -57,7 +57,7 @@ QUnit.test('Test: Student Group', function(assert){
|
|||||||
() => frappe.set_route("Form", ('Student Group/' + index)),
|
() => frappe.set_route("Form", ('Student Group/' + index)),
|
||||||
() => frappe.timeout(0.5),
|
() => frappe.timeout(0.5),
|
||||||
() => frappe.tests.click_button('Get Students'),
|
() => 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');
|
assert.equal(cur_frm.doc.students.length, 5, 'Successfully fetched list of students');
|
||||||
},
|
},
|
||||||
|
@ -38,10 +38,6 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
|
|
||||||
var me = this;
|
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) {
|
if (doc.__islocal) {
|
||||||
this.frm.set_value('valid_till', frappe.datetime.add_months(doc.transaction_date, 1))
|
this.frm.set_value('valid_till', frappe.datetime.add_months(doc.transaction_date, 1))
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,14 @@ form_grid_templates = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Quotation(SellingController):
|
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):
|
def validate(self):
|
||||||
super(Quotation, self).validate()
|
super(Quotation, self).validate()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
frappe.listview_settings['Quotation'] = {
|
frappe.listview_settings['Quotation'] = {
|
||||||
add_fields: ["customer_name", "base_grand_total", "status",
|
add_fields: ["customer_name", "base_grand_total", "status",
|
||||||
"company", "currency"],
|
"company", "currency", 'valid_till'],
|
||||||
get_indicator: function(doc) {
|
get_indicator: function(doc) {
|
||||||
if(doc.status==="Submitted") {
|
if(doc.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"];
|
return [__("Submitted"), "blue", "status,=,Submitted"];
|
||||||
|
}
|
||||||
} else if(doc.status==="Ordered") {
|
} else if(doc.status==="Ordered") {
|
||||||
return [__("Ordered"), "green", "status,=,Ordered"];
|
return [__("Ordered"), "green", "status,=,Ordered"];
|
||||||
} else if(doc.status==="Lost") {
|
} else if(doc.status==="Lost") {
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
{% if doc.taxes %}
|
{% if doc.taxes %}
|
||||||
<div class="row tax-net-total-row">
|
<div class="row tax-net-total-row">
|
||||||
<div class="col-xs-8 text-right">{{ _("Net Total") }}</div>
|
<div class="col-xs-6 text-right">{{ _("Net Total") }}</div>
|
||||||
<div class="col-xs-4 text-right">
|
<div class="col-xs-6 text-right">
|
||||||
{{ doc.get_formatted("net_total") }}</div>
|
{{ doc.get_formatted("net_total") }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for d in doc.taxes %}
|
{% for d in doc.taxes %}
|
||||||
{% if d.base_tax_amount > 0 %}
|
{% if d.base_tax_amount > 0 %}
|
||||||
<div class="row tax-row">
|
<div class="row tax-row">
|
||||||
<div class="col-xs-8 text-right">{{ d.description }}</div>
|
<div class="col-xs-6 text-right">{{ d.description }}</div>
|
||||||
<div class="col-xs-4 text-right">
|
<div class="col-xs-6 text-right">
|
||||||
{{ d.get_formatted("base_tax_amount") }}</div>
|
{{ d.get_formatted("base_tax_amount") }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="row tax-grand-total-row">
|
<div class="row tax-grand-total-row">
|
||||||
<div class="col-xs-8 text-right text-uppercase h6 text-muted">{{ _("Grand Total") }}</div>
|
<div class="col-xs-6 text-right text-uppercase h6 text-muted">{{ _("Grand Total") }}</div>
|
||||||
<div class="col-xs-4 text-right">
|
<div class="col-xs-6 text-right">
|
||||||
<span class="tax-grand-total bold">
|
<span class="tax-grand-total bold">
|
||||||
{{ doc.get_formatted("grand_total") }}
|
{{ doc.get_formatted("grand_total") }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
<div class="web-list-item transaction-list-item">
|
<div class="web-list-item transaction-list-item">
|
||||||
<a href="/{{ pathname }}/{{ doc.name }}">
|
<a href="/{{ pathname }}/{{ doc.name }}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-4" style='margin-top: -3px;'>
|
||||||
<span class="indicator small {{ doc.indicator_color or "darkgrey" }}">
|
<span class="indicator small {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgrey") }}">
|
||||||
{{ doc.name }}</span>
|
{{ doc.name }}</span>
|
||||||
<div class="small text-muted transaction-time"
|
<div class="small text-muted transaction-time"
|
||||||
title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}">
|
title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}">
|
||||||
{{ frappe.utils.format_datetime(doc.modified, "medium") }}
|
{{ frappe.utils.global_date_format(doc.modified) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4 items-preview ellipsis small">
|
<div class="col-sm-5">
|
||||||
|
<div class="small text-muted items-preview ellipsis">
|
||||||
{{ doc.items_preview }}
|
{{ doc.items_preview }}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-sm-3 text-right bold">
|
<div class="col-sm-3 text-right bold">
|
||||||
{{ doc.get_formatted("grand_total") }}
|
{{ doc.get_formatted("grand_total") }}
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-sm-3 text-right">
|
|
||||||
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,21 +7,44 @@
|
|||||||
|
|
||||||
{% block title %}{{ doc.name }}{% endblock %}
|
{% block title %}{{ doc.name }}{% endblock %}
|
||||||
|
|
||||||
{% block header %}<h1>{{ doc.name }}</h1>{% endblock %}
|
{% block header %}
|
||||||
|
<h1>{{ doc.name }}</h1>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block header_actions %}
|
||||||
|
<a class='btn btn-xs btn-default' href='/printview?doctype={{ doc.doctype}}&name={{ doc.name }}&format={{ print_format }}' target="_blank" rel="noopener noreferrer">{{ _("Print") }}</a>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block page_content %}
|
{% block page_content %}
|
||||||
|
|
||||||
<div class="row transaction-subheading">
|
<div class="row transaction-subheading">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<span class="indicator {{ doc.indicator_color or "darkgrey" }}">
|
<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgrey") }}">
|
||||||
{{ doc.indicator_title or doc.status or "Submitted" }}
|
{{ doc.indicator_title or doc.status or "Submitted" }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 text-muted text-right small">
|
<div class="col-xs-6 text-muted text-right small">
|
||||||
{{ frappe.utils.formatdate(doc.transaction_date, 'medium') }}
|
{{ frappe.utils.formatdate(doc.transaction_date, 'medium') }}
|
||||||
|
{% if doc.valid_till %}
|
||||||
|
<p>
|
||||||
|
{{ _("Valid Till") }}: {{ frappe.utils.formatdate(doc.valid_till, 'medium') }}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p class='small' style='padding-top: 15px;'>
|
||||||
|
{% if doc.doctype == 'Supplier Quotation' %}
|
||||||
|
<b>{{ doc.supplier_name}}</b>
|
||||||
|
{% else %}
|
||||||
|
<b>{{ doc.customer_name}}</b>
|
||||||
|
{% endif %}
|
||||||
|
{% if doc.contact_display %}
|
||||||
|
<br>
|
||||||
|
{{ doc.contact_display }}
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
|
|
||||||
{% if doc._header %}
|
{% if doc._header %}
|
||||||
{{ doc._header }}
|
{{ doc._header }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -31,29 +54,29 @@
|
|||||||
<!-- items -->
|
<!-- items -->
|
||||||
<div class="order-item-table">
|
<div class="order-item-table">
|
||||||
<div class="row order-items order-item-header text-muted">
|
<div class="row order-items order-item-header text-muted">
|
||||||
<div class="col-sm-8 col-xs-6 h6 text-uppercase">
|
<div class="col-sm-6 col-xs-6 h6 text-uppercase">
|
||||||
{{ _("Item") }}
|
{{ _("Item") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2 col-xs-3 text-right h6 text-uppercase">
|
<div class="col-sm-3 col-xs-3 text-right h6 text-uppercase">
|
||||||
{{ _("Quantity") }}
|
{{ _("Quantity") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2 col-xs-3 text-right h6 text-uppercase">
|
<div class="col-sm-3 col-xs-3 text-right h6 text-uppercase">
|
||||||
{{ _("Amount") }}
|
{{ _("Amount") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% for d in doc.items %}
|
{% for d in doc.items %}
|
||||||
<div class="row order-items">
|
<div class="row order-items">
|
||||||
<div class="col-sm-8 col-xs-6">
|
<div class="col-sm-6 col-xs-6">
|
||||||
{{ item_name_and_description(d) }}
|
{{ item_name_and_description(d) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2 col-xs-3 text-right">
|
<div class="col-sm-3 col-xs-3 text-right">
|
||||||
{{ d.qty }}
|
{{ d.qty }}
|
||||||
{% if d.delivered_qty is defined and d.delivered_qty != None %}
|
{% if d.delivered_qty is defined and d.delivered_qty != None %}
|
||||||
<p class="text-muted small">{{
|
<p class="text-muted small">{{
|
||||||
_("Delivered: {0}").format(d.delivered_qty) }}</p>
|
_("Delivered: {0}").format(d.delivered_qty) }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2 col-xs-3 text-right">
|
<div class="col-sm-3 col-xs-3 text-right">
|
||||||
{{ d.get_formatted("amount") }}
|
{{ d.get_formatted("amount") }}
|
||||||
<p class="text-muted small">{{
|
<p class="text-muted small">{{
|
||||||
_("@ {0}").format(d.get_formatted("rate")) }}</p>
|
_("@ {0}").format(d.get_formatted("rate")) }}</p>
|
||||||
@ -72,8 +95,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cart-taxes row small">
|
<div class="cart-taxes row small">
|
||||||
<div class="col-sm-8"><!-- empty --></div>
|
<div class="col-sm-6"><!-- empty --></div>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-6">
|
||||||
{% if enabled_checkout %}
|
{% if enabled_checkout %}
|
||||||
{% if (doc.doctype=="Sales Order" and doc.per_billed <= 0)
|
{% if (doc.doctype=="Sales Order" and doc.per_billed <= 0)
|
||||||
or (doc.doctype=="Sales Invoice" and doc.outstanding_amount > 0) %}
|
or (doc.doctype=="Sales Invoice" and doc.outstanding_amount > 0) %}
|
||||||
@ -106,4 +129,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% if doc.terms %}
|
||||||
|
<div class="terms-and-condition text-muted small">
|
||||||
|
<hr><p>{{ doc.terms }}</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -28,5 +28,6 @@ def get_context(context):
|
|||||||
frappe.throw(_("Not Permitted"), frappe.PermissionError)
|
frappe.throw(_("Not Permitted"), frappe.PermissionError)
|
||||||
|
|
||||||
def get_attachments(dt, dn):
|
def get_attachments(dt, dn):
|
||||||
return frappe.get_all("File", fields=["name", "file_name", "file_url", "is_private"],
|
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})
|
filters = {"attached_to_name": dn, "attached_to_doctype": dt, "is_private":0})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user