mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-26 01:58:31 +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() {
|
||||
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);
|
||||
return {
|
||||
@@ -178,11 +178,12 @@ frappe.ui.form.on('Employee Advance', {
|
||||
|
||||
currency: function(frm) {
|
||||
var from_currency = frm.doc.currency;
|
||||
var company_currency;
|
||||
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 {
|
||||
var company_currency = erpnext.get_currency(frm.doc.company);
|
||||
company_currency = erpnext.get_currency(frm.doc.company);
|
||||
}
|
||||
if(from_currency == company_currency) {
|
||||
frm.set_value("exchange_rate", 1.0);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, math, erpnext
|
||||
import frappe, math
|
||||
from frappe import _
|
||||
from frappe.utils import flt, rounded, cint
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
|
||||
@@ -15,11 +15,12 @@ frappe.ui.form.on('Additional Salary', {
|
||||
|
||||
if(!frm.doc.currency) return;
|
||||
frm.set_query("salary_component", function() {
|
||||
return {
|
||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
||||
};
|
||||
});
|
||||
return {
|
||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
||||
};
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
employee: function(frm) {
|
||||
|
||||
@@ -104,7 +104,7 @@ var calculate_all = function(doc) {
|
||||
var pro_rata_dispensed_amount = 0;
|
||||
var total_amount = 0;
|
||||
if (doc.max_benefits == 0) {
|
||||
doc.employee_benefits = []
|
||||
doc.employee_benefits = [];
|
||||
} else {
|
||||
for(var i = 0; i < tbl.length; i++){
|
||||
if(cint(tbl[i].amount) > 0) {
|
||||
@@ -115,7 +115,7 @@ var calculate_all = function(doc) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
doc.total_amount = total_amount;
|
||||
doc.remaining_benefit = doc.max_benefits - total_amount;
|
||||
doc.pro_rata_dispensed_amount = pro_rata_dispensed_amount;
|
||||
|
||||
@@ -13,10 +13,10 @@ frappe.ui.form.on('Employee Incentive', {
|
||||
|
||||
if(!frm.doc.currency) return;
|
||||
frm.set_query("salary_component", function() {
|
||||
return {
|
||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
||||
};
|
||||
return {
|
||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
||||
};
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
class EmployeeIncentive(Document):
|
||||
|
||||
@@ -25,7 +25,7 @@ frappe.ui.form.on('Payroll Entry', {
|
||||
"root_type": "Liability",
|
||||
"is_group": 0,
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
@@ -150,11 +150,12 @@ frappe.ui.form.on('Payroll Entry', {
|
||||
},
|
||||
|
||||
currency: function (frm) {
|
||||
var company_currency
|
||||
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 {
|
||||
var company_currency = erpnext.get_currency(frm.doc.company);
|
||||
company_currency = erpnext.get_currency(frm.doc.company);
|
||||
}
|
||||
if (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];
|
||||
if(!frm.doc.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) {
|
||||
calculate_totals(frm);
|
||||
frm.trigger("set_dynamic_labels")
|
||||
frm.trigger("set_dynamic_labels");
|
||||
},
|
||||
|
||||
set_dynamic_labels: function(frm) {
|
||||
@@ -88,7 +88,7 @@ frappe.ui.form.on("Salary Slip", {
|
||||
frm.events.hide_loan_section(frm);
|
||||
}
|
||||
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();
|
||||
},
|
||||
|
||||
@@ -101,9 +101,9 @@ frappe.ui.form.on("Salary Slip", {
|
||||
},
|
||||
|
||||
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"],
|
||||
company_currency);
|
||||
company_currency);
|
||||
|
||||
frm.set_currency_labels(["hour_rate", "gross_pay", "total_deduction", "net_pay", "rounded_total", "total_in_words"],
|
||||
frm.doc.currency);
|
||||
@@ -112,16 +112,16 @@ frappe.ui.form.on("Salary Slip", {
|
||||
+ " = [?] " + company_currency);
|
||||
|
||||
// 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"],
|
||||
frm.doc.currency != company_currency);
|
||||
frm.doc.currency != company_currency);
|
||||
},
|
||||
|
||||
change_grid_labels: function(frm, company_currency) {
|
||||
frm.set_currency_labels(["amount", "default_amount", "additional_amount", "tax_on_flexible_benefit",
|
||||
change_grid_labels: function(frm) {
|
||||
frm.set_currency_labels(["amount", "default_amount", "additional_amount", "tax_on_flexible_benefit",
|
||||
"tax_on_additional_salary"], frm.doc.currency, "earnings");
|
||||
|
||||
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, "deductions");
|
||||
},
|
||||
|
||||
@@ -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['deductions'].grid.set_column_disp(salary_detail_fields,false);
|
||||
calculate_totals(frm);
|
||||
frm.trigger("set_dynamic_labels")
|
||||
frm.trigger("set_dynamic_labels");
|
||||
},
|
||||
|
||||
salary_slip_based_on_timesheet: function(frm) {
|
||||
@@ -199,9 +199,9 @@ var calculate_totals = function(frm) {
|
||||
method: "set_totals",
|
||||
doc: frm.doc,
|
||||
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);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@@ -426,7 +426,6 @@ class SalarySlip(TransactionBase):
|
||||
if self.hour_rate:
|
||||
base_hour_rate = flt(self.hour_rate) * flt(self.exchange_rate)
|
||||
self.db_set("base_hour_rate", base_hour_rate)
|
||||
doc_currency = self.currency
|
||||
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_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'))
|
||||
account_currency = frappe.db.get_value('Account', default_payroll_payable_account, 'account_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.employee = employee
|
||||
|
||||
@@ -26,7 +26,7 @@ frappe.ui.form.on('Salary Structure Assignment', {
|
||||
disabled: 0,
|
||||
currency: frm.doc.currency
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("default_payroll_payable_account", function() {
|
||||
|
||||
@@ -20,10 +20,10 @@ frappe.query_reports["Salary Register"] = {
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"options": "Currency",
|
||||
"label": __("Currency"),
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"options": "Currency",
|
||||
"label": __("Currency"),
|
||||
"default": erpnext.get_currency(frappe.defaults.get_default("Company")),
|
||||
"width": "50px"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user