fix: minor ui changes (#24125)

* fix: minor ui changes

* fix: slider
This commit is contained in:
Afshan
2020-12-15 09:31:30 +05:30
committed by GitHub
parent 58e8e06ab7
commit 89d14fdf68
2 changed files with 29 additions and 17 deletions

View File

@@ -18,13 +18,18 @@ frappe.ui.form.on('Employee Advance', {
if (!frm.doc.employee) { if (!frm.doc.employee) {
frappe.msgprint(__("Please select employee first")); frappe.msgprint(__("Please select employee first"));
} }
var company_currency = erpnext.get_currency(frm.doc.company); let company_currency = erpnext.get_currency(frm.doc.company);
let currencies = [company_currency];
if (frm.doc.currency && (frm.doc.currency != company_currency)) {
currencies.push(frm.doc.currency);
}
return { return {
filters: { filters: {
"root_type": "Asset", "root_type": "Asset",
"is_group": 0, "is_group": 0,
"company": frm.doc.company, "company": frm.doc.company,
"account_currency": ["in", [frm.doc.currency, company_currency]], "account_currency": ["in", currencies],
} }
}; };
}); });
@@ -181,21 +186,23 @@ frappe.ui.form.on('Employee Advance', {
}, },
currency: function(frm) { currency: function(frm) {
var from_currency = frm.doc.currency; if (frm.doc.currency) {
var company_currency; var from_currency = frm.doc.currency;
if (!frm.doc.company) { var company_currency;
company_currency = erpnext.get_currency(frappe.defaults.get_default("Company")); if (!frm.doc.company) {
} else { company_currency = erpnext.get_currency(frappe.defaults.get_default("Company"));
company_currency = erpnext.get_currency(frm.doc.company); } else {
company_currency = erpnext.get_currency(frm.doc.company);
}
if (from_currency != company_currency) {
frm.events.set_exchange_rate(frm, from_currency, company_currency);
} else {
frm.set_value("exchange_rate", 1.0);
frm.set_df_property('exchange_rate', 'hidden', 1);
frm.set_df_property("exchange_rate", "description", "" );
}
frm.refresh_fields();
} }
if (from_currency != company_currency) {
frm.events.set_exchange_rate(frm, from_currency, company_currency);
} else {
frm.set_value("exchange_rate", 1.0);
frm.set_df_property('exchange_rate', 'hidden', 1);
frm.set_df_property("exchange_rate", "description", "" );
}
frm.refresh_fields();
}, },
set_exchange_rate: function(frm, from_currency, company_currency) { set_exchange_rate: function(frm, from_currency, company_currency) {

View File

@@ -23,6 +23,7 @@
"employee_benefits", "employee_benefits",
"totals", "totals",
"total_amount", "total_amount",
"column_break",
"pro_rata_dispensed_amount" "pro_rata_dispensed_amount"
], ],
"fields": [ "fields": [
@@ -139,11 +140,15 @@
"label": "Company", "label": "Company",
"options": "Company", "options": "Company",
"reqd": 1 "reqd": 1
},
{
"fieldname": "column_break",
"fieldtype": "Column Break"
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-11-25 11:49:05.095101", "modified": "2020-12-14 15:52:08.566418",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Payroll", "module": "Payroll",
"name": "Employee Benefit Application", "name": "Employee Benefit Application",