The use case is that in many jurisdictions, knowing the YTD value for various salary components is useful to an employee from an awareness perspective (on printed salary slip) and is also very useful in varying tax calculations that need to know this value due to ways that tax are applied based on the value. This is a big need that is not in the platform today. I have mentioned the same in other threads.
This has popped up several GitHub issues and forum topics but hasnt yet got the attention:
I’m planning on a customisation template. Not much experience customising ERPNext under the hood. But we can do some new fields/doctypes and add a few scripts to achieve this. Doable with some help from the Pros.
I need this functionality to (In Canada) I will be willing to put some effort into adding this but I don’t have the time currently. I will check back in on the progress and help out if you haven’t figured out a good way.
I am no developer, but my guess would be that there is going to need to be some kind of back end python code that goes in and queries past payslips based on the employee id or some kind of key field. You will have to look up fiscal year information first to know when the “start” month is and then from there go back X months from current month and grab the data. If there is a way to store the data in a table, that would be good so that once the calculation is done once it is good for a full month before having to be queried again. I would think an update to the salary slip doctype would be a good place to capture this. This would save precious resources at server side.