ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co
https://gauzy.co
GNU Affero General Public License v3.0
2.29k stars 540 forks source link

Bug: Calculation when no. of employees change #673

Open rmagon opened 4 years ago

rmagon commented 4 years ago

Let's say a company has 11 employees in January, in February all split expenses will get divided by 11 employees because the formula is like "Expense / no. of employees".

Now, in March .. one employee was added.

All split expenses in March, April etc. should be divided by 12, but calculations in Feb should be divided by 11 and not 12.

So the formula should change to "Expenses / (no. of employees created BEFORE the END of the expense month)".

@evereq Please confirm if this needs to be done and if the above formula is correct.

evereq commented 4 years ago

@rmagon 100% correct :)

rmagon commented 4 years ago

@evereq Should this consider the no. of employees as per their creation date, or some field from when they started work? It might be that we created an employee today but they started working a month back etc.

I see there is a field in the UI creation modal called 'date when started work' but it does not have any implementation in the backend or in the edit section.

So should we implement such a field too? And if yes should it be a mandatory field with the default value set to the creation date.

Screen Shot 2020-03-22 at 8 40 06 PM

Also, should the employees in the accounting dashboard be shown depending upon the field (created at or started work on whichever we decide)? For example for January, 2020 we should only show the employees that were used in the formula to calculate the expense for January, 2020? Or all of them?

Screen Shot 2020-03-22 at 8 41 16 PM
evereq commented 4 years ago

@rmagon what you explaining totally makes sense to me, we should use the date when the employee started work to decide if we need to display employee or not, etc.

Btw, it also should be used for a split of expenses, to make sure that employee participate in a split of expense only if he already worked at that month and not yet finish working at that month (i.e. we need to use start date and end date at work if set, both of them)

Regarding default / required - I don't think it should be required to enter that value because it should be possible to create employees before they start work and next someone will forget to add start date completely. More like maybe we should add some notice on that "Add / Edit" employee page near to "Start date" saying that before the value is empty / not set different employee related calculations may be disabled, including payroll, split expenses etc (i.e. such employee will NOT participate in the split, not get payroll calculated, etc). Same, such an employee will not be listed on Dashboard (as he did not start working yet) and only will be visible in the employee's management page (where we can set some status like "Not Started" or something like that.

Does it make sense?