Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions hrms/payroll/doctype/salary_slip/test_salary_slip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2230,16 +2230,6 @@ def make_earning_salary_component(
if setup or test_tax:
make_salary_component(data, test_tax, company_list)

data.append(
{
"salary_component": "Basic Salary",
"abbr": "BS",
"condition": "base < 10000",
"formula": "base*.2",
"type": "Earning",
"amount_based_on_formula": 1,
}
)
return data


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def create_salary_structure_assignment(
leave_encashment_amount_per_day=None,
):
if not currency:
currency = "INR" or "INR"
currency = "INR"

if not allow_duplicate and frappe.db.exists("Salary Structure Assignment", {"employee": employee}):
frappe.db.sql("""delete from `tabSalary Structure Assignment` where employee=%s""", (employee))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ frappe.ui.form.on("Salary Structure Assignment", {
);
frm.page.set_inner_btn_group_as_primary(__("Create"));

frm.add_custom_button(
__("See CTC Break-up"),
function () {
if (!frm.doc.ctc) {
frm.scroll_to_field("ctc");
frappe.throw(
__("Please set employee's total cost to company to see CTC breakup."),
);
}
frappe.set_route("query-report", "Employee CTC Break-up", {
employee: frm.doc.employee,
salary_structure_assignment: frm.doc.name,
});
},
__("Actions"),
);
frm.add_custom_button(
__("Preview Salary Slip"),
function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"currency",
"section_break_7",
"base",
"ctc",
"column_break_9",
"variable",
"amended_from",
Expand Down Expand Up @@ -242,11 +243,17 @@
"fieldtype": "Currency",
"label": "Leave Encashment Amount Per Day",
"options": "currency"
},
{
"allow_on_submit": 1,
"fieldname": "ctc",
"fieldtype": "Currency",
"label": "Total Cost To Company (CTC)"
}
],
"is_submittable": 1,
"links": [],
"modified": "2026-02-26 14:37:43.779340",
"modified": "2026-05-14 13:33:55.869281",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Salary Structure Assignment",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,40 @@ class DuplicateAssignment(frappe.ValidationError):


class SalaryStructureAssignment(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from frappe.types import DF

from hrms.payroll.doctype.employee_benefit_detail.employee_benefit_detail import EmployeeBenefitDetail
from hrms.payroll.doctype.employee_cost_center.employee_cost_center import EmployeeCostCenter

amended_from: DF.Link | None
base: DF.Currency
company: DF.Link
ctc: DF.Currency
currency: DF.Link
department: DF.Link | None
designation: DF.Link | None
employee: DF.Link
employee_benefits: DF.Table[EmployeeBenefitDetail]
employee_name: DF.Data | None
from_date: DF.Date
grade: DF.Link | None
income_tax_slab: DF.Link | None
leave_encashment_amount_per_day: DF.Currency
max_benefits: DF.Currency
payroll_cost_centers: DF.Table[EmployeeCostCenter]
payroll_payable_account: DF.Link | None
salary_structure: DF.Link
tax_deducted_till_date: DF.Currency
taxable_earnings_till_date: DF.Currency
variable: DF.Currency
# end: auto-generated types

def validate(self):
self.validate_dates()
self.validate_company()
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright (c) 2026, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

frappe.query_reports["Employee CTC Break-up"] = {
filters: [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("Company"),
},
{
fieldname: "employee",
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
reqd: 1,
get_query: function () {
let company = frappe.query_report.get_filter_value("company");
return {
filters: {
company: company,
},
};
},
on_change: function () {
frappe.query_report.set_filter_value("salary_structure_assignment", "");
},
},
{
fieldname: "salary_structure_assignment",
label: __("Salary Structure Assignment"),
fieldtype: "Link",
options: "Salary Structure Assignment",
reqd: 1,
get_query: function () {
let employee = frappe.query_report.get_filter_value("employee");
if (!employee) return;
return {
filters: {
employee: employee,
docstatus: 1,
},
};
},
},
],
formatter: function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (data?.bold && value) value = `<strong>${value}</strong>`;
if (column.fieldname == "type" && value) {
let indicator_color = value === "Fixed" ? "blue" : "orange";
value = `<span class="indicator-pill no-indicator-dot ${indicator_color}">${value}</span>`;
}
return value;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"add_total_row": 0,
"add_translate_data": 0,
"columns": [],
"creation": "2026-04-15 23:59:12.988472",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2026-05-14 12:08:50.414476",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Employee CTC Break-up",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Salary Structure Assignment",
"report_name": "Employee CTC Break-up",
"report_type": "Script Report",
"roles": [
{
"role": "HR Manager"
},
{
"role": "System Manager"
},
{
"role": "HR User"
}
],
"timeout": 0
}
Loading
Loading