mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
style: styling changes
This commit is contained in:
@@ -16,7 +16,7 @@ frappe.ui.form.on('Employee Advance', {
|
|||||||
|
|
||||||
frm.set_query("advance_account", function() {
|
frm.set_query("advance_account", function() {
|
||||||
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);
|
var company_currency = erpnext.get_currency(frm.doc.company);
|
||||||
return {
|
return {
|
||||||
@@ -178,11 +178,12 @@ frappe.ui.form.on('Employee Advance', {
|
|||||||
|
|
||||||
currency: function(frm) {
|
currency: function(frm) {
|
||||||
var from_currency = frm.doc.currency;
|
var from_currency = frm.doc.currency;
|
||||||
|
var company_currency;
|
||||||
if (!frm.doc.company) {
|
if (!frm.doc.company) {
|
||||||
var company_currency = erpnext.get_currency(frappe.defaults.get_default("Company"));
|
company_currency = erpnext.get_currency(frappe.defaults.get_default("Company"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var company_currency = erpnext.get_currency(frm.doc.company);
|
company_currency = erpnext.get_currency(frm.doc.company);
|
||||||
}
|
}
|
||||||
if(from_currency == company_currency) {
|
if(from_currency == company_currency) {
|
||||||
frm.set_value("exchange_rate", 1.0);
|
frm.set_value("exchange_rate", 1.0);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe, math, erpnext
|
import frappe, math
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import flt, rounded, cint
|
from frappe.utils import flt, rounded, cint
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
|
|||||||
@@ -15,11 +15,12 @@ frappe.ui.form.on('Additional Salary', {
|
|||||||
|
|
||||||
if(!frm.doc.currency) return;
|
if(!frm.doc.currency) return;
|
||||||
frm.set_query("salary_component", function() {
|
frm.set_query("salary_component", function() {
|
||||||
return {
|
return {
|
||||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
employee: function(frm) {
|
employee: function(frm) {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ var calculate_all = function(doc) {
|
|||||||
var pro_rata_dispensed_amount = 0;
|
var pro_rata_dispensed_amount = 0;
|
||||||
var total_amount = 0;
|
var total_amount = 0;
|
||||||
if (doc.max_benefits == 0) {
|
if (doc.max_benefits == 0) {
|
||||||
doc.employee_benefits = []
|
doc.employee_benefits = [];
|
||||||
} else {
|
} else {
|
||||||
for(var i = 0; i < tbl.length; i++){
|
for(var i = 0; i < tbl.length; i++){
|
||||||
if(cint(tbl[i].amount) > 0) {
|
if(cint(tbl[i].amount) > 0) {
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ frappe.ui.form.on('Employee Incentive', {
|
|||||||
|
|
||||||
if(!frm.doc.currency) return;
|
if(!frm.doc.currency) return;
|
||||||
frm.set_query("salary_component", function() {
|
frm.set_query("salary_component", function() {
|
||||||
return {
|
return {
|
||||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class EmployeeIncentive(Document):
|
class EmployeeIncentive(Document):
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ frappe.ui.form.on('Payroll Entry', {
|
|||||||
"root_type": "Liability",
|
"root_type": "Liability",
|
||||||
"is_group": 0,
|
"is_group": 0,
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -150,11 +150,12 @@ frappe.ui.form.on('Payroll Entry', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
currency: function (frm) {
|
currency: function (frm) {
|
||||||
|
var company_currency
|
||||||
if (!frm.doc.company) {
|
if (!frm.doc.company) {
|
||||||
var company_currency = erpnext.get_currency(frappe.defaults.get_default("Company"));
|
company_currency = erpnext.get_currency(frappe.defaults.get_default("Company"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var company_currency = erpnext.get_currency(frm.doc.company);
|
company_currency = erpnext.get_currency(frm.doc.company);
|
||||||
}
|
}
|
||||||
if (frm.doc.currency) {
|
if (frm.doc.currency) {
|
||||||
if (company_currency != frm.doc.currency) {
|
if (company_currency != frm.doc.currency) {
|
||||||
|
|||||||
@@ -73,13 +73,13 @@ frappe.ui.form.on("Salary Slip", {
|
|||||||
var company = locals[':Company'][frm.doc.company];
|
var company = locals[':Company'][frm.doc.company];
|
||||||
if(!frm.doc.letter_head && company.default_letter_head) {
|
if(!frm.doc.letter_head && company.default_letter_head) {
|
||||||
frm.set_value('letter_head', company.default_letter_head);
|
frm.set_value('letter_head', company.default_letter_head);
|
||||||
};
|
}
|
||||||
frm.trigger("set_dynamic_labels")
|
frm.trigger("set_dynamic_labels");
|
||||||
},
|
},
|
||||||
|
|
||||||
currency: function(frm) {
|
currency: function(frm) {
|
||||||
calculate_totals(frm);
|
calculate_totals(frm);
|
||||||
frm.trigger("set_dynamic_labels")
|
frm.trigger("set_dynamic_labels");
|
||||||
},
|
},
|
||||||
|
|
||||||
set_dynamic_labels: function(frm) {
|
set_dynamic_labels: function(frm) {
|
||||||
@@ -88,7 +88,7 @@ frappe.ui.form.on("Salary Slip", {
|
|||||||
frm.events.hide_loan_section(frm);
|
frm.events.hide_loan_section(frm);
|
||||||
}
|
}
|
||||||
frm.events.change_form_labels(frm, company_currency);
|
frm.events.change_form_labels(frm, company_currency);
|
||||||
frm.events.change_grid_labels(frm, company_currency);
|
frm.events.change_grid_labels(frm);
|
||||||
frm.refresh_fields();
|
frm.refresh_fields();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ frappe.ui.form.on("Salary Slip", {
|
|||||||
change_form_labels: function(frm, company_currency) {
|
change_form_labels: function(frm, company_currency) {
|
||||||
frm.set_currency_labels(["base_hour_rate", "base_gross_pay", "base_total_deduction",
|
frm.set_currency_labels(["base_hour_rate", "base_gross_pay", "base_total_deduction",
|
||||||
"base_net_pay", "base_rounded_total", "base_total_in_words"],
|
"base_net_pay", "base_rounded_total", "base_total_in_words"],
|
||||||
company_currency);
|
company_currency);
|
||||||
|
|
||||||
frm.set_currency_labels(["hour_rate", "gross_pay", "total_deduction", "net_pay", "rounded_total", "total_in_words"],
|
frm.set_currency_labels(["hour_rate", "gross_pay", "total_deduction", "net_pay", "rounded_total", "total_in_words"],
|
||||||
frm.doc.currency);
|
frm.doc.currency);
|
||||||
@@ -114,10 +114,10 @@ frappe.ui.form.on("Salary Slip", {
|
|||||||
// toggle fields
|
// toggle fields
|
||||||
frm.toggle_display(["exchange_rate", "base_hour_rate", "base_gross_pay", "base_total_deduction",
|
frm.toggle_display(["exchange_rate", "base_hour_rate", "base_gross_pay", "base_total_deduction",
|
||||||
"base_net_pay", "base_rounded_total", "base_total_in_words"],
|
"base_net_pay", "base_rounded_total", "base_total_in_words"],
|
||||||
frm.doc.currency != company_currency);
|
frm.doc.currency != company_currency);
|
||||||
},
|
},
|
||||||
|
|
||||||
change_grid_labels: function(frm, company_currency) {
|
change_grid_labels: function(frm) {
|
||||||
frm.set_currency_labels(["amount", "default_amount", "additional_amount", "tax_on_flexible_benefit",
|
frm.set_currency_labels(["amount", "default_amount", "additional_amount", "tax_on_flexible_benefit",
|
||||||
"tax_on_additional_salary"], frm.doc.currency, "earnings");
|
"tax_on_additional_salary"], frm.doc.currency, "earnings");
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ frappe.ui.form.on("Salary Slip", {
|
|||||||
frm.fields_dict['earnings'].grid.set_column_disp(salary_detail_fields,false);
|
frm.fields_dict['earnings'].grid.set_column_disp(salary_detail_fields,false);
|
||||||
frm.fields_dict['deductions'].grid.set_column_disp(salary_detail_fields,false);
|
frm.fields_dict['deductions'].grid.set_column_disp(salary_detail_fields,false);
|
||||||
calculate_totals(frm);
|
calculate_totals(frm);
|
||||||
frm.trigger("set_dynamic_labels")
|
frm.trigger("set_dynamic_labels");
|
||||||
},
|
},
|
||||||
|
|
||||||
salary_slip_based_on_timesheet: function(frm) {
|
salary_slip_based_on_timesheet: function(frm) {
|
||||||
@@ -199,9 +199,9 @@ var calculate_totals = function(frm) {
|
|||||||
method: "set_totals",
|
method: "set_totals",
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
frm.refresh_fields()
|
frm.refresh_fields();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,4 +261,4 @@ frappe.ui.form.on('Salary Detail', {
|
|||||||
frappe.model.set_value(cdt, cdn, 'formula', null);
|
frappe.model.set_value(cdt, cdn, 'formula', null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -426,7 +426,6 @@ class SalarySlip(TransactionBase):
|
|||||||
if self.hour_rate:
|
if self.hour_rate:
|
||||||
base_hour_rate = flt(self.hour_rate) * flt(self.exchange_rate)
|
base_hour_rate = flt(self.hour_rate) * flt(self.exchange_rate)
|
||||||
self.db_set("base_hour_rate", base_hour_rate)
|
self.db_set("base_hour_rate", base_hour_rate)
|
||||||
doc_currency = self.currency
|
|
||||||
company_currency = erpnext.get_company_currency(self.company)
|
company_currency = erpnext.get_company_currency(self.company)
|
||||||
base_total = base_net_pay if self.is_rounding_total_disabled() else base_rounded_total
|
base_total = base_net_pay if self.is_rounding_total_disabled() else base_rounded_total
|
||||||
base_total_in_words = money_in_words(base_total, company_currency)
|
base_total_in_words = money_in_words(base_total, company_currency)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ def create_salary_structures_assignment(employee, salary_structure, default_payr
|
|||||||
frappe.throw(_('Please set "Default Payroll Payable Account" in Company Defaults'))
|
frappe.throw(_('Please set "Default Payroll Payable Account" in Company Defaults'))
|
||||||
account_currency = frappe.db.get_value('Account', default_payroll_payable_account, 'account_currency')
|
account_currency = frappe.db.get_value('Account', default_payroll_payable_account, 'account_currency')
|
||||||
if account_currency != salary_structure.currency:
|
if account_currency != salary_structure.currency:
|
||||||
frappe.throw(_("Account currency of Account: {0} is different than what is specified in salary structure: {1}").format(self.default_payroll_payable_account, self.salary_structure))
|
frappe.throw(_("Account currency of Account: {0} is different than what is specified in salary structure: {1}").format(default_payroll_payable_account, salary_structure))
|
||||||
|
|
||||||
assignment = frappe.new_doc("Salary Structure Assignment")
|
assignment = frappe.new_doc("Salary Structure Assignment")
|
||||||
assignment.employee = employee
|
assignment.employee = employee
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ frappe.ui.form.on('Salary Structure Assignment', {
|
|||||||
disabled: 0,
|
disabled: 0,
|
||||||
currency: frm.doc.currency
|
currency: frm.doc.currency
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.set_query("default_payroll_payable_account", function() {
|
frm.set_query("default_payroll_payable_account", function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user