Merge branch 'develop' into iff-invoicing

This commit is contained in:
Shivam Mishra 2020-08-14 14:31:31 +00:00 committed by GitHub
commit fe57ed629e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 12 deletions

View File

@ -1621,8 +1621,9 @@ def update_multi_mode_option(doc, pos_profile):
pos_payment_method = pos_payment_method.as_dict() pos_payment_method = pos_payment_method.as_dict()
payment_mode = get_mode_of_payment_info(pos_payment_method.mode_of_payment, doc.company) payment_mode = get_mode_of_payment_info(pos_payment_method.mode_of_payment, doc.company)
payment_mode[0].default = pos_payment_method.default if payment_mode:
append_payment(payment_mode[0]) payment_mode[0].default = pos_payment_method.default
append_payment(payment_mode[0])
def get_all_mode_of_payments(doc): def get_all_mode_of_payments(doc):
return frappe.db.sql(""" return frappe.db.sql("""

View File

@ -5,20 +5,23 @@ cur_frm.add_fetch('employee','employee_name','employee_name');
frappe.ui.form.on("Leave Allocation", { frappe.ui.form.on("Leave Allocation", {
onload: function(frm) { onload: function(frm) {
// Ignore cancellation of doctype on cancel all.
frm.ignore_doctypes_on_cancel_all = ["Leave Ledger Entry"];
if(!frm.doc.from_date) frm.set_value("from_date", frappe.datetime.get_today()); if(!frm.doc.from_date) frm.set_value("from_date", frappe.datetime.get_today());
frm.set_query("employee", function() { frm.set_query("employee", function() {
return { return {
query: "erpnext.controllers.queries.employee_query" query: "erpnext.controllers.queries.employee_query"
} };
}); });
frm.set_query("leave_type", function() { frm.set_query("leave_type", function() {
return { return {
filters: { filters: {
is_lwp: 0 is_lwp: 0
} }
} };
}) });
}, },
refresh: function(frm) { refresh: function(frm) {

View File

@ -19,6 +19,10 @@ frappe.ui.form.on("Leave Application", {
frm.set_query("employee", erpnext.queries.employee); frm.set_query("employee", erpnext.queries.employee);
}, },
onload: function(frm) { onload: function(frm) {
// Ignore cancellation of doctype on cancel all.
frm.ignore_doctypes_on_cancel_all = ["Leave Ledger Entry"];
if (!frm.doc.posting_date) { if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.get_today()); frm.set_value("posting_date", frappe.datetime.get_today());
} }

View File

@ -2,6 +2,10 @@
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on('Leave Encashment', { frappe.ui.form.on('Leave Encashment', {
onload: function(frm) {
// Ignore cancellation of doctype on cancel all.
frm.ignore_doctypes_on_cancel_all = ["Leave Ledger Entry"];
},
setup: function(frm) { setup: function(frm) {
frm.set_query("leave_type", function() { frm.set_query("leave_type", function() {
return { return {
@ -33,7 +37,7 @@ frappe.ui.form.on('Leave Encashment', {
doc: frm.doc, doc: frm.doc,
callback: function(r) { callback: function(r) {
frm.refresh_fields(); frm.refresh_fields();
} }
}); });
} }
} }

View File

@ -9,6 +9,33 @@
<p class="hero-subtitle">{{ greeting_subtitle }}</p> <p class="hero-subtitle">{{ greeting_subtitle }}</p>
{% endif %} {% endif %}
</div> </div>
<div class="search-container">
<div class="website-search" id="search-container">
<div class="dropdown">
<div class="search-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-search">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</div>
<input type="search" class="form-control" placeholder="Search the docs (Press ? to focus)" />
<div class="overflow-hidden shadow dropdown-menu w-100">
</div>
</div>
</div>
<button class="navbar-toggler" type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div> </div>
</section> </section>
@ -54,5 +81,21 @@
</div> </div>
</section> </section>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{%- block script -%}
<script>
frappe.ready(() => {
frappe.setup_search('#search-container', 'kb');
});
</script>
{%- endblock -%}
{%- block style -%}
<style>
.search-container {
margin-top: 1.2rem;
max-width: 500px;
}
</style>
{%- endblock -%}