i am trying to build an extension for importing payslips from a file generated by the state payroll software.
i think i need to map the names of fields from this file, to whatever the user has setup as earnings and deductions items. but it seem i am unable to get the names of these through the api? anyone has any experience with this?
There’s already an idea for this using api2, but I suppose this idea could be extended to include api3 as well – which I suppose is what you mean by api since you are writing an Extension.
I haven’t tried Payslip myself, and as far as I can see there isn’t a dedicated endpoint for Payslips.
But if what you’re planning to build is an extension, it might not be a bad idea to create one that converts your data into the BatchCreate format for Payslips.
I don’t see how can that help. Can you maybe clarify?
My workflow is to attach a TXT file generated from an external government software to be able to record the salaries paid. The problem I have is that the fields in this file have a long name coming from the law that defines them, but in accounting people are free to shorten them or make acronyms for convenience. For example a field can be named “Дополнителен придонес за задолжително здравствено осигурување за случај на повреда на работа и професионално заболување”, but in manager just shortened to “Дополнителен придонес ЗЗО“, or to something else for another user. So I need to be able to map the one to the other.
@novica I think you can do this by using previous api endpoint v1. where there are endpoints for PayslipEarningsItem, PayslipDeductionItem . give a try.