2020-12-09 11:41:58 +00:00
|
|
|
# Modèle social français en publicodes
|
2020-11-18 17:53:37 +00:00
|
|
|
|
2021-11-30 16:31:20 +00:00
|
|
|
Ce paquet contient les règles [publicodes](https://publi.codes) utilisées sur https://mon-entreprise.urssaf.fr
|
2020-11-18 17:53:37 +00:00
|
|
|
pour le calcul des cotisations sociales, des impôts et des droits sociaux.
|
2021-02-16 13:30:42 +00:00
|
|
|
|
2021-01-13 15:06:43 +00:00
|
|
|
### Installation
|
2021-02-16 13:30:42 +00:00
|
|
|
|
2021-01-13 15:06:43 +00:00
|
|
|
```
|
2021-02-16 13:30:42 +00:00
|
|
|
npm install publicodes modele-social
|
2021-01-13 15:06:43 +00:00
|
|
|
```
|
2020-11-18 17:53:37 +00:00
|
|
|
|
2021-01-13 15:06:43 +00:00
|
|
|
### Exemple d'utilisation
|
2021-02-16 13:30:42 +00:00
|
|
|
|
2021-01-13 15:06:43 +00:00
|
|
|
```js
|
2021-02-16 13:30:42 +00:00
|
|
|
import Engine, { formatValue } from 'publicodes'
|
|
|
|
import rules from 'modele-social'
|
2021-01-13 15:06:43 +00:00
|
|
|
|
2021-02-16 13:30:42 +00:00
|
|
|
const engine = new Engine(rules)
|
2021-01-13 15:06:43 +00:00
|
|
|
|
|
|
|
const net = engine
|
2021-02-16 13:30:42 +00:00
|
|
|
.setSituation({
|
|
|
|
'contrat salarié . rémunération . brut de base': '3000 €/mois',
|
|
|
|
})
|
|
|
|
.evaluate('contrat salarié . rémunération . net')
|
2021-01-13 15:06:43 +00:00
|
|
|
|
2021-02-16 13:30:42 +00:00
|
|
|
console.log(formatValue(net))
|
2021-01-13 15:06:43 +00:00
|
|
|
```
|
|
|
|
|
2021-11-30 16:31:20 +00:00
|
|
|
👉 **[Voir le tutoriel complet](https://mon-entreprise.urssaf.fr/int%C3%A9gration/biblioth%C3%A8que-de-calcul)**
|