Try ERPNext Buy Support Partners Foundation

V12 HR: Salary structure if not assigned should be inactive

Hi all,

Many changes and implements were done which is good.
But when a Salary structure needs to be updated the only way is to duplicate make the changes and assign again to employees… Lot of work.

So after all changes and assignments, the old structure should be inactive or disabled but the system does not allow or am I not doing well?

If you try to cancel the system does not allow.

Hi,
Will be there a fix or a quick fix to allow a Salary Structure(SS) submitted and assigned (Employees were assigned to another but still have this as active) to be disabled?
Because when you Duplicate the existing Salary Structure and Fix or create the missing Remuneration or Deduction the existing SS assigned is still linked and active and you cannot set Disable or CANCEL…

Hi you better edit your salary structure doctype and allow on submit so u can modify it dont need to create duplicate unless your making different salary structure type per employees . hope this helps. God Bless

Thanks for the tip but should be from the core code and also if i do this to one Company… imagine doing to all how tedious and time spent will be.
Also to mention that you cannot make this change on Customization only by changing the Doctype in which when upgrading will create other issue.
I believe this is a quick fix that can be done to the Core code and released…

I have been trying custom code but no effect on having the YES/NO selection box active… maybe just something missing on the code below:

frappe.ui.form.on(‘Salary Structure’, {
refresh(frm) {
// your code here
console.log(‘Onload/Refresh’);
if (frm.doc.docstatus === 1 && frm.doc.is_active === ‘Yes’) {
//Allow is_active to be set as Active or not
if ($.find(’.control-value.like-disabled-input.bold’)[1].innerText == __(“Yes”)) {
console.log(‘found TESTE…’);
var estadoactivar = $.find("[data-fieldname=‘is_active’]")[0];
var estaactivo = $.find(’.control-value.like-disabled-input.bold’)[1];
var display = getComputedStyle($.find(’.control-value.like-disabled-input.bold’)[1]).display;
if (display === “block”) {
//change to None and activate the other…
estaactivo.style.display = “none”;
var activarestado = getComputedStyle($.find("[data-fieldname=‘is_active’]")[0]).display;
estadoactivar.style.display = ‘block’;
//}
}
}
}
}
});

can u please elaborate your main concern… or the things you want to achieve?

based on your first post your target is just to update the salary structure rather than duplicating it.

I have done so and is not the first time I write about this issue…
Will raise a GitHub issue instead.

Thanks for reading and trying to help.