Compare commits
1 Commits
develop
...
mergify/bp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d39aed2339 |
293
erpnext/payroll/doctype/salary_slip/salary_slip.js
Normal file
293
erpnext/payroll/doctype/salary_slip/salary_slip.js
Normal file
@@ -0,0 +1,293 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
cur_frm.add_fetch('employee', 'company', 'company');
|
||||
cur_frm.add_fetch('time_sheet', 'total_hours', 'working_hours');
|
||||
|
||||
frappe.ui.form.on("Salary Slip", {
|
||||
setup: function(frm) {
|
||||
$.each(["earnings", "deductions"], function(i, table_fieldname) {
|
||||
frm.get_field(table_fieldname).grid.editable_fields = [
|
||||
{fieldname: 'salary_component', columns: 6},
|
||||
{fieldname: 'amount', columns: 4}
|
||||
];
|
||||
});
|
||||
|
||||
frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function() {
|
||||
return {
|
||||
filters: {
|
||||
employee: frm.doc.employee
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
frm.set_query("salary_component", "earnings", function() {
|
||||
return {
|
||||
filters: {
|
||||
type: "earning"
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("salary_component", "deductions", function() {
|
||||
return {
|
||||
filters: {
|
||||
type: "deduction"
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("employee", function() {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.employee_query",
|
||||
filters: {
|
||||
company: frm.doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
start_date: function(frm) {
|
||||
if (frm.doc.start_date) {
|
||||
frm.trigger("set_end_date");
|
||||
}
|
||||
},
|
||||
|
||||
end_date: function(frm) {
|
||||
frm.events.get_emp_and_working_day_details(frm);
|
||||
},
|
||||
|
||||
set_end_date: function(frm) {
|
||||
frappe.call({
|
||||
method: 'erpnext.payroll.doctype.payroll_entry.payroll_entry.get_end_date',
|
||||
args: {
|
||||
frequency: frm.doc.payroll_frequency,
|
||||
start_date: frm.doc.start_date
|
||||
},
|
||||
callback: function (r) {
|
||||
if (r.message) {
|
||||
frm.set_value('end_date', r.message.end_date);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
company: function(frm) {
|
||||
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);
|
||||
}
|
||||
},
|
||||
|
||||
currency: function(frm) {
|
||||
frm.trigger("set_dynamic_labels");
|
||||
},
|
||||
|
||||
set_dynamic_labels: function(frm) {
|
||||
var company_currency = frm.doc.company? erpnext.get_currency(frm.doc.company): frappe.defaults.get_default("currency");
|
||||
if (frm.doc.employee && frm.doc.currency) {
|
||||
frappe.run_serially([
|
||||
() => frm.events.set_exchange_rate(frm, company_currency),
|
||||
() => frm.events.change_form_labels(frm, company_currency),
|
||||
() => frm.events.change_grid_labels(frm),
|
||||
() => frm.refresh_fields()
|
||||
]);
|
||||
}
|
||||
},
|
||||
|
||||
set_exchange_rate: function(frm, company_currency) {
|
||||
if (frm.doc.docstatus === 0) {
|
||||
if (frm.doc.currency) {
|
||||
var from_currency = frm.doc.currency;
|
||||
if (from_currency != company_currency) {
|
||||
frm.events.hide_loan_section(frm);
|
||||
frappe.call({
|
||||
method: "erpnext.setup.utils.get_exchange_rate",
|
||||
args: {
|
||||
from_currency: from_currency,
|
||||
to_currency: company_currency,
|
||||
},
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
frm.set_value("exchange_rate", flt(r.message));
|
||||
frm.set_df_property('exchange_rate', 'hidden', 0);
|
||||
frm.set_df_property("exchange_rate", "description", "1 " + frm.doc.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", "" );
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
exchange_rate: function(frm) {
|
||||
set_totals(frm);
|
||||
},
|
||||
|
||||
hide_loan_section: function(frm) {
|
||||
frm.set_df_property('section_break_43', 'hidden', 1);
|
||||
},
|
||||
|
||||
change_form_labels: function(frm, company_currency) {
|
||||
frm.set_currency_labels(["base_hour_rate", "base_gross_pay", "base_total_deduction",
|
||||
"base_net_pay", "base_rounded_total", "base_total_in_words", "base_year_to_date", "base_month_to_date", "gross_base_year_to_date"],
|
||||
company_currency);
|
||||
|
||||
frm.set_currency_labels(["hour_rate", "gross_pay", "total_deduction", "net_pay", "rounded_total", "total_in_words", "year_to_date", "month_to_date", "gross_year_to_date"],
|
||||
frm.doc.currency);
|
||||
|
||||
// toggle fields
|
||||
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_year_to_date", "base_month_to_date", "base_gross_year_to_date"],
|
||||
frm.doc.currency != company_currency);
|
||||
},
|
||||
|
||||
change_grid_labels: function(frm) {
|
||||
let fields = ["amount", "year_to_date", "default_amount", "additional_amount", "tax_on_flexible_benefit",
|
||||
"tax_on_additional_salary"];
|
||||
|
||||
frm.set_currency_labels(fields, frm.doc.currency, "earnings");
|
||||
frm.set_currency_labels(fields, frm.doc.currency, "deductions");
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
frm.trigger("toggle_fields");
|
||||
|
||||
var salary_detail_fields = ["formula", "abbr", "statistical_component", "variable_based_on_taxable_salary"];
|
||||
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.trigger("set_dynamic_labels");
|
||||
},
|
||||
|
||||
salary_slip_based_on_timesheet: function(frm) {
|
||||
frm.trigger("toggle_fields");
|
||||
frm.events.get_emp_and_working_day_details(frm);
|
||||
},
|
||||
|
||||
payroll_frequency: function(frm) {
|
||||
frm.trigger("toggle_fields");
|
||||
frm.set_value('end_date', '');
|
||||
},
|
||||
|
||||
employee: function(frm) {
|
||||
frm.events.get_emp_and_working_day_details(frm);
|
||||
},
|
||||
|
||||
leave_without_pay: function(frm) {
|
||||
if (frm.doc.employee && frm.doc.start_date && frm.doc.end_date) {
|
||||
return frappe.call({
|
||||
method: 'process_salary_based_on_working_days',
|
||||
doc: frm.doc,
|
||||
callback: function() {
|
||||
frm.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
toggle_fields: function(frm) {
|
||||
frm.toggle_display(['hourly_wages', 'timesheets'], cint(frm.doc.salary_slip_based_on_timesheet)===1);
|
||||
|
||||
frm.toggle_display(['payment_days', 'total_working_days', 'leave_without_pay'],
|
||||
frm.doc.payroll_frequency != "");
|
||||
},
|
||||
|
||||
get_emp_and_working_day_details: function(frm) {
|
||||
if (frm.doc.employee) {
|
||||
return frappe.call({
|
||||
method: 'get_emp_and_working_day_details',
|
||||
doc: frm.doc,
|
||||
callback: function(r) {
|
||||
if (r.message[1] !== "Leave" && r.message[0]) {
|
||||
frm.fields_dict.absent_days.set_description(__("Unmarked Days is treated as {0}. You can can change this in {1}", [r.message, frappe.utils.get_form_link("Payroll Settings", "Payroll Settings", true)]));
|
||||
}
|
||||
frm.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
frappe.ui.form.on('Salary Slip Timesheet', {
|
||||
time_sheet: function(frm) {
|
||||
set_totals(frm);
|
||||
},
|
||||
timesheets_remove: function(frm) {
|
||||
set_totals(frm);
|
||||
}
|
||||
});
|
||||
|
||||
var set_totals = function(frm) {
|
||||
if (frm.doc.docstatus === 0 && frm.doc.doctype === "Salary Slip") {
|
||||
if (frm.doc.earnings || frm.doc.deductions) {
|
||||
frappe.call({
|
||||
method: "set_totals",
|
||||
doc: frm.doc,
|
||||
callback: function() {
|
||||
frm.refresh_fields();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
frappe.ui.form.on('Salary Detail', {
|
||||
amount: function(frm) {
|
||||
set_totals(frm);
|
||||
},
|
||||
|
||||
earnings_remove: function(frm) {
|
||||
set_totals(frm);
|
||||
},
|
||||
|
||||
deductions_remove: function(frm) {
|
||||
set_totals(frm);
|
||||
},
|
||||
|
||||
salary_component: function(frm, cdt, cdn) {
|
||||
var child = locals[cdt][cdn];
|
||||
if (child.salary_component) {
|
||||
frappe.call({
|
||||
method: "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Salary Component",
|
||||
name: child.salary_component
|
||||
},
|
||||
callback: function(data) {
|
||||
if (data.message) {
|
||||
var result = data.message;
|
||||
frappe.model.set_value(cdt, cdn, 'condition', result.condition);
|
||||
frappe.model.set_value(cdt, cdn, 'amount_based_on_formula', result.amount_based_on_formula);
|
||||
if (result.amount_based_on_formula === 1) {
|
||||
frappe.model.set_value(cdt, cdn, 'formula', result.formula);
|
||||
} else {
|
||||
frappe.model.set_value(cdt, cdn, 'amount', result.amount);
|
||||
}
|
||||
frappe.model.set_value(cdt, cdn, 'statistical_component', result.statistical_component);
|
||||
frappe.model.set_value(cdt, cdn, 'depends_on_payment_days', result.depends_on_payment_days);
|
||||
frappe.model.set_value(cdt, cdn, 'do_not_include_in_total', result.do_not_include_in_total);
|
||||
frappe.model.set_value(cdt, cdn, 'variable_based_on_taxable_salary', result.variable_based_on_taxable_salary);
|
||||
frappe.model.set_value(cdt, cdn, 'is_tax_applicable', result.is_tax_applicable);
|
||||
frappe.model.set_value(cdt, cdn, 'is_flexible_benefit', result.is_flexible_benefit);
|
||||
refresh_field("earnings");
|
||||
refresh_field("deductions");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
amount_based_on_formula: function(frm, cdt, cdn) {
|
||||
var child = locals[cdt][cdn];
|
||||
if (child.amount_based_on_formula === 1) {
|
||||
frappe.model.set_value(cdt, cdn, 'amount', null);
|
||||
} else {
|
||||
frappe.model.set_value(cdt, cdn, 'formula', null);
|
||||
}
|
||||
}
|
||||
});
|
||||
691
erpnext/payroll/doctype/salary_slip/salary_slip.json
Normal file
691
erpnext/payroll/doctype/salary_slip/salary_slip.json
Normal file
@@ -0,0 +1,691 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"creation": "2013-01-10 16:34:15",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Setup",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"posting_date",
|
||||
"employee",
|
||||
"employee_name",
|
||||
"department",
|
||||
"designation",
|
||||
"branch",
|
||||
"payroll_cost_center",
|
||||
"column_break1",
|
||||
"status",
|
||||
"journal_entry",
|
||||
"payroll_entry",
|
||||
"company",
|
||||
"currency",
|
||||
"exchange_rate",
|
||||
"letter_head",
|
||||
"section_break_10",
|
||||
"start_date",
|
||||
"end_date",
|
||||
"salary_structure",
|
||||
"column_break_18",
|
||||
"salary_slip_based_on_timesheet",
|
||||
"payroll_frequency",
|
||||
"section_break_20",
|
||||
"total_working_days",
|
||||
"unmarked_days",
|
||||
"leave_without_pay",
|
||||
"column_break_24",
|
||||
"absent_days",
|
||||
"payment_days",
|
||||
"hourly_wages",
|
||||
"timesheets",
|
||||
"column_break_20",
|
||||
"total_working_hours",
|
||||
"hour_rate",
|
||||
"base_hour_rate",
|
||||
"section_break_26",
|
||||
"bank_name",
|
||||
"bank_account_no",
|
||||
"mode_of_payment",
|
||||
"section_break_32",
|
||||
"deduct_tax_for_unclaimed_employee_benefits",
|
||||
"deduct_tax_for_unsubmitted_tax_exemption_proof",
|
||||
"earning_deduction",
|
||||
"earning",
|
||||
"earnings",
|
||||
"deduction",
|
||||
"deductions",
|
||||
"totals",
|
||||
"gross_pay",
|
||||
"base_gross_pay",
|
||||
"gross_year_to_date",
|
||||
"base_gross_year_to_date",
|
||||
"column_break_25",
|
||||
"total_deduction",
|
||||
"base_total_deduction",
|
||||
"loan_repayment",
|
||||
"loans",
|
||||
"section_break_43",
|
||||
"total_principal_amount",
|
||||
"total_interest_amount",
|
||||
"column_break_45",
|
||||
"total_loan_repayment",
|
||||
"net_pay_info",
|
||||
"net_pay",
|
||||
"base_net_pay",
|
||||
"year_to_date",
|
||||
"base_year_to_date",
|
||||
"column_break_53",
|
||||
"rounded_total",
|
||||
"base_rounded_total",
|
||||
"month_to_date",
|
||||
"base_month_to_date",
|
||||
"section_break_55",
|
||||
"total_in_words",
|
||||
"column_break_69",
|
||||
"base_total_in_words",
|
||||
"leave_details_section",
|
||||
"leave_details",
|
||||
"section_break_75",
|
||||
"amended_from"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"default": "Today",
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Posting Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "employee",
|
||||
"fieldtype": "Link",
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Employee",
|
||||
"oldfieldname": "employee",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Employee",
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "employee.employee_name",
|
||||
"fieldname": "employee_name",
|
||||
"fieldtype": "Read Only",
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Employee Name",
|
||||
"oldfieldname": "employee_name",
|
||||
"oldfieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "employee.department",
|
||||
"fieldname": "department",
|
||||
"fieldtype": "Link",
|
||||
"in_standard_filter": 1,
|
||||
"label": "Department",
|
||||
"oldfieldname": "department",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Department",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.designation",
|
||||
"fetch_from": "employee.designation",
|
||||
"fieldname": "designation",
|
||||
"fieldtype": "Link",
|
||||
"label": "Designation",
|
||||
"oldfieldname": "designation",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Designation",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "employee.branch",
|
||||
"fieldname": "branch",
|
||||
"fieldtype": "Link",
|
||||
"in_standard_filter": 1,
|
||||
"label": "Branch",
|
||||
"oldfieldname": "branch",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Branch",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break1",
|
||||
"fieldtype": "Column Break",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Status",
|
||||
"options": "Draft\nSubmitted\nCancelled",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "journal_entry",
|
||||
"fieldtype": "Link",
|
||||
"label": "Journal Entry",
|
||||
"options": "Journal Entry",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "payroll_entry",
|
||||
"fieldtype": "Link",
|
||||
"label": "Payroll Entry",
|
||||
"options": "Payroll Entry",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"remember_last_selected_value": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"fieldname": "letter_head",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
"label": "Letter Head",
|
||||
"options": "Letter Head",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_10",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "salary_slip_based_on_timesheet",
|
||||
"fieldtype": "Check",
|
||||
"label": "Salary Slip Based on Timesheet",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "start_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Start Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "end_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "End Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "salary_structure",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Salary Structure",
|
||||
"options": "Salary Structure",
|
||||
"read_only": 1,
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:(!doc.salary_slip_based_on_timesheet)",
|
||||
"fieldname": "payroll_frequency",
|
||||
"fieldtype": "Select",
|
||||
"label": "Payroll Frequency",
|
||||
"options": "\nMonthly\nFortnightly\nBimonthly\nWeekly\nDaily"
|
||||
},
|
||||
{
|
||||
"fieldname": "total_working_days",
|
||||
"fieldtype": "Float",
|
||||
"label": "Working Days",
|
||||
"oldfieldname": "total_days_in_month",
|
||||
"oldfieldtype": "Int",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "leave_without_pay",
|
||||
"fieldtype": "Float",
|
||||
"label": "Leave Without Pay",
|
||||
"oldfieldname": "leave_without_pay",
|
||||
"oldfieldtype": "Currency"
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_days",
|
||||
"fieldtype": "Float",
|
||||
"label": "Payment Days",
|
||||
"oldfieldname": "payment_days",
|
||||
"oldfieldtype": "Float",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "hourly_wages",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "timesheets",
|
||||
"fieldtype": "Table",
|
||||
"label": "Salary Slip Timesheet",
|
||||
"options": "Salary Slip Timesheet"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_20",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "total_working_hours",
|
||||
"fieldtype": "Float",
|
||||
"label": "Total Working Hours",
|
||||
"print_hide_if_no_value": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "hour_rate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Hour Rate",
|
||||
"options": "currency",
|
||||
"print_hide_if_no_value": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_26",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "bank_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Bank Name",
|
||||
"oldfieldname": "bank_name",
|
||||
"oldfieldtype": "Data",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "bank_account_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "Bank Account No.",
|
||||
"oldfieldname": "bank_account_no",
|
||||
"oldfieldtype": "Data",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_32",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "deduct_tax_for_unclaimed_employee_benefits",
|
||||
"fieldtype": "Check",
|
||||
"label": "Deduct Tax For Unclaimed Employee Benefits"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "deduct_tax_for_unsubmitted_tax_exemption_proof",
|
||||
"fieldtype": "Check",
|
||||
"label": "Deduct Tax For Unsubmitted Tax Exemption Proof"
|
||||
},
|
||||
{
|
||||
"fieldname": "earning_deduction",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Earning & Deduction",
|
||||
"oldfieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "earning",
|
||||
"fieldtype": "Column Break",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"fieldname": "earnings",
|
||||
"fieldtype": "Table",
|
||||
"label": "Earnings",
|
||||
"oldfieldname": "earning_details",
|
||||
"oldfieldtype": "Table",
|
||||
"options": "Salary Detail"
|
||||
},
|
||||
{
|
||||
"fieldname": "deduction",
|
||||
"fieldtype": "Column Break",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"fieldname": "deductions",
|
||||
"fieldtype": "Table",
|
||||
"label": "Deductions",
|
||||
"oldfieldname": "deduction_details",
|
||||
"oldfieldtype": "Table",
|
||||
"options": "Salary Detail"
|
||||
},
|
||||
{
|
||||
"fieldname": "totals",
|
||||
"fieldtype": "Section Break",
|
||||
"oldfieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "gross_pay",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Gross Pay",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_25",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"depends_on": "total_loan_repayment",
|
||||
"fieldname": "loan_repayment",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Loan repayment"
|
||||
},
|
||||
{
|
||||
"fieldname": "loans",
|
||||
"fieldtype": "Table",
|
||||
"label": "Employee Loan",
|
||||
"options": "Salary Slip Loan",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.docstatus != 0",
|
||||
"fieldname": "section_break_43",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "total_principal_amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Total Principal Amount",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "total_interest_amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Total Interest Amount",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_45",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "total_loan_repayment",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Total Loan Repayment",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "net_pay_info",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "net pay info"
|
||||
},
|
||||
{
|
||||
"fieldname": "net_pay",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Net Pay",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_53",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"bold": 1,
|
||||
"fieldname": "rounded_total",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Rounded Total",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_55",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
"label": "Amended From",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "amended_from",
|
||||
"oldfieldtype": "Data",
|
||||
"options": "Salary Slip",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "employee.payroll_cost_center",
|
||||
"fetch_if_empty": 1,
|
||||
"fieldname": "payroll_cost_center",
|
||||
"fieldtype": "Link",
|
||||
"label": "Payroll Cost Center",
|
||||
"options": "Cost Center",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "mode_of_payment",
|
||||
"fieldtype": "Select",
|
||||
"label": "Mode Of Payment",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "absent_days",
|
||||
"fieldtype": "Float",
|
||||
"label": "Absent Days",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "unmarked_days",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 1,
|
||||
"label": "Unmarked days"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_20",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_24",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_18",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:(doc.docstatus==1 || doc.salary_structure)",
|
||||
"fetch_from": "salary_structure.currency",
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"label": "Currency",
|
||||
"options": "Currency",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "total_deduction",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Total Deduction",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "total_in_words",
|
||||
"fieldtype": "Data",
|
||||
"label": "Total in words",
|
||||
"length": 240,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_75",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "base_hour_rate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Hour Rate (Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"print_hide_if_no_value": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_gross_pay",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Gross Pay (Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"fieldname": "exchange_rate",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 1,
|
||||
"label": "Exchange Rate",
|
||||
"print_hide": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_total_deduction",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Total Deduction (Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_net_pay",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Net Pay (Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"bold": 1,
|
||||
"fieldname": "base_rounded_total",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Rounded Total (Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_total_in_words",
|
||||
"fieldtype": "Data",
|
||||
"label": "Total in words (Company Currency)",
|
||||
"length": 240,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_69",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"description": "Total salary booked for this employee from the beginning of the year (payroll period or fiscal year) up to the current salary slip's end date.",
|
||||
"fieldname": "year_to_date",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Year To Date",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"description": "Total salary booked for this employee from the beginning of the month up to the current salary slip's end date.",
|
||||
"fieldname": "month_to_date",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Month To Date",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_year_to_date",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Year To Date(Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_month_to_date",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Month To Date(Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "leave_details_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Leave Details"
|
||||
},
|
||||
{
|
||||
"fieldname": "leave_details",
|
||||
"fieldtype": "Table",
|
||||
"label": "Leave Details",
|
||||
"options": "Salary Slip Leave",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "gross_year_to_date",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Gross Year To Date",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_gross_year_to_date",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Gross Year To Date(Company Currency)",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-file-text",
|
||||
"idx": 9,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2021-09-01 10:22:52.374549",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Payroll",
|
||||
"name": "Salary Slip",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "HR Manager",
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"read": 1,
|
||||
"role": "Employee"
|
||||
}
|
||||
],
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"timeline_field": "employee",
|
||||
"title_field": "employee_name"
|
||||
}
|
||||
1337
erpnext/payroll/doctype/salary_slip/salary_slip.py
Normal file
1337
erpnext/payroll/doctype/salary_slip/salary_slip.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user