We are developing a salary generation system for a client.
The organization we are aiming at has a hierarchy as follows: Company → Cluster → Business Unit (BU) → Department → Employee
The salary for an employee consists of various components of salary. Each salary component has 3 rules associated with it, a calculation rule (calculate a component as% of another component or% of a fixed number or a fixed number), eligibility rule (regardless of whether an employee / department has the right to a component) and a restriction rule which limits the max and min component.
These rules are editable and can be edited by the end user of the user . Also, these rules are inherited from top to bottom, but if they are defined at a lower level, the rule of the lower level takes precedence.
We have a database in which there are Attendance, Leaves, Bonuses tables, and these rules should also interact with these tables.
The client will generate a payroll for several clients, each of which hosts a separate copy of the database. They may have different interpretations of each component and may have different components.
We are only looking for SQL Server support, and payroll generation will work offline.
We are divided on where to put the logic that uses these rules to create separate tax components (including tax deductions, tax write-offs, allowances, etc.).
Some people advocate magic SPs that take an employee id and make up this month’s salary. Others want the logic to be divided into separate components that will receive dependent data for the employee at the application level and compute these components there.
The order of our priorities: 1. The ability to quickly adapt changes to new customers 2. Long-term maintainability 3. Performance
1 and 2 outweigh 3 here is a big factor, as it will be offline activity.
, .
A ((0.3 * Basic) + 800)
B (0.2 * Basic) + (0.1 * )
SPs , -.
SQL. ?
Application (#.Net) SP?
.
... , LINQ to SQL .
,